Using the command line
How to drive Machine from a terminal with the machine CLI.
The machine CLI does everything the dashboard does, from a terminal. It's optional — if you're not technical, use the dashboard instead.
Install and log in
Install the CLI
curl -fsSL https://machine.com/install | bashThe mental model
The CLI controls the same things as the dashboard: projects, sessions, secrets, triggers, and change requests. It's the control plane, not a replacement for git.
The most useful commands
Start a session, optionally with a first prompt:
machine sessions new --prompt "Audit the auth module and propose a fix"
machine sessions lsManage secrets:
machine secrets set OPENAI_API_KEY=sk-...
machine secrets lsPush a local .env's values up as secrets, or pull a names-only skeleton down:
machine env push --from .env
machine env pullWork with triggers:
machine triggers ls
machine triggers fire daily-digestReview and merge change requests:
machine cr ls
machine cr show 3
machine cr merge 3Inside a session sandbox
Inside a session's environment the CLI is already authenticated for that project — no login needed. A project-scoped token is injected automatically, so commands like machine secrets ls or machine cr open work right away. This is how an agent opens its own change request.
Under the hood
On your laptop the CLI uses a user-scoped token (saved at ~/.config/machine/config.json) that can see every project on accounts you belong to. Inside a sandbox, MACHINE_TOKEN is pre-injected and scoped to that one project. The CLI resolves "which project" from a flag, an env var, or a linked directory, in that order.
