Skip to content

Authentication

The CLI supports three authentication methods. Browser login is the default for interactive use; API keys are the right choice for CI/CD.

Methods

MethodCommandUse case
Browser (default)machina loginInteractive use — opens the browser for Clerk SSO / magic link
API keymachina login --api-key <key>CI/CD pipelines and scripts
Username / passwordmachina login --with-credentialsInternal / dev environments
bash
machina login                          # browser-based (default)
machina login --api-key <key>          # authenticate with an API key
machina login --with-credentials       # username / password

After a successful login the CLI drops you into the interactive REPL. Pass --no-interactive to skip it.

Session commands

bash
machina auth whoami        # show the current user
machina auth logout        # clear stored credentials

Where credentials live

Credentials are stored locally in ~/.machina/credentials.json with 600 file permissions (owner read/write only).

WARNING

Treat ~/.machina/credentials.json like any secret. An API key grants the same access as your account — never commit it or paste it into shared logs.

Environment variables

Environment variables override values in the config file — useful for CI:

VariableDescription
MACHINA_API_KEYAPI key for authentication (used when no browser session is present)
MACHINA_API_URLOverride the Core API URL
bash
export MACHINA_API_KEY="<your project api key>"
machina workflow list      # authenticates with the key — no browser needed

Next up

Pick a project and run something →