Skip to content

cli reference

Intended Documentation

CLI Reference

The @intended/cli command-line interface — install it, authenticate it, and drive the authority runtime (intents, simulation, LIM packs, escalations, audit, token verification, and OpenShell policy compilation) from your shell or CI.

CLI Reference#

@intended/cli (v0.1.0) is a thin, scriptable client over the Intended authority API. Every command builds a request, sends it to your API base URL with the credentials you configure, and prints the JSON response — so the CLI never makes a decision the API would not. It is built for operators and CI: submit and simulate intents, install Domain LIM packs, approve escalations, query and export the audit chain, verify Authority Tokens offline, and compile OpenShell runtime policy.

Flat, hyphenated commands — no `intended policy …` group

The CLI uses flat hyphenated commands (intent-submit, audit-query, deploy-policy), not git-style command groups. There is no intended policy <subcommand> parent command. If you have seen that syntax in older material, it was wrong — use the commands on this page.

Install#

The binary name is intended.

The Intended CLI is in private beta for design partners. It runs against your control plane and is not yet on the public npm registry. Request access — or, if you're working in the monorepo, build it from the workspace:

bash
# from the Intended monorepo workspace
pnpm --filter @intended/cli build
node packages/cli/dist/index.js version    # → 0.1.0

intended help (or intended --help) prints the full command list; intended version prints 0.1.0.

Configure#

Run intended init once in your working directory to drop an intended.config.json next to your project. Any value in this file is the default for every command; matching --flags override it per-invocation.

Initialize the config file

bash
intended init
# → Initialized <cwd>/intended.config.json

The generated file contains apiBaseUrl and environment. Add your tenant, actor, and credential as shown below.

Fill in connection and identity

json
{
  "apiBaseUrl": "https://api.intended.so",
  "environment": "prod",
  "tenantId": "tenant_acme_prod",
  "actorId": "svc-ci-bot",
  "apiKey": "intended_live_…"
}

The CLI defaults apiBaseUrl to http://localhost:3101 when nothing is set, which is convenient for local development.

Verify connectivity

bash
intended audit-query --tenant tenant_acme_prod --limit 1

A 200 response prints the most recent audit entry; a 401/403 means your credential or tenant scope is wrong (see Authentication).

Config keys

intended.config.json understands apiBaseUrl, environment, tenantId, actorId, apiKey, sessionId, and role. It is loaded automatically whenever it is present in the current working directory.

Authentication#

The CLI assembles request headers exactly like a hand-written API call, and resolves a credential in a fixed order. The first present source wins:

PrecedenceSourceFlag / configHeader sentUse for
1API key--apikey / apiKeyAuthorization: Bearer <key>CI, services, automation (preferred)
2Portal session--session / sessionIdx-portal-session-id: <id>Console-proxied / portal-backed calls
3Legacy headers--tenant / --actor / --rolex-tenant-id / x-user-id / x-user-roleLocal development only

Customer API keys are prefixed intended_live_… (a legacy mrt_… prefix is still accepted for older staff keys). There is no separate sandbox or test key — any environment label on a key is cosmetic and does not gate authorization. Pass a key with --apikey or store it as apiKey in the config.

Legacy headers are production-disabled

The --tenant/--actor/--role fallback sends raw x-tenant-id/x-user-id/x-user-role headers. The API rejects these in production unless it runs with INTENDED_ALLOW_LEGACY_HEADERS=1. For any real environment, authenticate with --apikey.

Tenant and actor resolution#

Most commands need a tenant scope and many need an actor. The CLI resolves them from (in order) an explicit --tenant / --actor flag, then the tenantId / actorId config keys, and finally — if you pass --session — by calling /amp/auth/session and reading the tenant and user id off the verified portal session. If none resolves, the command exits non-zero with a clear message rather than guessing.

bash
intended intent-submit \
  --apikey "$INTENDED_API_KEY" \
  --tenant tenant_acme_prod \
  --actor svc-ci-bot \
  --action "ci.workflow.dispatch"

Global flags#

These flags apply to most commands (defaults come from intended.config.json):

--apiurl
API base URL. Defaults to apiBaseUrl, or http://localhost:3101.
--apikeystring
API key (intended_live_…; legacy mrt_… also accepted). Sent as Authorization: Bearer.
--sessionstring
Portal session id. Sent as x-portal-session-id; also resolves tenant + actor.
--tenantstring
Tenant id. Required by most tenant-scoped commands.
--actorstring
Actor id. Required by commands that act on behalf of a user/service.
--rolestring
Role for legacy-header auth. Defaults to operator.

Command map#

The CLI is a flat client over the authority runtime. The diagram shows where each command family lands in the decision loop the API runs on every call.

Where CLI commands hit the authority loop
The authority runtime loop: an intent is submitted, evaluated against policy and LIM signals, returns APPROVED, ESCALATED, or DENIED, mints a single-use Ed25519 token on approval, and writes a hash-chained audit entry. CLI command families map onto submit, evaluate, escalate, token, and audit stages.

intent-submit / simulate feed the loop; escalations-* resolve held decisions; verify / inspect-token operate on the minted token; audit-query / audit-export read the resulting chain.

Command reference#

Every command prints the raw JSON API response to stdout and returns exit code 0 on a 2xx, 1 otherwise (verify returns 2 on an invalid token). Bracketed flags are optional.

Intents and simulation#

CommandWhat it doesKey flags
intent-submitPOST /intent — run an intent through the authority loop; returns APPROVED/ESCALATED/DENIED plus the decision token.--tenant · --actor · --action · [--body <json>]
simulate (alias intent-simulate)POST /intent/simulate — evaluate an intent without executing it.--tenant · --actor · [--action] · [--risk]
intent-compilePOST /intent/compile — compile natural language into a structured intent via the LIM.--text · --tenant · --actor · [--domain] · [--target]
bash
# Submit a fully-specified intent from a JSON body
intended intent-submit --apikey "$INTENDED_API_KEY" --tenant tenant_acme_prod \
  --body '{
    "tenantId": "tenant_acme_prod",
    "actor": { "id": "svc-ci-bot", "type": "service" },
    "targetSystem": "acme/platform-api",
    "proposedAction": "dispatch release workflow",
    "riskContext": { "baseRiskScore": 42, "policyCompliant": true,
      "requiresPrivilegedAccess": false, "touchesProduction": false,
      "containsSensitiveData": false }
  }'

POST /intent returns the legacy authority enum — APPROVED (HTTP 200), ESCALATED (202), or DENIED (403) — and, only on APPROVED, an authorityDecisionToken (an Ed25519 JWT, 300-second TTL, single-use). See the Intents API for the full response shape.

Domain LIM packs#

CommandWhat it doesKey flags
lim-packs-listList available Domain LIM packs.[--domain] · [--series] · [--status]
lim-pack-installInstall a pack for a tenant.--pack · --tenant · --actor · [--version] · [--config <json>]
lim-installations-listList installed packs for a tenant.--tenant · [--status]
lim-installation-enable / -disable / -deprecate / -removeMove an installation through its lifecycle.--id · --tenant · --actor · [--reason]
lim-evaluateEvaluate an intent IR against installed LIM packs.--tenant · [--installation] · [--action] · [--evidence <json>]
lim-explainExplain a prior LIM evaluation.--evaluation · --tenant

Escalations#

CommandWhat it doesKey flags
escalations-listList pending escalations for a tenant.--tenant
escalations-approveApprove a held (escalated) decision.--id · [--approved-by] · [--role]
escalations-rejectReject a held decision.--id · --reason · [--rejected-by] · [--role]

Audit#

CommandWhat it doesKey flags
audit-queryRead the tenant's hash-chained audit entries with optional filters.--tenant · [--correlation] · [--event-type] · [--limit] · [--offset]
audit-exportExport the signed evidence bundle for one intent.--tenant · --intent

Evidence is HMAC-signed with the tenant secret

audit-export returns an evidence bundle whose signature is an HMAC-SHA256 keyed off the tenant's own stored secret — verifying it requires possession of that secret. It is tamper-evident, not publicly/asymmetrically verifiable. See Audit API.

Tokens#

CommandWhat it doesKey flags
inspect-token (alias token-inspect)Decode and print a JWT payload (no signature check).--token
verify (alias token-verify)Cryptographically verify an Authority Token offline against a public key.--token · --key · [--kid] · [--tenant] · [--adapter]
bash
# Offline Ed25519 verification with kid pinning — exits 0 if valid, 2 if not
intended verify \
  --token "$DECISION_TOKEN" \
  --key ./tenant-public.pem \
  --kid "tenant_acme_prod-1717700000-ab12cd" \
  --tenant tenant_acme_prod \
  --adapter github

verify calls @intended/verify, which enforces Ed25519, mandatory kid pinning, tenant/adapter/issuer/audience matching, clock-skew tolerance, and the 300-second max TTL. inspect-token only base64-decodes the payload for inspection and performs no verification — never trust its output as proof.

Connectors#

CommandWhat it doesKey flags
connectors-listList a tenant's configured connectors.--tenant
connectors-testRun a connector's connectivity test.--connector · --tenant

Policy packs#

CommandWhat it doesKey flags
deploy-policy (alias policy-pack-install)POST /policy-packs/install — install a policy pack for a tenant.--pack · --tenant
policy-pack-inspectList installed policy packs for a tenant.--tenant

See Policy commands for the full policy-pack workflow.

Workflows#

CommandWhat it doesKey flags
workflow-runStart a workflow run.--definition · --tenant · [--input <json>]
workflow-statusRead a run's status.--run · --tenant
workflow-resumeResume a paused run with approvals.--run · --tenant · [--approvals <json-array>]
workflow-intervenePause or cancel a run.--run · --action pause|cancel · --reason · --tenant

Live monitoring#

CommandWhat it doesKey flags
watchStream live decisions over SSE (GET /api/stream/decisions), color-coded and filterable.--tenant · [--domain] · [--decision] · [--actor] · [--min-risk]
bash
# Tail high-risk denials for one tenant in real time
intended watch --apikey "$INTENDED_API_KEY" --tenant tenant_acme_prod \
  --decision DENY --min-risk 60

Runtime policy#

CommandWhat it doesKey flags
openshell-compile (alias nemoclaw-compile)Compile an intent/LIM JSON file into OpenShell runtime policy YAML.--input · [--output] · [--runtime] · [--provider] · [--preset]

See OpenShell commands for the input shape and presets.

Demo / benchmarking commands

The CLI also ships business-intent-demo, business-intent-dataset, and business-intent-leaderboard for the Business Intent demo wedge. They are useful for evaluation and dataset generation but are not part of the core authority workflow; run intended help to see their flags.

Exit codes#

CodeMeaning
0Success — the API returned a 2xx, or the local operation completed.
1Failure — non-2xx API response, a missing required flag, or a request error.
2verify only — the token was structurally decodable but failed verification.

See also#

CLI Reference | Intended