Back to Docs

CLI Command Reference & Troubleshooting

Look up supported CLI commands, common options, and recovery steps.

Run mechasm --help for the supported commands and complete syntax:

GroupCommands
Accountlogin, logout, whoami
Diagnosticsdoctor
Teams and projectsteams list, projects list, projects create
Variablesvariables list, variables set, variables unset
Teststests create, tests edit, tests list, tests get, tests run
Runsruns status, runs get, runs wait, runs logs, runs stop, runs video, runs trace, runs variables
Local appslocal register, local list, local select, local ports set, local unregister
Serviceservice start, service stop, service status, service foreground
Updatesupdate

Common options

OptionUse
--api-url URLSet the Mechasm API address provided for your workspace.
--token-stdinRead a scoped access token from standard input.
--project IDSelect the project for test, run, variable, or local-app operations.
--team IDChoose an approved team for project creation; optional when exactly one team is approved.
--value-stdin / --value-file FILESupply a project variable value without placing it in a raw flag.
--prompt TEXT / --prompt-file FILESupply a test prompt; use - as the file to read from standard input.
--name NAMESet a project name with projects create or a test name with tests create / tests edit.
--tags LISTSet test tags with tests create / tests edit.
`—enabled truefalse`
--offset N / --limit NPage test results; offset starts at 0 and limit accepts 1–100.
--idempotency-key KEYRetry a mutation after an unknown result using the same key.
--waitWait for generation or run completion.
--follow / --after CURSORFollow run logs or resume from a saved cursor.
--out FILESave a video or trace to a new local file. Existing files are not overwritten.
--url URL / --ports LISTSet a local app address and its approved ports.
--device-name NAME / --no-browserName the device at login or print a manual approval link.
--versionPrint the installed CLI version.
--jsonWrite machine-readable output to stdout; errors go to stderr.

Troubleshooting

ProblemWhat to check
Permission deniedRun mechasm login again and approve the needed project action or team project-creation access. Your account must already have access to that project or team; ask the team owner if it is missing.
No teams listedSign in again and approve project creation for the needed team. Your account must already belong to the team; ask the team owner if it is missing.
--project requiredCopy the project ID from mechasm projects list; the CLI does not choose a default project.
Token and prompt input conflict--token-stdin and --prompt-file - both read standard input. Use a prompt file or another input source.
Variable value and token input conflict--value-stdin and --token-stdin share standard input; provide the variable using --value-file.
Local run cannot reach appConfirm the app is running, the project address and full port list are correct, and the selected device is online with access to those ports.
Video or trace is not readyRun mechasm runs status RUN_ID --project PROJECT_ID again, then retry the download when the artifact is available.
Mutation result is unknownRepeat the same mutation with the same --idempotency-key KEY.

For run exit codes and resumable logs, see Runs, Logs & Artifacts.

Upgrade

mechasm update prints the npm upgrade command. In an interactive non-JSON terminal, the CLI also checks npm at most once per day and prints the command when a newer version is available. CI, JSON output, and the long-running foreground service skip the notice. Set MECHASM_NO_UPDATE_NOTIFIER=1 to disable it.

Before upgrading, let local runs finish. If the CLI service is running, restart it after installation so it loads the new version:

mechasm service stop
mechasm service start

Pass the same --api-url to both commands for a custom API origin.

npm install -g @mechasm/cli@latest