CLI Reference

Complete reference for all 14 ClawDNA CLI commands. Install with npm install -g @clawco-io/dna.

Core Commands

clawdna init

Interactive setup wizard — detects your agent workspace and configures hub connection.

$ clawdna init

Checks for OpenClaw at ~/.openclaw, parses openclaw.json to find the workspace, and prompts for hub type (Cloud, Git remote, or local-only). Creates ~/.clawdna/config.json and initial environment profile.

clawdna snapshot

Create a timestamped .dna identity bundle.

$ clawdna snapshot --name <name>
FlagDescription
--name <name>Human-readable label for this snapshot
--tags <tags>Comma-separated tags for filtering
--encryptEncrypt the bundle with AES-256-GCM

Example:

$ clawdna snapshot --name "before-personality-update" --tags "backup,stable"

clawdna restore

Restore identity from a snapshot, with optional dry-run preview.

$ clawdna restore <bundle-id> --dry-run
FlagDescription
--dry-runShow what would be restored without applying
--forceSkip confirmation prompt

clawdna diff

Show changes between local identity and hub, or between two snapshots.

$ clawdna diff                      # local vs hub
$ clawdna diff <bundle-a> <bundle-b>  # between two bundles

Outputs a unified diff with significance ratings: high for SOUL.md and AGENTS.md changes, medium for skill and config changes, low for cosmetic changes.

clawdna log

Display identity change history with timestamps and environment attribution.

$ clawdna log

Shows a chronological list of all snapshots and sync events for the current agent.

Sync Commands

clawdna push

Push current identity to the configured hub.

$ clawdna push --message "updated personality tone"
FlagDescription
-m, --message <msg>Commit message for this push
--forcePush even if hub is ahead
--dry-runShow what would be pushed

Push runs the secrets sanitizer before any network call. If secrets are detected, the operation is aborted.

clawdna pull

Pull latest identity from hub, show diff, and apply.

$ clawdna pull --dry-run
FlagDescription
--dry-runShow diff without applying changes
--quietApply without showing diff

If both local and hub have changes (diverged state), ClawDNA prompts for conflict resolution: hub wins, local wins, or file-by-file merge.

clawdna clone

Fork an agent — create a new environment inheriting from a source.

$ clawdna clone <source-env> <dest-env>

Creates a new environment profile with the source's identity as its starting point. The new environment can diverge independently or stay in sync via pull.

clawdna fleet push

Push identity update to all registered environments simultaneously.

$ clawdna fleet push --filter <tag>
FlagDescription
--filter <tag>Only push to environments matching this tag
--concurrency <n>Max parallel pushes (default: 3)
--dry-runShow targets without pushing

Advanced Commands

clawdna env

Manage environment profiles (per-machine overrides, tokens as env var refs).

$ clawdna env add        # Create new environment profile
$ clawdna env list       # List all environments
$ clawdna env switch <id> # Switch active environment

Each environment has a local profile at ~/.clawdna/envs/<env-id>.profile.yaml that stores secret references (never raw values), sync role (primary/replica/fork), and local path overrides.

clawdna memory distill

Promote key decisions and preferences from session memory to core identity.

$ clawdna memory distill --dry-run
FlagDescription
--dry-runShow what would be promoted without applying

Uses an LLM (Anthropic API) to classify memory entries as core (permanent) or ephemeral (session-only), then promotes core entries to MEMORY.md. Requires Pro tier or above for Cloud distillation.

clawdna daemon

Background sync daemon — watches for changes and auto-pushes on debounce.

$ clawdna daemon start   # Start background daemon
$ clawdna daemon stop    # Stop the daemon
$ clawdna daemon status  # Check daemon status

The daemon watches identity files with chokidar, debounces changes, and auto-pushes to the hub. Also listens for incoming webhooks to trigger auto-pull.

clawdna doctor

Diagnose sync issues, verify file integrity, and check permissions.

$ clawdna doctor

Checks: hub connectivity, file permissions (warns if not 600/700), identity file integrity, sync state consistency, and OpenClaw version compatibility.

clawdna upgrade

Safe wrapper around agent runtime upgrades — snapshots before, verifies after.

$ clawdna upgrade

Automatically creates a snapshot before the upgrade, runs the runtime update, then verifies identity files are intact. If verification fails, offers to restore from the pre-upgrade snapshot.

This command upgrades your agent runtime (OpenClaw), not the ClawDNA CLI itself. To update the CLI, run npm install -g @clawco-io/dna.