tap-cli
Command-line interface for TAP Agent operations. tap-cli enables you to manage agents, create and monitor transactions, perform Travel Rule compliance operations, and interact with the TAP ecosystem from the terminal.
Installation
From crates.io (recommended)
From source
Verify installation
Prerequisites
- Rust 1.71.0 or later
Quick Start
# Create your first agent (generates a new DID automatically)
# Or generate a DID explicitly
# Create a transfer
Global Flags
| Flag | Env Var | Description |
|---|---|---|
--agent-did <DID> |
TAP_AGENT_DID |
Use a specific agent DID for operations |
--tap-root <PATH> |
TAP_ROOT or TAP_HOME |
Custom TAP data directory (default: ~/.tap) |
--format <FORMAT> |
Output format: json (default) or text |
|
--debug / -d |
Enable debug logging to stderr |
If no agent is specified and no stored keys exist, a new agent with a generated DID is created automatically.
Commands
agent — Manage Agents
# Create a new agent
# List all registered agents
did — DID Operations
# Generate a new DID (did:key by default)
# Resolve a DID to its DID Document
# Manage stored keys
transaction — Create and List Transactions
transaction transfer — TAIP-3 Transfer (VASP-to-VASP)
# With agents
| Flag | Required | Description |
|---|---|---|
--asset |
Yes | CAIP-19 asset identifier |
--amount |
Yes | Transfer amount |
--originator |
Yes | Originator DID |
--beneficiary |
Yes | Beneficiary DID |
--agents |
No | Agents as JSON array |
--memo |
No | Optional memo |
--expiry |
No | ISO 8601 expiry timestamp |
--transaction-value |
No | Fiat equivalent as amount:currency (e.g., 1000.00:USD) |
transaction payment — TAIP-14 Payment Request
# Payment with asset
# Payment with fiat currency
# With expiry and invoice
| Flag | Required | Description |
|---|---|---|
--amount |
Yes | Payment amount |
--merchant |
Yes | Merchant DID |
--asset |
No* | CAIP-19 asset identifier |
--currency |
No* | ISO 4217 currency code (e.g., USD) |
--agents |
No | Agents as JSON array |
--memo |
No | Optional memo |
--expiry |
No | ISO 8601 expiry timestamp |
--invoice-url |
No | Invoice URL (TAIP-16) |
--fallback-addresses |
No | Comma-separated fallback settlement addresses (CAIP-10) |
* One of --asset or --currency must be specified.
transaction connect — TAIP-15 Connection Request
# With transaction limits and constraints
| Flag | Required | Description |
|---|---|---|
--recipient |
Yes | Recipient agent DID |
--for |
Yes | Party DID this connection is for |
--role |
No | Agent role (e.g., SourceAgent) |
--constraints |
No | Constraints JSON (limits, allowed_beneficiaries, allowed_settlement_addresses, allowed_assets) |
--expiry |
No | ISO 8601 expiry timestamp |
--agreement |
No | URL to terms of service or agreement |
transaction escrow — TAIP-17 Escrow Request
transaction capture — Release Escrowed Funds
# Partial capture
transaction exchange — TAIP-18 Exchange Request
# With a specific provider
transaction quote — TAIP-18 Quote Response
transaction list — Query Transactions
# List all transactions for the current agent
# Filter by type
# Filter by thread ID
# Pagination
action — Transaction Lifecycle Actions
action authorize — TAIP-4 Authorization
# With settlement address
action reject — TAIP-4 Rejection
action cancel — TAIP-5 Cancellation
action settle — TAIP-6 Settlement
# Partial settlement
action revert — TAIP-12 Revert
agent-mgmt — Agent & Policy Management within Transactions
Manage agents and policies on existing transactions (TAIP-5, TAIP-7).
# Add agents to a transaction
# Remove an agent from a transaction
# Replace an agent in a transaction
# Update transaction policies
comm — Communication
# Send a trust ping to verify agent connectivity
# Send a basic text message
customer — Customer Management
# List customers
# Create a customer with a Schema.org profile
# View customer details
# Update a customer profile
# Generate IVMS101 data for Travel Rule compliance
decision — Decision Log Management
Decisions are created when the TAP node reaches a decision point in the transaction lifecycle (e.g., authorization needed, settlement required). In poll mode, they accumulate in the database for external systems to act on.
# List all pending decisions
# List all decisions (any status)
# Paginate through decisions
# Resolve a decision by authorizing the transaction
# Resolve with additional detail
# Reject a decision
# Defer a decision (mark as seen, will act later)
Decision types:
authorization_required— New transaction needs approvalpolicy_satisfaction_required— Policies must be fulfilledsettlement_required— All agents authorized, ready to settle
Decision statuses: pending, delivered, resolved, expired
Note: The action commands (authorize, reject, settle, cancel, revert) automatically resolve matching decisions when they succeed. You can use either decision resolve for fine-grained control or action commands for the common case.
delivery — Message Delivery Tracking
# List deliveries for a recipient
# List deliveries for a message
# List deliveries for a transaction thread
# With pagination
received — Received Message Inspection
# List all received messages
# List pending (unprocessed) messages
# View a specific message by its numeric ID
# With explicit agent DID
Output Formats
All commands output JSON by default. Use --format text for a more readable format in interactive sessions.
# JSON output (default, good for scripting)
# Text output (good for human reading)
JSON output can be piped through jq for filtering:
|
Environment Variables
| Variable | Description |
|---|---|
TAP_ROOT |
TAP data directory (also TAP_HOME) |
TAP_AGENT_DID |
Default agent DID to use |
Storage
tap-cli stores data under ~/.tap/ by default:
~/.tap/
├── keys.json # Stored DID keys
└── agents/
└── <did-hash>/
└── storage.db # Per-agent SQLite database
Use --tap-root or TAP_ROOT to point to a different directory.
Complete Workflow Example
# 1. Generate and save a DID
# 2. Verify it's stored
# 3. Initiate a transfer
RESULT=
TX_ID=
# 4. Authorize the transaction
# 5. Settle once on-chain confirmation is received
# 6. Review the transaction log
|
Related Packages
- tap-agent — Core agent and key management
- tap-node — TAP node orchestration
- tap-msg — TAP message types
- tap-http — HTTP server for DIDComm transport
- tap-mcp — AI assistant integration via MCP
License
MIT — see LICENSE-MIT.