Authentication is required before using Qoder. When you run a command for the first time, Qoder CLI will automatically prompt you to sign in.Qoder CLI uses Qoder's proprietary authentication system, which primarily offers two authentication methods:
Interactive Sign in (Recommended): Sign in via a browser or by pasting a token in the terminal. Ideal for daily local use.
Environment Variable: Authenticate using a Personal Access Token. Suitable for CI/CD pipelines and headless automation environments.
Interactive Sign in
Launch Qoder CLI in the terminal, then enter /login at the interactive prompt:
Copy
# Start Qoder CLI in the terminalqodercli# At the interactive prompt, enter /login/login
Then, select your preferred sign-in method:
Login with Qoder Platform (Browser): Opens a browser window to authenticate using your Qoder account.
Use Qoder Personal Access Token (QODER_PERSONAL_ACCESS_TOKEN): Sets the QODER_PERSONAL_ACCESS_TOKEN environment variable using a token generated in your Qoder settings.
After making your selection, Qoder CLI will guide you through the remaining steps.
If your environment does not support automatically opening a browser (e.g., remote servers or containers), set the NO_BROWSER=true environment variable. Qoder CLI will then print the sign-in URL for you to manually copy and open in a browser:
After signing in via the browser, Qoder CLI automatically refreshes the token in the background, so you don't need to manually sign in again for daily use.
Using a Personal Access Token
For non-interactive sessions or automated environments (such as CI/CD pipelines), you can authenticate using a Personal Access Token (PAT).
Set the token in the QODER_PERSONAL_ACCESS_TOKEN environment variable:
Copy
# Linux / macOS exampleexport QODER_PERSONAL_ACCESS_TOKEN="your_personal_access_token_here"
Copy
# Windows example (Command Prompt). Do not use quotes, as CMD will include them in the variable valueset QODER_PERSONAL_ACCESS_TOKEN=your_personal_access_token_here
Copy
# Windows example (PowerShell)$env:QODER_PERSONAL_ACCESS_TOKEN="your_personal_access_token_here"
Once set, Qoder CLI will automatically use the PAT for authentication.
If valid tokens are set both via the /login command and this environment variable, the token provided by /login takes precedence.
Authentication-Related Environment Variables
Environment Variable
Description
QODER_PERSONAL_ACCESS_TOKEN
Personal Access Token. Automatically uses PAT authentication when set.
QODER_CONFIG_DIR
Custom configuration directory. Defaults to ~/.qoder.
NO_BROWSER
Prevents the browser from opening automatically and prints the sign-in URL instead when set.
Checking Authentication Status
Enter /status in an interactive session to open the status panel, which includes two tabs: Usage and Status. The Usage tab displays the API quota and token usage for the current session (plan type, quota usage, session duration, total code changes, etc.), while the Status tab shows the current CLI status information. This is the most direct entry point for troubleshooting if you suspect an authentication issue.
Sign out
When you need to sign out of Qoder, enter /logout at the interactive prompt:
Copy
# At the interactive prompt, enter /logout/logout
/logout You can also use the alias /signout, which will prompt for confirmation before signing out.
If you authenticated using the QODER_PERSONAL_ACCESS_TOKEN environment variable, you must clear this environment variable before running /logout. Otherwise, the next startup will automatically sign in using that token again.
Troubleshooting
Browser did not open automatically: Set NO_BROWSER=true and manually visit the printed URL.
Sign-in callback failed or timed out: Ensure your local network can access Qoder services. Check your proxy settings if necessary. See Network and Proxy.
PAT is invalid or expired: Go to the account integration page to regenerate the token and update QODER_PERSONAL_ACCESS_TOKEN.
For more troubleshooting steps, see Sign-in and Authentication Issues.