Skip to main content
The Magnet CLI lets you work with your Magnet workspace from the terminal: list and create issues and pages, search, link directories to workspaces, and register custom sandbox images.

Installation

The CLI ships as a single native binary — no Node.js or other runtime required. Verify the installation:
magnet --version

Authentication

There are two ways to authenticate, depending on whether you’re acting as yourself or as a workspace:
  1. Log in as a user (recommended for local development) — magnet login opens your browser and stores a personal CLI token on your machine.
magnet login
  1. 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_KEY is set, it takes precedence over a stored login.
export MAGNET_API_KEY="your-uuid-api-key"
Check which identity the CLI is using with magnet whoami.

Environment variables

VariableDescription
MAGNET_API_KEYWorkspace API key. Takes precedence over a stored magnet login session.
MAGNET_API_URLBase URL for the Magnet API. Defaults to https://www.magnet.run.

Commands

CommandDescription
magnet loginLog in to Magnet via the browser device flow
magnet logoutRevoke the stored CLI token and remove it
magnet whoamiShow the user or org the CLI is authenticated as
magnet linkLink a directory to a Magnet workspace
magnet issuesList, get, create, or update issues
magnet pagesList, get, create, or update pages
magnet searchSearch issues and pages
magnet sandbox-imageRegister custom sandbox images
All commands output JSON, so they compose well with jq and scripts.