Command CLI

datarim

External-agent surface — non-interactive CLI that drives the full Datarim pipeline through HTTP webhook (AAL 3 opt-in)

Overview

The datarim CLI is a standalone, non-interactive command-line interface designed for external AI agents and automation systems. It exposes the entire Datarim pipeline — from task intake to artifact delivery — through an HTTP webhook interface. The CLI uses a JSON-based request format and supports all stages of the Datarim workflow: /dr-init, /dr-cowork, /dr-approve, /dr-exit, and /dr-status.

Introduced in v2.18.0 (TUNE-0271), the CLI enforces AAL 3 (Adaptive Authentication Level) for every request, requiring digital signature verification, nonce replay protection, and time-bound tokens.

When to use vs slash command

Use caseSlash commanddatarim CLI
Interactive, human-operated sessionsRecommendedNot suited
Automated / CI / agent-driven pipelinesNot supportedRecommended
Non-interactive script invocationNot supportedRequired
AAL 3 authenticated operationsOptionalMandatory
Bulk processing (multi-task batches)Not supportedSupported via --batch

Installation

The CLI distribution is a single PHP script with no external dependencies. Run the automated installer:

curl -sSL https://datarim.club/cli/install.sh | bash

This installs the datarim command to /usr/local/bin and sets up the configuration directory ~/.config/datarim/. Verify installation:

datarim version

Subcommands

SubcommandDescription
runExecute a Datarim pipeline stage. Accepts a JSON request body from stdin or --request. Returns JSON response.
auditDisplay the audit log for a specific task or session. Required argument: --task-id.
haltPause a running pipeline. Required argument: --task-id.
resumeResume a halted pipeline. Required argument: --task-id.
purgeDelete all artifacts and logs for a completed task. Required argument: --task-id. Confirmation prompt unless --force is set.
statsDisplay aggregate pipeline statistics: total tasks, active sessions, average duration, error rate.
versionPrint the CLI version and exit.
helpDisplay this usage information.

AAL 3 mitigations

Every datarim CLI request must satisfy six AAL 3 requirements:

  1. Digital signature — the request payload must be signed with a registered Ed25519 keypair. The public key is submitted during agent registration.
  2. Nonce replay protection — each request includes a unique nonce. The server rejects any nonce it has already seen.
  3. Time-bound tokens — every token is valid for a maximum of five minutes. Expired tokens are rejected.
  4. Session binding — the signature binds to the current session ID. Replay across sessions is impossible.
  5. Audit trail — every mutation is logged to an immutable audit store with sender identity, timestamp, and request digest.
  6. Rate limiting — no more than 60 authenticated requests per minute per sender. Burst limits apply.

Exit codes

CodeMeaning
0Success
17Invalid request format (malformed JSON)
18Authentication failure (invalid or missing signature)
21Nonce replay detected
22Token expired
23Rate limit exceeded
24Task not found
25Pipeline stage not allowed in current state
26Internal server error
27Client-side configuration error

Related links