Overview
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:
- 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_TOKENenvironment variable using a token generated in your Qoder settings.
/loginYou can also use the alias/signin.
When the Browser Cannot Be Opened Automatically
In environments without a graphical interface, Qoder CLI automatically skips launching the browser, and the sign-in screen prints the sign-in URL directly—manually copy it into a browser to complete authentication. An environment is treated as having no graphical interface if any of the following conditions is met:
CIis set;BROWSER=www-browser;DEBIAN_FRONTEND=noninteractive;- inside an SSH session (
SSH_CONNECTION); - on Linux with none of
DISPLAY,WAYLAND_DISPLAY, orMIR_SOCKETset.
Automatic Token Refresh
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).
Obtaining a Token
Create and manage your Personal Access Token on the following page:
https://qoder.com/account/integrations
Authenticating via Environment Variables
Set the token in the QODER_PERSONAL_ACCESS_TOKEN environment variable:
If you have both set theQODER_PERSONAL_ACCESS_TOKENenvironment variable and signed in via/login, authentication uses the PAT from the environment variable first; to use the credentials saved by/login, you must clear this environment variable first.
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. |
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:
If you authenticated using the/logoutYou can also use the alias/signout, which will prompt for confirmation before signing out.
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: In environments without a graphical interface, Qoder CLI automatically skips launching the browser; manually copy the URL printed on the sign-in screen and open it in a browser.
- Sign-in callback failed or timed out: Ensure your local network can access Qoder services. Check your proxy settings if necessary. See Network, Proxy, and VPC.
- PAT is invalid or expired: Go to the account integration page to regenerate the token and update
QODER_PERSONAL_ACCESS_TOKEN.