Command Line Interface

Evaluate, observe, and iterate on the AI you ship — straight from your terminal. Built for coding agents and humans alike: JSON output by default, --format pretty for tables.

Install

Shell@enprompta/cli
npm install -g @enprompta/cli
# or run without installing
npx @enprompta/cli --help

Requires Node.js 18 or later.

Authenticate

Get an API key from Dashboard → Settings → API Keys (ep_...), then save it to a profile:

enprompta auth login --api-key ep_your_key_here
enprompta auth status

Credentials resolve in this order: --api-key flag → ENPROMPTA_API_KEY env → saved profile (~/.enprompta/config.json). Use --profile <name> or ENPROMPTA_PROFILE to select a profile, and --base-url / ENPROMPTA_BASE_URL for staging or self-hosted instances.

Plan requirements: the API needs a Pro or Enterprise workspace — editor seats get read/write, free viewer seats are read-only. Free accounts can record observability traces but cannot read via the API.

Agent-First Output

  • JSON by default. Every command prints pretty-printed JSON to stdout — predictable for piping into agents and scripts.
  • --format pretty renders tables and key-value views for humans.
  • Errors go to stderr — as JSON in json mode, with a non-zero exit code — so success output stays machine-parseable.
  • --quiet suppresses output when you only care about the exit code.

Commands

enprompta authManage API credentials and named profiles
enprompta auth login --api-key ep_your_key_here
enprompta auth status
enprompta auth login --name staging --api-key ep_... --base-url https://staging.enprompta.com
enprompta auth use staging
enprompta auth list
enprompta promptWork with prompts in the registry
enprompta prompt list --search summariser --limit 20
enprompta prompt get <prompt-id>
enprompta traceInspect observability traces
enprompta trace list --provider openai --limit 10
enprompta trace get <trace-id>
enprompta trace analytics --days 30
enprompta evalScore prompt quality with the evaluator — optionally compare two prompts
# Score a single prompt
enprompta eval --prompt-a "You are a helpful assistant…"

# Compare two prompts (inline or from files)
enprompta eval --prompt-a @prompts/v2.txt --prompt-b @prompts/v1.txt

# Compare against a saved prompt version, re-running on file change
enprompta eval --prompt-a @draft.txt --prompt-name summariser --version 3 --watch
enprompta apiRaw authenticated passthrough to any endpoint, modelled on gh api
enprompta api GET /api/v1/traces/analytics --query days=7
enprompta api POST /api/v1/prompts --data '{"title":"My Prompt","content":"Hello {{name}}"}'

The api passthrough covers every endpoint in the API reference — anything without a dedicated verb is one enprompta api call away.

CLI or MCP Server?

Enprompta ships both. For coding agents with shell access (Claude Code, Cursor), the CLI is the lighter path: no server connection to maintain, no tool schemas occupying the context window — the agent composes commands like any other shell tool. The MCP server fits chat-first surfaces without a shell.

# A coding agent triaging production traces, end to end:
enprompta trace list --limit 10
enprompta trace get <trace-id>
enprompta api POST /api/v1/traces/<trace-id>/score --data '{"score":0.2,"reasoning":"format drift"}'
enprompta eval --prompt-a @fixed.txt --prompt-name summariser --watch
CLI - Enprompta