CLI Usage

The JACS CLI provides a command-line interface for managing agents, documents, tasks, and agreements.

Getting Help

# General help
jacs --help

# Command-specific help
jacs agent --help
jacs document --help
jacs task --help

Commands Overview

CommandDescription
jacs initInitialize JACS (create config and agent with keys)
jacs versionPrint version information
jacs configManage configuration
jacs agentManage agents
jacs documentManage documents
jacs taskManage tasks

Initialization

Quick Start

# Initialize everything in one step
jacs init

This command:

  1. Creates a configuration file (jacs.config.json)
  2. Generates cryptographic keys
  3. Creates an initial agent document

Configuration Commands

Create Configuration

jacs config create

Creates a new jacs.config.json file in the current directory with default settings.

Read Configuration

jacs config read

Displays the current configuration, including values from both the config file and environment variables.

Agent Commands

Create Agent

jacs agent create --create-keys true

# With a custom agent definition file
jacs agent create --create-keys true -f my-agent.json

# Without creating new keys (use existing)
jacs agent create --create-keys false -f my-agent.json

Options:

OptionShortRequiredDescription
--create-keysYesWhether to create new cryptographic keys
-fNoPath to JSON file with agent definition

Verify Agent

# Verify agent from config
jacs agent verify

# Verify specific agent file
jacs agent verify -a ./path/to/agent.json

# With DNS validation options
jacs agent verify --require-dns
jacs agent verify --require-strict-dns
jacs agent verify --no-dns
jacs agent verify --ignore-dns

Options:

OptionShortDescription
-a--agent-filePath to agent file (optional)
--no-dnsDisable DNS validation
--require-dnsRequire DNS validation (not strict)
--require-strict-dnsRequire DNSSEC validation
--ignore-dnsIgnore DNS validation entirely

DNS Commands

# Generate DNS TXT record commands for agent publishing
jacs agent dns --domain example.com --agent-id [uuid]

# With different output formats
jacs agent dns --domain example.com --encoding hex
jacs agent dns --domain example.com --provider aws

# With custom TTL
jacs agent dns --domain example.com --ttl 7200

Options:

OptionDefaultDescription
--domainDomain for DNS record
--agent-idAgent UUID (optional, uses config if not provided)
--ttl3600Time-to-live in seconds
--encodingbase64Encoding format (base64, hex)
--providerplainOutput format (plain, aws, azure, cloudflare)

Lookup Agent

# Look up another agent's public key from their domain
jacs agent lookup agent.example.com

# With strict DNSSEC validation
jacs agent lookup agent.example.com --strict

# Skip DNS lookup
jacs agent lookup agent.example.com --no-dns

Task Commands

Create Task

jacs task create -n "Task Name" -d "Task description"

# With optional agent file
jacs task create -n "Task Name" -d "Description" -a ./agent.json

# With input file
jacs task create -n "Task Name" -d "Description" -f ./task-details.json

Options:

OptionShortRequiredDescription
-n--nameYesName of the task
-d--descriptionYesDescription of the task
-a--agent-fileNoPath to agent file
-f--filenameNoPath to JSON file with additional task data

Document Commands

Create Document

# Create from a JSON file
jacs document create -f ./document.json

# Create from a directory of files
jacs document create -d ./documents/

# With custom schema
jacs document create -f ./document.json -s ./custom-schema.json

# With file attachments
jacs document create -f ./document.json --attach ./attachment.pdf

# Embed attachments in document
jacs document create -f ./document.json --attach ./files/ --embed true

# Output to specific file
jacs document create -f ./document.json -o ./output.json

# Print to stdout instead of saving
jacs document create -f ./document.json --no-save

Options:

OptionShortDescription
-f--filenamePath to input JSON file
-d--directoryPath to directory of JSON files
-o--outputOutput filename
-s--schemaPath to custom JSON schema
--attachPath to file/directory for attachments
--embed-eEmbed documents (true/false)
--no-save-nPrint to stdout instead of saving
-v--verboseEnable verbose output
-a--agent-filePath to agent file

Update Document

# Update an existing document with new content
jacs document update -f ./original.json -n ./updated.json

# With output file
jacs document update -f ./original.json -n ./updated.json -o ./result.json

# With file attachments
jacs document update -f ./original.json -n ./updated.json --attach ./new-file.pdf

Options:

OptionShortRequiredDescription
-f--filenameYesPath to original document
-n--newYesPath to new version
-o--outputNoOutput filename
--attachNoPath to file attachments
--embed-eNoEmbed documents (true/false)

Verify Document

# Verify a document
jacs document verify -f ./document.json

# Verify all documents in a directory
jacs document verify -d ./documents/

# With custom schema
jacs document verify -f ./document.json -s ./schema.json

# Verbose output
jacs document verify -f ./document.json -v

Options:

OptionShortDescription
-f--filenamePath to document file
-d--directoryPath to directory of documents
-s--schemaPath to JSON schema for validation
-v--verboseEnable verbose output
-a--agent-filePath to agent file

Extract Embedded Content

# Extract embedded content from a document
jacs document extract -f ./document.json

# Extract from all documents in directory
jacs document extract -d ./documents/

Agreement Commands

# Create an agreement requiring signatures from specified agents
jacs document create-agreement -f ./document.json -i agent1-uuid,agent2-uuid

# Check agreement status
jacs document check-agreement -f ./document.json

# Sign an agreement
jacs document sign-agreement -f ./document.json

Create Agreement Options:

OptionShortRequiredDescription
-f--filenameYesPath to document
-i--agentidsYesComma-separated list of agent UUIDs
-o--outputNoOutput filename
--no-save-nNoPrint to stdout

Environment Variables

The CLI respects the following environment variables:

# Use a specific configuration file
JACS_CONFIG_PATH=./custom-config.json jacs agent verify

# Override settings
JACS_DATA_DIRECTORY=./data jacs document create -f ./doc.json
JACS_KEY_DIRECTORY=./keys jacs agent create --create-keys true

Common Workflows

Create and Sign a Document

# 1. Initialize (if not done)
jacs init

# 2. Create document
jacs document create -f ./my-document.json

# 3. Verify the signed document
jacs document verify -f ./jacs_data/[document-id].json

Multi-Agent Agreement

# 1. Create agreement on a document
jacs document create-agreement -f ./document.json -i agent1-id,agent2-id

# 2. First agent signs
jacs document sign-agreement -f ./document.json

# 3. Second agent signs (using their config)
JACS_CONFIG_PATH=./agent2.config.json jacs document sign-agreement -f ./document.json

# 4. Check agreement is complete
jacs document check-agreement -f ./document.json

Verify Another Agent

# Look up agent by domain
jacs agent lookup other-agent.example.com

# Verify with strict DNS
jacs agent verify -a ./other-agent.json --require-strict-dns

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3File not found
4Verification failed
5Signature invalid

Next Steps