arkova-api-cli
v0.6.1
Published
JSON command-line client for the Arkova verification API
Maintainers
Readme
Arkova API CLI
Use Arkova from your terminal. The package is arkova-api-cli; the command
you run is arkova. Open Terminal, PowerShell, or your editor's terminal
(not the prompt inside Claude Code) for the commands below.
Start with the Developer Integration User Guide for the shared SDK, terminal, and AI-assistant setup path.
Requirements and install footprint
- Node.js 22.13 or newer is required. Older runtimes are refused.
- The install is large. Local document intake brings native image
libraries (Sharp,
@napi-rs/canvas, HEIC decoding) and an ML runtime (@huggingface/transformers, OCR) as dependencies, sonpm installdownloads and unpacks far more than a typical command-line tool. Plan for it in CI images, containers and constrained machines. - One-time model download. The first
arkova intake(or an intake request inarkova chat) downloads a pinned privacy model, about 104 MB, from huggingface.co into~/.arkova/assets. Every file is checked against a pinned SHA-256 before use and again on each load. The request carries no credentials and no document content. OCR assets ship inside the package. Later runs use the verified cache and need no network for this step.
npm install --global arkova-api-cli
arkovaIn an interactive terminal, bare arkova opens setup if no key is configured,
or the request prompt if a key is available. You can run each step directly:
arkova setup
arkova doctor
arkova chat
arkova ask 'find the Arkova organization'
arkova ask 'create a personal folder called "contracts"' --yes
arkova connect codex
arkova connect claude
arkova mcp| Command | What it does |
| --- | --- |
| setup | Guided first run: hidden key prompt, read-only connection checks, optional macOS Keychain storage, optional assistant connection. |
| doctor | Re-runs the connection and assistant checks and reports each one. |
| connect codex / connect claude | Registers the installed CLI with your AI assistant as a local MCP server. |
| chat | Interactive request prompt with bounded phrase shortcuts. |
| ask '<request>' [--yes] | One-shot version of chat; writes need --yes or confirmation. |
| mcp [--base-url URL] | Starts the local MCP bridge. Your assistant runs this for you after connect. |
| intake <file>, intake recover / intake submit <id> | Prepares a document on this device, then queues it. See "Local document intake". |
| webhook ... | Eleven webhook management operations. See "Webhook management". |
Create your API key in the Arkova dashboard, then enter it at setup's hidden prompt. Choose scopes for the operations you need; setup's connection checks do not grant additional access. See the credential guidance below.
arkova health needs no API key. A response with "status":"healthy" confirms
API reachability, not account permissions. If your terminal says command not
found, try npx arkova-api-cli --help, then check your global npm executable
directory is on PATH. Installing arkova alone installs the SDK, not this CLI.
Output format
The JSON contract applies to the API commands: verify, read, status,
health, probe, anchor, anchors, import, intake, source-import,
search-public, agent, folder, attest and webhook. For these:
- stdout is one JSON value when piped or redirected, or when you pass the
global
--jsonflag. In a terminal without--jsonit is human-readable text with dashboard labels. - stderr is decided separately from stdout. Errors are a single JSON object,
{"error":{"code","message",...}}, whenever stderr is not a terminal, even if stdout is. Soarkova verify ARK-1 2>err.jsonwrites JSON toerr.jsonfrom an interactive shell. Plain explanatory text is used only when stderr itself is a terminal and--jsonis not set. - Exit codes:
0success,1API or runtime failure (alsoverifyof a record that is not verified, and anintakethat ends in an unknown outcome),2usage error (bad arguments or missing credentials). - Bare
arkova(no arguments) is help, not an error. When stdout is not a terminal it prints the machine-readable JSON help and exits0; in a terminal it opens setup or chat.arkova --helpprints the same help (JSON off a terminal, text in one) and exits0. Version 0.4.0 exited2with a usage error for a bare invocation off a terminal.
The guided and MCP commands are interactive exceptions. setup, doctor,
connect, chat, ask and mcp are dispatched before --json is parsed, so
the flag does not switch them to JSON and piping does not either. They write
human-readable text to stdout (never a JSON error on stderr), except mcp,
which speaks the MCP JSON-RPC protocol on stdout once the bridge is running and
writes its failures as plain text to stderr. Their exit codes are:
| Command | Piped or redirected | With --json |
|---|---|---|
| setup | text, exit 2 ("needs an interactive terminal") | usage text, exit 2 |
| doctor | text report, exit 0 when the checks pass, 1 when they do not | usage text, exit 2 |
| connect codex\|claude | the same text report; exit 0 and the assistant entry is added only when the checks pass, 1 when they do not | usage text, exit 2 |
| chat | text pointing to arkova ask, exit 2 | usage text, exit 2 |
| ask "request" | text, exit 0 on success, 1 when the request fails, 2 when it is not understood or no connection is set up | usage text, exit 2 |
| mcp | MCP protocol on stdout; exit 1 with plain text on stderr when it cannot start | Use arkova mcp [--base-url URL]. on stderr, exit 2 |
In all six, an unrecognized argument prints the guided usage text and exits 2.
Scripts should use the API commands above; use doctor with ARKOVA_API_KEY
only as a human-readable connection check.
Requests and assistant setup
At the prompt, try anchor this document "./agreement.pdf", find records tagged
"legal", verify ARK-2026-EXAMPLE, or check status. It asks for a missing file
or tag scope, remembers the scope and last record for this session, previews
writes, and supports next for a further page of the same private search. Type details to inspect the last full response. For example, in interactive chat, create an
organization folder called "contracts" uses that explicit intent. One-shot
arkova ask writes require confirmation; use --yes for noninteractive writes.
For example: arkova ask 'anchor this document "./agreement.pdf"' --yes.
Explicit commands such as arkova anchor and arkova webhook create act directly;
--yes is the one-shot conversational confirmation flag. An
unspecified workspace is asked once and remembered for the session. Use
/ followed by an existing command for other operations. Credential-producing
agent operations require the explicit terminal command so their one-time key
is not hidden by conversational output redaction. Type exit to leave.
These are bounded local phrase shortcuts, not a general-purpose AI agent. For
free-form requests, connect your existing AI assistant.
Setup checks authenticated reads and performs real local MCP initialization and
tool discovery. It never submits a document or infers write permission from a
successful connection. A rejected stored key can be replaced through a hidden
prompt. On macOS, setup offers opt-in OS Keychain storage scoped to the API
origin. Otherwise, use ARKOVA_API_KEY or keep the key only for the current
terminal session. Nothing writes a plaintext credential configuration file.
Environment credentials take precedence over saved keys. macOS stores one shared
Keychain key per API origin, so saving another key changes the default for all
configured assistants using that origin. For separately attributed agents,
launch each assistant with its own active ARKOVA_API_KEY and leave Keychain storage
off. The assistant must forward that variable to its MCP process. For Codex,
add env_vars = ["ARKOVA_API_KEY"] under [mcp_servers.arkova] in its
configuration. Store only the variable name there. Confirm that each assistant
uses the intended key before recording actions.
connect codex and connect claude register the installed CLI's absolute
executable path with the assistant. Claude uses user scope so setup is not tied
to the current folder. Existing entries are not overwritten. Keep the installed
CLI in place, restart your assistant, and confirm its Arkova tools are
available (/mcp in Claude Code). Then ask normally: “Use Arkova to find the
Arkova organization” or “Use Arkova to verify record ARK-2026-EXAMPLE.” MCP tool
names are not shell commands or slash commands. This setup uses the local MCP
server; its tool names differ from the hosted server.
The SDK continues to read credentials supplied by your application; it does not
read the CLI keychain. Read access requires read:records and is limited to
records visible to the key in its workspace. Personal-key capabilities depend
on the deployed API and granted scopes. Submission requires anchor:write or
write:anchors and eligible organization access. Setup tests usage:read and
private record access separately and reports unavailable checks explicitly.
An action-only key can connect when both read endpoints confirm its
agent_actions:write scope. This checks authentication and tool discovery.
Action writes and the key's agent binding are checked only when an action runs.
Scriptable commands
Terminal results use dashboard labels and readable fields. Add the global
--json flag for the full response. Redirected/piped commands keep one JSON
value on stdout (see "Output format"). Script-mode usage and API errors write
one JSON error to stderr and exit nonzero; terminal errors explain the next step. Set ARKOVA_BASE_URL to select
an API deployment. Credentials are accepted from ARKOVA_API_KEY, or from a
JSON object piped to --config -. Interactive terminal
commands also reuse the optional OS keychain credential. Scripts and redirected or
piped commands must supply credentials explicitly; ask accepts ARKOVA_API_KEY.
--yes confirms an action and does not grant access to saved credentials. The
explicitly configured MCP bridge retains its saved-key connection behavior. Guided
commands print human-readable output; automation should keep using the existing
commands below.
anchor reads a local file and computes its SHA-256 fingerprint through the
shared arkova SDK. Only the fingerprint, selected action, optional MIME metadata,
document label, credential type, description, and private tags are sent to the API.
File contents are not uploaded. anchor does not run local OCR or AI
extraction and does not send document bytes to an AI provider; use intake
(below) when you want local preparation and extraction. Connecting an external
AI assistant does not change the file-submission behavior of the anchor command.
The record's public name is filename if given; for a connector document, the document's own name; otherwise a neutral default such as "Legal document from the API, Nov 14 2026". label and description stay private and never become the public name; send filename to set a specific public title. The anchor receipt carries it as name (JSON output is unchanged; the readable output prints it first).
arkova anchor ./agreement.pdf --action queue --file-mime application/pdf --description "Signed agreement" --tag legal
arkova anchor ./diploma.pdf --action queue --file-mime application/pdf --label "Degree record" --credential-type DIPLOMA
arkova status ARK-2026-EXAMPLE
arkova read ARK-2026-001
arkova import ./rows.json --action queue --description "Spring cohort"
arkova anchors list --since 24h --limit 20
arkova source-import preview --url https://example.org/record --personal
arkova search-public "acme university" --type orgs --limit 5
arkova attest create --request-json ./attestation.json # the REST body; checked locally, never retried
arkova verify ARK-2026-001
arkova probe ARK-2026-001 --org-id 00000000-0000-0000-0000-000000000000
arkova folder list --scope ORG --org-id 00000000-0000-0000-0000-000000000000
arkova folder create --name Cases --scope USER
arkova folder move --record-id ARK-2026-001 --folder-id 00000000-0000-0000-0000-000000000000The binary exposes both the queue and instant anchor actions, plus status,
private-tag, and folder (list/create/update/reparent/delete/connector/bulk-move)
commands — all backed by the canonical API routes documented in
packages/api-cli/agents.md (UAT-12 status parity, UAT-24 folder parity).
Confirm capability flags for your account in the live Arkova API documentation
before automating a specific action.
import sends 1 to 100 already-fingerprinted rows from a local JSON file to POST /api/v1/anchor/import and prints the API response unchanged (including per-row recipient_status when the worker returns it). anchors list pages through private organization records (--since, --until, paired --tag and --tag-scope user|organization, --limit 1-100, --cursor). source-import preview|confirm is the one command that authenticates with a short-lived ARKOVA_ACCESS_TOKEN instead of an API key.
Public search
arkova search-public <query> [--type all|orgs|members|anchors|imports] [--limit 1-50]
searches public organizations, public member profiles, publicly verifiable records, and secured
public-source records. It needs no API key: it runs without ARKOVA_API_KEY, and if a key is set
it is sent and only raises the rate limit (100 requests/minute per IP without a key, 1,000 with
one). The query must be 2-200 characters. --limit applies per result group. With
--json or redirected output, the command prints the API response unchanged: { query, type, results: { orgs, members, anchors, imports }, total,
unavailable }. A non-empty unavailable list means those groups failed and the result is partial.
Agent lifecycle
Use arkova agent register|list|get|update|revoke, arkova agent key create, and arkova agent computeid admit --request-json <local-file>. Configure an organization API key with agents:manage; ComputeID admission is API-key-only and does not widen scopes. Output is JSON. Store one-time key output immediately. The restricted key returned by admission is not automatically an agent-management key. The executable bundles the sibling SDK so the packed CLI can run from a clean consumer directory.
Each fetch and body-read attempt has a 10-second timeout by default; retries and backoff for safe or idempotent calls can make a command take longer. Set ARKOVA_TIMEOUT_MS or pass timeoutMs in stdin configuration to choose an integer from 1 to 120000 milliseconds. Agent registration, key creation, and ComputeID admission are non-idempotent and are not automatically retried after a timeout; inspect their state before an operator retry.
Recording agent actions
arkova agent record-action <agent-id> --action <code> (--payload-hash <64 hex> | --payload-file <local path>) [--occurred-at <RFC 3339>] [--description <text>] [--external-event-id <id>] [--source-record <public id> | --source-url <https url>] [--source-type record|document|report|url]--source-record or --source-url (at most one) says where the action came from. The command checks only that the flags fit together; the server decides everything about the value (https, length, characters, host, no user name or password, no secret-looking parameter such as token, key or sig, and that a record is an undeleted record of your organization) and removes a link it does not accept, still recording the action. Arkova does not fetch or check a url. The command prints one line per removed link on stderr, event index N: link removed (parameter token), event index N: link removed (personal data) or event index N: link removed (not accepted), with N the 0-based index exactly as the server answered, and source links were not stored: the action log could not yet keep them when the server could not yet keep source links. The link is never printed back. A stored url is kept in the canonical form of the URL.
Give exactly one of --payload-hash or --payload-file. A payload file is fingerprinted on this machine and the file never leaves it; only the 64-character fingerprint is sent. --occurred-at defaults to the current time. The command prints the service result unchanged as JSON (appended, duplicates, and descriptionsRedacted or descriptionNotStored when present).
--description is optional: 1 to 140 characters in the agent's own words. It is shown on the owner's record page and in the owner's proof package, and Arkova does not verify it. No wording is refused. As a safety net, personal data such as an email address or phone number is replaced with [removed]; do not put personal data in descriptions. The command never prints the description or the payload, including in errors; your shell may still keep the command line in its history.
The call is never retried automatically, and a timeout does not prove nothing was recorded. Send --external-event-id so that repeating the same call does not record the action twice. Use the agent's own key with agent_actions:write, or an organization key with agents:manage.
Local document intake
intake prepares a document on this device before any API extraction. Say
add this file "/path/agreement.pdf" to my queue with tags legal, review in chat,
or run arkova intake ./agreement.pdf --personal --tag legal. For an organization,
use --org-id <exact UUID> and --org-tag for organization tags. The first chat
request asks which workspace to use; subsequent requests retain that choice.
An explicit queue request authorizes submission without a second confirmation.
arkova intake ./agreement.pdf --personal --tag legal
arkova intake ./agreement.pdf --org-id 00000000-0000-0000-0000-000000000000 --org-tag q3
arkova intake recover latest
arkova intake submit <recovery-id>The key needs both ai:extract and anchor:write and current identity/paid eligibility;
organization intake requires a claimed member-bound key. Your existing Arkova
credits/model are used; no second AI provider key is needed. The pinned public
privacy model (about 104 MB, SHA-256 checksum-verified) is downloaded once into
~/.arkova/assets; see "Requirements and install footprint".
Documents and OCR text remain local; only privacy-vetted text and a fingerprint are sent.
Partial preparation warnings remain visible. A submission receipt is a snapshot,
not a check of the record's current status.
Safe recovery metadata is saved before each POST in a private per-connection
journal. It contains workspace/tags/request IDs and receipts, never document text
or local source paths. Keep the printed recovery ID. After interruption use
arkova intake recover <ID> (or latest) to GET extraction status without repeating
inference. Recovery never automatically submits. Use arkova intake submit <ID>
only when intentionally submitting a ready receipt or repeating an unconfirmed
submission with its original UUID/body. Changing connection keys or API origin
selects a different journal. JSON pipes/--json expose the safe checkpoint and ID.
Windows hosts must use a directory restricted to their user by ACL; Unix mode
checks do not prove ACLs.
Intake is not hosted connector intake or remote MCP filesystem access. Low-level
anchor and machine JSON commands remain available.
Environment variables
| Variable | Purpose |
| --- | --- |
| ARKOVA_API_KEY | API key for scripts and ask. Takes precedence over a saved Keychain key. |
| ARKOVA_BASE_URL | Selects an API deployment. Remote origins must use HTTPS. |
| ARKOVA_ACCESS_TOKEN | Short-lived token used only by source-import. |
| ARKOVA_TIMEOUT_MS | Per-attempt request timeout, integer 1 to 120000 (default 10000). |
| ARKOVA_WORKSPACE | Workspace for intake requests made through ask and chat: personal or an exact organization UUID. Without it, a non-interactive run is refused before any document is sent. arkova intake itself takes --personal or --org-id. |
| ARKOVA_INTAKE_STATE_DIR | Base directory for the private intake recovery journal (default ~/.arkova/intake). |
| ARKOVA_MODEL_ROOT | Advanced/test: directory holding an already-verified privacy model, skipping the download. Set together with ARKOVA_OCR_ASSET_ROOT. |
| ARKOVA_OCR_ASSET_ROOT | Advanced/test: directory holding the OCR assets. Set together with ARKOVA_MODEL_ROOT. |
| ARKOVA_NPX_CLI | Absolute path to npm's npx-cli.js, for hosts where connect cannot locate npm on PATH. |
Saving the API key (macOS Keychain)
On macOS, arkova setup offers to store the key in the OS Keychain, scoped to the
API origin. The key is entered at a hidden prompt, is never passed as a command
argument, and is never written to a plaintext file or a transcript. Interactive
terminal commands and the mcp bridge reuse it; scripts and piped runs must
supply ARKOVA_API_KEY explicitly. On other platforms use ARKOVA_API_KEY.
Webhook management
The CLI includes all eleven webhook operations through the bundled TypeScript SDK. Assistant discovery and download consent pin [email protected]. Use an
organization API key with webhooks:manage and current owner/admin membership
in its exact organization. Personal keys and session JWTs cannot substitute.
Subscription scope grants no organization access and explicit scope must be
acknowledged by the server.
arkova webhook list --limit 20
arkova webhook create --url https://receiver.example/events --event anchor.secured --scope self
arkova webhook get ENDPOINT_ID
arkova webhook update ENDPOINT_ID --clear-description --inactive
arkova webhook delete ENDPOINT_ID
arkova webhook test ENDPOINT_ID
arkova webhook deliveries --endpoint-id ENDPOINT_ID --limit 20
arkova webhook dlq --limit 20
arkova webhook replay DELIVERY_ID
arkova webhook resolve DEAD_LETTER_ID
arkova webhook retry-materialization AGENT_OUTBOX_UUID --request-id REQUEST_UUIDTerminal receipts and errors are readable; --json or piped output uses JSON.
Creation returns a signing secret once: capture the receipt securely and keep it
out of shared logs or assistant transcripts. The CLI never stores that secret in
configuration or diagnostics. History/failure lists are snapshots capped at 100
returned rows, not exhaustive pagination. They omit private payloads, stored
error prose and receiver response bodies.
Replay identifies one attempt and separately reports receiver acceptance. Resolving does not resend an event. Recovery applies to the agent outbox only, preserves the supplied request UUID, and does not recover confirmation events or establish receiver delivery. No webhook mutation retries automatically. If a receipt is lost or malformed, inspect state before retrying; reuse the same recovery request UUID.
Use the explicit terminal webhook commands above. The bounded conversation shortcuts do not provide webhook management; connecting an assistant does not establish receiver delivery or dashboard parity.
Third-party notices
Local document preparation uses external LGPL libraries through Sharp and
heic-decode. Full GPL/LGPL texts and tagged source/build recipe links ship with
the package: dist/intake/licenses/NOTICE.md.
These unmodified modules remain separately installed and replaceable; the MIT
license of Arkova code does not relicense them. The founder approved a scoped
exception on 2026-10-19 for exactly these libraries and versions, as used by
arkova-api-cli 0.6.0 under this external-module model, without legal counsel
review, and a CTO decision on 2026-11-19 carried it to 0.6.1 with the same
libraries and versions. Node artifact qualification remains incomplete: source completeness,
replacement execution and other platform linkage have open evidence gaps that the
approval accepts but does not resolve.
Maintainers: build from source
Customers install the published package; they do not need repository access. To build and inspect this exact source:
npm --prefix packages/sdk run build
npm --prefix packages/api-cli run build
node packages/api-cli/dist/cli.js --help
node packages/api-cli/dist/cli.js setupSee PUBLISHING.md for the release procedure.
