How to save your API key with clearrun login
Run clearrun login, then paste your key. The CLI saves it on your computer so you don't have to type it again.
Last updated
Steps
Run the login command
npx @clearrun/cli loginYour browser opens the API keys page at api.clearrun.net/account/keys. If it doesn't open, use the link printed in the terminal.
Create a key and copy it
On that page, choose Create API key and copy it. The full key is shown only once.
Paste the key and press Enter
The characters don't show while you paste.
Check that it worked
npx @clearrun/cli whoamiIt shows the masked key and where it came from.
Where the key goes
~/.config/clearrun/config.json. If you set XDG_CONFIG_HOME, it goes in $XDG_CONFIG_HOME/clearrun/config.json. Only your user account can read the file (mode 0600).
The SDK and the MCP server read the same file, so one login covers all three.
Login does not test the key
clearrun login saves the key. It does not send it to ClearRun. A wrong key is saved without an error. You find out on your first score. See Does clearrun login check my key with ClearRun?
Which key wins
--api-keyon the command line- The
CLEARRUN_API_KEYenvironment variable - The file saved by
clearrun login apiKeyinclearrun.config.json
So if CLEARRUN_API_KEY is set, it overrides your saved login.
Remove the saved key
clearrun logout
This deletes the key from the file on your computer. The key itself still works. To turn it off, revoke it on the API keys page. See How to revoke a ClearRun API key.