@mutagent/cli) is published on
npm. Every other page assumes you have done the four
steps on this page: install, sign in, choose a workspace, check.
Requirements
You also need a Mutagent account. If you have none, the browser sign-in below creates one.
1. Install
PATH:
command not found, your package
manager’s global bin directory is not on PATH.
2. Sign in
Pick the way that fits who is at the keyboard. All three save a key on this machine. The key works in every workspace you belong to in that organization, for 30 days.- You, in a terminal
- A coding agent, with a person
- CI or an agent with a key
Every command reads
MUTAGENT_API_KEY when it is set, even without mutagent login. A key you
never saved with mutagent login has no saved workspace, so mutagent workspaces use refuses it:
name the workspace with MUTAGENT_WORKSPACE_ID or --workspace instead. Run
mutagent login --json once if you want workspaces use to work.mutagent login --json without --browser and without MUTAGENT_API_KEY cannot ask how to sign in
when there is no terminal, so it fails and tells you to add one of them.
To sign in to another organization, name it. It is preselected on the approval page:
3. Choose a workspace
Every command works in one workspace. Sign-in selects one when it can: the workspace you approved in the browser, or your only workspace. List your workspaces and select one:selected: true marks the current workspace. The workspace is chosen in this order: the
--workspace flag on the command, then the MUTAGENT_WORKSPACE_ID environment variable, then the
workspace you chose with mutagent workspaces use. Create workspaces in the web app at
app.mutagent.io.
4. Check that it worked
workspace object mean you are ready. The CLI asks the server, so the answer is
checked, not read from local settings.
mutagent auth status --json checks the sign-in alone. It returns "authenticated": true, the
endpoint and keyPrefix, and exits 0 when the server accepts the key.
The JSON a successful mutagent login --json prints has the same information:
_directive.next, the follow-up commands to run after a success; on a failure, read
_agentGuidance.fix instead (see which field to read). "workspace": null means no workspace
is selected yet: run step 3.
Exit codes
Exit 3, AUTH_REQUIRED: not signed in
Exit 3, AUTH_REQUIRED: not signed in
No saved key and
MUTAGENT_API_KEY is not set. Sign in (step 2).Exit 3, WORKSPACE_REQUIRED: no workspace selected
Exit 3, WORKSPACE_REQUIRED: no workspace selected
Run
mutagent workspaces list --json, then mutagent workspaces use <workspace-name>. With a
MUTAGENT_API_KEY you did not save with mutagent login, set MUTAGENT_WORKSPACE_ID or pass
--workspace <name-or-id> instead.Exit 2: key expired or invalid
Exit 2: key expired or invalid
The saved key is older than 30 days, was revoked, or is not a Mutagent key. Sign in again.
The browser sign-in timed out
The browser sign-in timed out
Nobody approved the URL within 5 minutes. Run the same command again and approve the new URL.
Settings
To inspect the saved settings:Uninstall
mutagent auth logout first, or delete ~/.config/mutagent.