Log in
Log in from your terminal, and authenticate in CI where there is no browser.
Log in on your machine
ntro login
ntro whoami # check which account you are usingntro login opens your browser and shows a one-time code in the terminal. Sign in to Nitroship in the browser, confirm the code matches, and approve it. The CLI keeps you logged in from then on.
- No browser opens (for example on a remote server): run
ntro login --no-browser, then open the printed URL on any device and enter the code. - No account yet: sign up in the console and verify your email. Until your email is verified you can only read; creating apps, deploying, and other changes are rejected.
- Log out:
ntro logoutdeletes the login data on this machine and ends the session on the server.
Authenticate in CI and scripts
Where nobody can approve a code in a browser, such as CI, use an API token. Create a token starting with ntro_ in the console and pass it through the NITROSHIP_TOKEN environment variable.
export NITROSHIP_TOKEN='ntro_...'
ntro deploy . --app my-app --prodSee API tokens to create and revoke tokens.
How it works (reference)
Your login is kept by an access token that lasts five minutes, and the CLI gets a new one automatically when it expires. With an ntro_ API token, the CLI likewise swaps it for a five-minute access token before calling the API. That's why, after you revoke an API token, an access token already swapped from it can keep working for up to five more minutes.
CLI configuration covers where login data is stored and which credential wins when several are set.