Documentation

CLI Reference

The zt binary is the primary interface to 0trace. It is a thin dispatcher over the runtime core — capability enforcement and audit logging apply to every command.

Installation

Linux / macOS (binary)

# Linux x86_64
curl -L https://releases.0trace.ai/latest/zt-linux-x86_64 -o /usr/local/bin/zt
chmod +x /usr/local/bin/zt

# macOS arm64
curl -L https://releases.0trace.ai/latest/zt-macos-arm64 -o /usr/local/bin/zt
chmod +x /usr/local/bin/zt

zt help

Docker (no install)

docker run --rm -it ghcr.io/0trace-ai/zt:latest help

To run a skill with Docker, mount your skill file into the container:

docker run --rm -it \
  -v "$(pwd):/workspace" \
  ghcr.io/0trace-ai/zt:latest \
  run /workspace/my-skill.md

Build from source

Requires Zig 0.13.0. Produces a single static binary with no runtime dependencies.

git clone https://github.com/0trace-ai/zt.git
cd zt
zig build -Doptimize=ReleaseSafe
./zig-out/bin/zt help

Command Reference

Full list of zt commands and their flags.

Command Description
zt helpShow available commands
zt run <skill.md>Execute a skill
zt run <skill.md> --input k=vExecute with input parameter
zt install <skill.md>Install and verify a skill
zt verify <skill.md>Verify skill signature
zt sign <skill.md>Sign a skill with your key
zt skill init <name>Scaffold a new skill from template Planned
zt skill compat-check <skill.md>Check capability declarations vs usage Planned
zt skill publish <skill.md>Publish skill to the 0trace registry Planned
zt skills listList installed skills Planned
zt keys listList trusted signing keys
zt keys generate --name <id>Generate a new Ed25519 signing keypair Planned
zt keys trust <pubkey>Trust a signing key
zt keys revoke <pubkey>Revoke a trusted key
zt audit verify <run-id>Verify the hash chain for a run
zt audit export <run-id>Export audit bundle (compliance)
zt policy showShow current global policy
zt policy updateUpdate global policy
zt serveStart the HTTP API server (port 8743)
zt serve --host 0.0.0.0 --port 8743Bind server to all interfaces
zt node start --gateway <url> --token <bearer>Start an execution node worker
zt identity enroll <agent-id>Generate an Ed25519 keypair and enroll an agent identity
zt secrets listList credential handles
zt secrets auditReview credential access events
zt secrets rotate <handle-id>Rotate a credential handle
zt secrets breach-report --hours <n>Export breach events for a time window
zt credentials storeStore a credential in the vault Planned
zt credentials rotateRotate a stored credential Planned

Planned commands are implemented as internal runtime modules but not yet wired into the zt CLI dispatcher — they are not callable in the current build. Everything else on this page reflects the binary as it ships today.

Running Skills

zt run executes a skill file directly. No signing is required for local execution. The runtime enforces all capability declarations and resource limits regardless.

Basic execution

zt run my-skill.md

Passing input parameters

Input values are passed as key=value pairs with the --input flag.

zt run fetch-summary.md --input url=https://example.com
zt run report.md --input format=json --input limit=50

Deterministic mode

Replaces non-determinism (time, scheduling) for reproducible runs. Useful for testing and compliance.

zt run my-skill.md --deterministic

Running an installed skill by name

Once installed, skills can be invoked by their registry name instead of file path.

zt run @acme/summarize --input text="..."

Skill Management

Installing a skill locally

zt sign my-skill.md --key my-publisher-key
zt install my-skill.md
Planned: zt skill init (scaffolding), zt skill compat-check (capability-vs-usage validation), zt skill publish (registry publish), and zt skills list (list installed skills) are implemented as internal runtime modules but not yet wired into the zt CLI dispatcher. Today, skill installation is limited to zt sign + zt install.

See Writing Skills for the full skill format and the target sign-and-publish workflow.

Key Management

Skills published to the registry must be signed with an Ed25519 key. Private keys are stored in your system keychain — never written to disk as plaintext.

Planned: zt keys generate is not yet wired into the CLI. Agent identity keys can be generated today via zt identity enroll <agent-id>, which writes an Ed25519 key to ~/.zt/keys/<id>.key.

List trusted keys

zt keys list

Key ID              Fingerprint                      Trust Level
────────────────────────────────────────────────────────────────
my-publisher-key    ed25519:a1b2c3d4e5f6...          local
acme-corp           ed25519:f6e5d4c3b2a1...          registry

Trust a key

Verify the fingerprint out-of-band before trusting any key.

zt keys trust ed25519:<public-key-hex>

Revoke a key

zt keys revoke <key-id> --reason "publisher account compromised"
Never run zt install --skip-verification. If a skill fails signature verification, investigate before proceeding.

Audit Trail

Every execution produces a hash-chained audit log stored in SQLite. Events are SHA256-chained — any tampering is detectable with zt audit verify.

Verify the hash chain

zt audit verify abc123
Chain OK — 5 events, no tampering detected

Export a compliance bundle

zt audit export abc123 --output audit-bundle.json

zt audit only exposes verify and export subcommands today — there is no standalone command to print a run's event list; use zt audit export and inspect the JSON bundle, or query GET /api/audit/:run_id on a running zt serve instance.

Audit event types

Event TypeWhen Emitted
execution_startSkill execution begins
capability_checkA capability is checked (pass or deny)
host_invocationA host function is called
file_accessA file is read or written
network_callAn HTTP request is made
resource_violationA resource limit is exceeded
execution_endSkill execution completes

Policy

Global policy defines domain allowlists, path restrictions, rate limits, and capability overrides that apply to every skill execution on the host.

View current policy

zt policy show

Update policy

zt policy update <policy.json> [--skill <id>] [--dry-run]

Default resource limits per execution

ResourceDefault Limit
Memory64 MB
Wall-clock time30 seconds
Outbound network bytes10 MB
File I/O operations1,000
Concurrent task depth16 levels

Skills can declare lower limits in their ## Policy section. They cannot override stricter limits set by the operator policy.

HTTP Server

zt serve starts a REST API on port 8743 (default). The server binds to 127.0.0.1 by default — pass --host 0.0.0.0 to expose it.

zt serve
# API token printed to stderr on startup — required for all requests

zt serve --host 0.0.0.0 --port 8743

HTTP API endpoints

MethodEndpointDescription
GET/api/statusServer health and version
POST/api/runExecute a skill
GET/api/skillsList installed skills
POST/api/skills/installInstall a skill
POST/api/skills/verifyVerify a skill signature
GET/api/policyGet global policy
PUT/api/policyUpdate global policy
GET/api/keysList trusted keys
POST/api/keys/trustTrust a signing key
POST/api/keys/revokeRevoke a key
GET/api/audit/:run_idFetch audit log for a run
GET/api/audit/:run_id/exportExport audit bundle
GET/api/csrfGet CSRF token

All endpoints require the API token generated at server startup (passed as Authorization: Bearer <token>).

Credentials

API keys and secrets are stored in 0trace's encrypted vault — never in environment variables or plaintext files. See Secret Management for the full architecture.

# List credential handles
zt secrets list

# Review credential access in the audit log
zt secrets audit

# Rotate a credential handle
zt secrets rotate <handle-id>

# Export breach events from the last 24 hours
zt secrets breach-report --hours 24
Planned: zt credentials store/rotate/migrate (interactive credential entry) are not yet wired into the CLI. Credentials are currently provisioned through the vault backend configuration — see Secret Management.