Skip to main content
The magnet login command authenticates the CLI as your Magnet user. It opens your browser to a confirmation page, and once you approve the displayed code, stores a personal CLI token on your machine (in ~/.magnet/auth.json, scoped to the API base URL).

Usage

If the browser can’t be opened (for example over SSH), the CLI prints the verification URL and code so you can complete the approval from any device.

Options

Examples

Log in on a headless machine:
Reuse a token issued elsewhere (for example, provisioning a container):
  • magnet whoami — check who you’re logged in as
  • magnet logout — revoke the stored token
  • Tokens can also be reviewed and revoked from your Magnet account settings.