CLI Commands
login
Thelogin command authenticates you with the Cogni+ platform using a browser-based flow.
Usage
Description
Thelogin command opens your browser to authenticate with Cogni+ and automatically captures the session for use with the CLI. This browser-based authentication allows you to leverage existing web sessions, making the login process seamless if you’re already logged in to Cogni+ in your browser.
Once authenticated, the session is stored securely in your local configuration file and used for subsequent CLI commands that require authentication.
Options
| Option | Description |
|---|---|
--port INTEGER | Port to use for the local callback server (default varies) |
--force | Force re-authentication even if already logged in |
--environment TEXT | API environment to use (local, development, staging, production) |
--debug | Enable debug output for troubleshooting |
--help | Show help message for the login command |
Authentication Flow
- The CLI starts a local web server to receive the authentication callback
- Your default web browser opens to the Cogni+ authentication page
- After you authenticate in the browser, Cogni+ redirects back to the local server
- The CLI captures the session token and stores it in your config file
- The browser window can be closed, and the CLI confirms successful authentication
Examples
Output
A successful login will display:Environments
Cogni+ supports multiple environments that you can connect to:production: The main production environment (default)staging: Pre-production testing environmentdevelopment: Development environmentlocal: For connecting to a locally running Cogni+ instance
Related Commands
cogni logout- Log out from Cogni+ by removing stored sessioncogni init- Initialize Cogni+ CLI with an interactive setup wizard
Tips
- If your browser doesn’t open automatically, the CLI will display a URL you can copy and paste
- Sessions are valid for extended periods, so you typically won’t need to log in frequently
- Use the
--forceflag if you need to switch users or refresh your session - If you’re having connectivity issues, try using the
--debugflag to see more details