Sign in
chartnaut login connects the CLI to your Chartnaut account through your browser. You approve it once per computer, and the CLI stays signed in until you sign out or revoke its key.
Your account needs Starter or above. Plans
Sign in
Run chartnaut login. It prints a code and opens your browser:
$ chartnaut login
Opening your browser… (or go to https://terminal.chartnaut.com/morpheus/cli-auth?code=KTRW-BHXM)
Code: KTRW-BHXMIn the browser, check that the code on the page matches the one in your terminal. The page also shows your computer's name.
Click Connect. If you are signed out of Chartnaut, sign in first and the page comes back.
The page reads Connected. You can close this tab., and the terminal finishes:
Signed in as jane.The code works for 10 minutes. Cancel on the page stops the sign-in, and the terminal prints Sign-in cancelled.
Connect only a code you started yourself. Anyone who gets you to click Connect on their code gets a terminal signed in to your account.
Check who you are signed in as
$ chartnaut whoami
user: jane
plan: starter
token: CLI on Janes-MacBook-Pro.local
scopes: scripts:read scripts:write runs:write
api: https://api.chartnaut.com/v1What signing in creates
Signing in creates an API key named CLI on followed by your computer's name. It has every scope and no expiry date. It is listed with your other keys on the Developers page, in the menu under your name, and revoking it there signs that computer out.
The CLI saves the key in ~/.config/chartnaut/credentials.json, readable only by you. Your own program can sign in the same way with Start a sign-in and Poll a sign-in. On Windows the folder is under your user folder, %USERPROFILE%\.config\chartnaut.
Sign in on a server or over SSH
chartnaut login --no-browser prints the link instead of opening a browser. Open it on any device where you are signed in to Chartnaut, such as your phone, and click Connect. The terminal finishes on its own.
Use a key you already have
For CI or a machine you cannot approve from, make a key under Developers with Create API key, then either save it:
chartnaut login --token cn_live_…or set it in the environment. CHARTNAUT_TOKEN overrides the saved key for every command:
export CHARTNAUT_TOKEN=cn_live_…With CHARTNAUT_TOKEN set, login and logout still change the saved key, and each prints a reminder that the variable is still set and wins. API keys
Switch account or sign in again
chartnaut login on a computer that is already signed in stops there:
Already signed in as jane. Use --force to switch.chartnaut login --force signs in again. Once the new sign-in works, the CLI revokes the key it used before, so you are not left with an old key that still works. If the saved key was already revoked or has expired, a plain chartnaut login signs you in again without --force.
Sign out
$ chartnaut logout
Signed out.logout revokes this computer's key on Chartnaut and deletes the saved copy. If Chartnaut cannot be reached, it deletes the copy and prints Signed out here. Revoke the key in Settings → Developers to finish. Do that on the Developers page.
When sign-in does not work
You see | Cause | What to do |
|---|---|---|
API access is included on Starter and above. on the approval page | Your account is on Free. | Upgrade, then run |
This code has expired. on the page, or | More than 10 minutes passed. | Run |
| This computer has no saved key and | Run |
| The account moved to Free, so its keys stop working. | Upgrade. The same key works again. |
All of these exit with code 3. Errors and exit codes
