Skip to main content

CLI Overview

The shift-cli binary wraps all platform services into a single command-line interface. It communicates with the Shift gateway over HTTP and exposes both platform-level commands and service-specific subcommands.

Output Modes

Every command supports three output modes:

ModeFlagDescription
Human-readable(default)Chalk-colored, formatted for terminals
JSON--jsonStructured output for agent and programmatic consumption
Quiet--quietExit codes only, no stdout

Configuration Files

FilePurpose
~/.shift/config.jsonCLI configuration (gateway URL, defaults)
~/.shift/auth.jsonAuthentication tokens

Both files are created with restrictive permissions (mode 0o600).

Command Shape

Platform commands live at the top level:

shift-cli status
shift-cli login
shift-cli create-app my-app
shift-cli token create --session <id>
shift-cli test bootstrap --session <id>

Service commands follow a consistent pattern:

shift-cli <service> <subcommand> [arguments] [flags]

For example:

shift-cli yp services list --json
shift-cli pulse events track "deploy" --quiet
shift-cli stage new --json
shift-cli stage repo status --json

How It Works

The CLI sends HTTP requests to the Shift gateway, which routes them to the appropriate service API. Some commands, such as shift-cli create-app, also write local project files or inspect local git state.

App Workspace Commands

The shift-cli app command suite manages app-local workspace state, syncing platform context into your project:

shift-cli app sync-context          # Pull dynamic service context into .shift/state
shift-cli app refresh-skills # Refresh CLAUDE/AGENTS and bundled skills
shift-cli app push ./src /app # Sync context, push to Stage, refresh snapshots

These commands work with the .shift/ directory in your project root:

PathPurpose
.shift/stage-app.config.jsonSession and app tracking
.shift/state/manifest.jsonApp state manifest with service context
.shift/state/services/<name>.jsonPer-service snapshots
.shift/compute/config.jsonCompute module configuration

Sandbox Commands

The shift-cli sandbox commands manage isolated multi-agent sessions:

shift-cli sandbox create --name my-session
shift-cli sandbox list
shift-cli sandbox push <session-id> ./workspace
shift-cli sandbox auth <session-id> claude
shift-cli sandbox exec <session-id> --cmd "bun test" --timeout 5m
shift-cli sandbox rm <session-id>

Each sandbox session provides isolated workspace, home, and tmp directories for shared agent work.

Local Testing Helpers

Two top-level commands support delegated local test flows:

  • shift-cli token creates and revokes short-lived delegated grants
  • shift-cli test bootstrap turns a delegated grant into a one-time browser bootstrap artifact

These commands are primarily used with Stage sessions, @the-shift/sdk/testing, and Playwright-based app checks.

Exit Codes

Commands use semantic exit codes to indicate results:

CodeNameMeaning
0EXIT_SUCCESSOperation completed
1EXIT_ERRORGeneral error
2EXIT_USER_ERRORInvalid input or missing arguments
3EXIT_NOT_INITIALIZEDNo store directory or config found
4EXIT_NOT_FOUNDResource not found
5EXIT_CONNECTIONServer unreachable