Installation
The CLI ships as a single native binary — no Node.js or other runtime required.- GitHub Releases (recommended)
- npm
Download the binary for your platform from Releases, extract it, and put
magnet (or magnet.exe on Windows) in your PATH:Authentication
There are two ways to authenticate, depending on whether you’re acting as yourself or as a workspace:- Log in as a user (recommended for local development) —
magnet loginopens your browser and stores a personal CLI token on your machine.
- Workspace API key (recommended for CI and scripts) — create an API key in your Magnet workspace settings and set it as an environment variable. When
MAGNET_API_KEYis set, it takes precedence over a stored login.
magnet whoami.
Environment variables
| Variable | Description |
|---|---|
MAGNET_API_KEY | Workspace API key. Takes precedence over a stored magnet login session. |
MAGNET_API_URL | Base URL for the Magnet API. Defaults to https://www.magnet.run. |
Commands
| Command | Description |
|---|---|
magnet login | Log in to Magnet via the browser device flow |
magnet logout | Revoke the stored CLI token and remove it |
magnet whoami | Show the user or org the CLI is authenticated as |
magnet link | Link a directory to a Magnet workspace |
magnet issues | List, get, create, or update issues |
magnet pages | List, get, create, or update pages |
magnet search | Search issues and pages |
magnet sandbox-image | Register custom sandbox images |
jq and scripts.