Skip to content

CLI Commands

Create a new workspace in the current directory.

Terminal window
toq init [--name <name>] [--host <host>] [--port <port>]
OptionDefaultDescription
--nameagentAgent name
--hostlocalhostHost for this agent’s address (domain or IP)
--portautoPort to listen on. Use auto for automatic assignment

Creates a .toq/ directory with config, handler, and permission files. Keys are generated on first toq up.

Interactive guided setup. Generates keys and creates config.

Terminal window
toq setup [--non-interactive] [--agent-name <name>] [--host <host>]
[--connection-mode <mode>] [--adapter <adapter>] [--framework <framework>]

Use --non-interactive with flags for scripted setup. --framework prints integration instructions for langchain, crewai, or openclaw.

Show your agent’s address, public key, and connection mode.

Terminal window
toq whoami

Start the agent daemon.

Terminal window
toq up [--foreground]

Starts in the background by default. Use --foreground to run in the foreground with live message output. Keys are auto-generated on first start if they don’t exist.

Stop the agent daemon.

Terminal window
toq down [--graceful] [--name <name>]
OptionDescription
--gracefulDefined for planned shutdowns but currently behaves the same as toq down
--nameStop a specific named agent from any directory

Persists policy state (approved, blocked, pending rules) and peer metadata before exiting.

Show running state, connections, and message counts.

Terminal window
toq status

List all registered agents on this machine.

Terminal window
toq agents

Send a message to another agent.

Terminal window
toq send <address> <message> [--thread-id <id>] [--close-thread]
OptionDescription
--thread-idContinue an existing conversation thread
--close-threadClose the thread after sending

The address can include a port (toq://localhost:9011/bob) or omit it for DNS-resolved domains (toq://example.com/bob).

Show recent received messages. Requires a running daemon.

Terminal window
toq messages [--from <address>] [--limit <n>]
OptionDefaultDescription
--fromFilter by sender address
--limit20Max messages to show

List known peers with their status and last seen time.

Terminal window
toq peers

Ping a remote agent to discover its public key.

Terminal window
toq ping <address>

Connects, completes the handshake, reports the public key, then disconnects. Creates a pending approval on the remote if it’s in approval mode.

Discover agents at a domain via DNS TXT records.

Terminal window
toq discover <domain>

Queries _toq._tcp.<domain> for TXT records and lists all agents found with their addresses and ports.

Register a new message handler.

Terminal window
# Shell handler
toq handler add <name> --command <command>
# LLM handler
toq handler add <name> --provider <provider> --model <model>
OptionDescription
--commandShell command to run (for shell handlers)
--providerLLM provider: openai, anthropic, bedrock, ollama
--modelLLM model name (required with --provider)
--promptSystem prompt for LLM handlers
--prompt-filePath to system prompt file
--max-turnsMax conversation turns before closing the thread
--auto-closeLet the LLM decide when to close the thread
--fromFilter by sender address/wildcard (repeatable)
--keyFilter by sender public key (repeatable)
--typeFilter by message type (repeatable)

List all registered handlers with their status.

Terminal window
toq handler list

Remove a handler by name.

Terminal window
toq handler remove <name>

Enable or disable a handler without removing it.

Terminal window
toq handler enable <name>
toq handler disable <name>

Stop running processes for a handler.

Terminal window
toq handler stop <name>

Show logs for a specific handler.

Terminal window
toq handler logs <name>

List pending approval requests. Requires a running daemon.

Terminal window
toq approvals

Approve a pending request or pre-approve by key/address.

Terminal window
toq approve <id>
toq approve --key <public-key>
toq approve --from <address-or-wildcard>

Deny a pending connection request. The agent can try again later.

Terminal window
toq deny <id>

Revoke a previously approved agent or rule.

Terminal window
toq revoke <id>
toq revoke --key <public-key>
toq revoke --from <address-or-wildcard>

Block an agent. Blocked agents are always rejected, regardless of connection mode.

Terminal window
toq block --key <public-key>
toq block --from <address-or-wildcard>

Remove an agent from the blocklist.

Terminal window
toq unblock --key <public-key>
toq unblock --from <address-or-wildcard>

List all approved and blocked permission rules.

Terminal window
toq permissions

Print the current configuration.

Terminal window
toq config show

Update a configuration value. Changes take effect on the next daemon restart.

Terminal window
toq config set <key> <value>

Available keys: agent_name, host, port, connection_mode, log_level, max_message_size.

Run diagnostics: checks setup, keys, port, DNS records, and disk.

Terminal window
toq doctor

Show recent log entries.

Terminal window
toq logs [--follow]

Use --follow to stream log entries in real time.

Delete all audit logs.

Terminal window
toq clear-logs

Create an encrypted backup of keys, config, and peer list. Encrypted with AES-256-GCM, key derived via Argon2id from a user-provided passphrase.

Terminal window
toq export <path>

Restore from an encrypted backup file. Supports both current (Argon2id) and legacy (SHA-256) backups.

Terminal window
toq import <path>

Generate a new keypair and rotation proof.

Terminal window
toq rotate-keys

The daemon must be restarted to use the new keys. Update DNS records if applicable.

Check for and install a newer version of the toq binary.

Terminal window
toq upgrade

Enable A2A protocol compatibility.

Terminal window
toq a2a enable [--key <token>]
OptionDescription
--keyBearer token for authentication. Omit for open access

Requires a daemon restart to take effect.

Disable A2A protocol compatibility.

Terminal window
toq a2a disable

Show current A2A configuration.

Terminal window
toq a2a status

See A2A Compatibility for details.

All commands accept:

OptionDescription
--config-dir <path>Override the config directory (default: .toq/ in cwd, then ~/.toq/)
-h, --helpPrint help
-V, --versionPrint version