Zum Inhalt springen
Developer Preview — APIs and language features may change before 1.0

CLI Reference

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

The mashin CLI is how you interact with machines from the terminal. It handles everything from creating machines to deploying them, managing secrets, working with the registry, and running effect services.

Installation

Terminal window
# macOS
brew install mashin-live/tap/mashin
# Or download directly
curl -fsSL https://get.mashin.live | sh

Verify the installation:

Terminal window
mashin --version

Shell completions

Generate completions for your shell:

Terminal window
mashin completions bash >> ~/.bashrc
mashin completions zsh >> ~/.zshrc
mashin completions fish >> ~/.config/fish/completions/mashin.fish

Command reference

Core commands

These are the commands you will use most often.

CommandDescription
mashin new <name>Create a new machine
mashin initCreate a new machine project
mashin run <machine>Execute a machine
mashin test <machine>Run machine tests
mashin compileCompile machines
mashin validate <file>Validate a .mashin file
mashin fmt <file>Format a .mashin file
mashin info <machine>Show machine info
mashin listList machines in the current project
mashin runsShow execution history
mashin chatStart interactive chat mode
mashin docsGenerate or view documentation
mashin setupInteractive first-run setup
mashin configView or set configuration
mashin modelsShow model tier mappings
mashin reportGenerate a signed bug report
mashin lspStart the language server (stdio)
mashin mcpStart MCP server
mashin launch <machine>Launch a machine (long-running)
mashin tunnel <machine>Expose a local machine via tunnel

Machine lifecycle

Commands for managing running machines.

CommandDescription
mashin statusShow launched machines
mashin pause <machine>Pause a running machine
mashin resume <machine>Resume a paused machine
mashin stop <machine>Stop a machine
mashin kill <machine>Force-terminate a machine
mashin restart <machine>Restart a machine
mashin logs <machine>Tail machine logs
mashin inspect <run_id>Inspect a governance trace
mashin rollback <machine>Roll back to a previous version
mashin archive <machine>Archive a machine definition

Registry

Publishing, searching, and installing machines from the kura registry.

CommandDescription
mashin loginAuthenticate with the registry
mashin logoutSign out
mashin search <query>Search the registry
mashin install <krate>Install a package
mashin publishPublish to the registry
mashin packCreate a .krate package
mashin saveSave to local registry
mashin verify <krate>Verify krate integrity

Krate management

Working with krates (machine packages).

CommandDescription
mashin krate newScaffold a new krate
mashin krate validateValidate mashin.toml manifest
mashin krate parseParse all .mashin files
mashin krate compileCompile all machines
mashin krate testRun embedded tests
mashin krate lintQuality gate check
mashin krate hashCompute content hash

Secrets

Managing API keys and credentials.

CommandDescription
mashin secrets set <name> <value>Store a secret
mashin secrets get <name>Retrieve a secret
mashin secrets listList stored secrets
mashin secrets delete <name>Delete a secret

Effects

Managing external effect services.

CommandDescription
mashin effect init <language>Scaffold a new effect service
mashin effect start <path>Start a script as an effect service
mashin effect stop <name>Stop a running effect service
mashin effect listList running effect services
mashin effect register <url>Register an external effect service
mashin effect test <url>Test an effect service endpoint

Skills

Working with skills (interop with Claude Code and other tools).

CommandDescription
mashin skill export <machine>Export a machine as a Claude Code skill
mashin skill import <path>Import a skill as a governed machine
mashin skill listList available skills
mashin skill search <query>Search skills by intent

Cell management

Managing cells (local and remote compute environments).

CommandDescription
mashin cell startStart a cell
mashin cell stopStop a cell
mashin cell statusShow cell health
mashin cell listList all cells
mashin cell connect <name>Set the active cell
mashin cell switch <id>Switch to a different cell
mashin cell add <name> <url>Add a remote cell
mashin cell infoShow cell info
mashin identityShow cell identity
mashin pairShow pairing QR code
mashin linkLink cell to account

mashin run in depth

The run command is the primary way to execute machines.

Terminal window
mashin run <machine> [options]

Options

FlagDescription
--input / -i <json>JSON object as input. Supports @file references (see below)
--input-file / -f <path>Path to a JSON file to use as input
--project-dir / -d <path>Path to the project directory (default: current directory)
--to <mode>Interpretation mode: explain, cost, simulate, evaluate, verify, improve
--verbose / -vShow detailed output
--trace / -tPrint the governance trace (step names, types, durations, hash chain)
--json / -jOutput as structured JSON (for scripting)
--format <fmt>Output format: human (default), json, yaml, jsonl, text
--transform <path>Extract a value at a dot-path before formatting

@file input references

Prefix a file path with @ to read its contents as input:

Terminal window
mashin run hello --input @params.json
mashin run hello -i @input.json

This is equivalent to --input-file params.json but more concise.

Output formatting

By default, mashin run prints human-readable output. For scripting, use --format and --transform:

Terminal window
# Get just the result as JSON
mashin run hello --format json --transform result
# Extract a specific field as plain text
mashin run hello --format text --transform result.summary
# YAML output
mashin run hello --format yaml
# Compact single-line JSON (for piping)
mashin run hello --format jsonl
# Assign to a shell variable
SUMMARY=$(mashin run hello --format text --transform result.summary)

Input methods

Three ways to pass input:

Terminal window
# 1. Inline JSON
mashin run hello --input '{"name": "World"}'
# 2. @file reference
mashin run hello --input @params.json
# 3. Stdin (piped)
cat params.json | mashin run hello

Authentication

Terminal window
mashin login

Opens your browser for OAuth authentication with PKCE. Credentials are saved to ~/.mashin/credentials.json and auto-refresh.

Headless / remote login

For servers, Docker containers, or machines without a browser:

Terminal window
mashin login --no-browser

Prints the authorization URL. Open it on another device, complete login, and the callback is received automatically.

API key login

For CI/CD pipelines and scripts:

Terminal window
# Interactive prompt
mashin login --api-key
# Direct token
mashin login --token msk_your_api_key

API keys are generated at mashin.live/settings/api-keys.

Check auth status

Terminal window
mashin identity

Common workflows

Create and run a machine

Terminal window
mashin new email_classifier
mashin run email_classifier --input '{"subject": "Invoice", "body": "Payment due"}'

Test without API keys

Terminal window
mashin test email_classifier

Tests use assuming values, so they run fast and free.

View the governance trace

Terminal window
mashin run email_classifier --input '{"subject": "hello"}' --trace

Format and validate before publishing

Terminal window
mashin fmt .
mashin validate .
mashin publish

Scaffold and register an effect service

Terminal window
mashin effect init python my_effect
# Edit the generated service
mashin effect start my_effect/server.py
mashin effect test http://localhost:8080
mashin effect register http://localhost:8080

Work with multiple cells

Terminal window
# List available cells
mashin cell list
# Switch to a different cell
mashin cell switch production
# Or set via environment variable
MASHIN_CELL_ID=production mashin run hello

Environment variables

VariablePurpose
MASHIN_API_URLOverride the default API endpoint
MASHIN_CELL_IDSet the active cell
MASHIN_OUTPUTDefault output format: json, yaml, jsonl, text
MASHIN_LOG_LEVELSet log verbosity (debug, info, warn, error)

Next steps