MachineDocs
Guides

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 | bash

Log in

machine login

This opens your browser to authorize. Your token is then saved locally.

The 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 ls

Manage secrets:

machine secrets set OPENAI_API_KEY=sk-...
machine secrets ls

Push a local .env's values up as secrets, or pull a names-only skeleton down:

machine env push --from .env
machine env pull

Work with triggers:

machine triggers ls
machine triggers fire daily-digest

Review and merge change requests:

machine cr ls
machine cr show 3
machine cr merge 3

Inside 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.

Using the command line | Machine Docs | Machine OS