Global Flags

FlagEnv VarDefaultDescription
--humanALF_HUMAN=1offSwitch stdout from JSON to human-readable text

All commands output structured JSON to stdout by default. Progress messages go to stderr. Use --human (or set ALF_HUMAN=1) to switch stdout back to human-readable colored text.

Quick Reference

CommandPurposeRequires API Key
alf checkPre-flight environment diagnosticsNo (but checks if set)
alf loginStore API keyNo
alf exportWorkspace → .alf archiveNo
alf syncIncremental sync to cloudYes
alf restoreDownload and restore from cloudYes
alf import.alf archive → workspaceNo
alf validateValidate .alf archiveNo
alf helpHelp topics and statusNo

alf check

Pre-flight diagnostic. Discovers the workspace, verifies resources, reports readiness. Run this first before any other command — it tells you whether sync will work and what to fix if not.

Usage

alf check -r <runtime> [-w <workspace>]

Flags

FlagShortRequiredDescription
--runtime-rYesopenclaw or zeroclaw
--workspace-wNoWorkspace path (auto-discovered if omitted)

Workspace Auto-Discovery

When -w is omitted, the workspace is resolved in this order:

  1. defaults.workspace in ~/.alf/config.toml
  2. agents.defaults.workspace in ~/.openclaw/openclaw.json
  3. ~/.openclaw/workspace (default)

The workspace.source field in the output reports which method was used: "flag", "alf_config", "openclaw.json", or "default".

JSON Output (success)

{
  "ok": true,
  "runtime": "openclaw",
  "ready_to_sync": true,
  "workspace": {
    "path": "/home/user/.openclaw/workspace",
    "source": "openclaw.json",
    "exists": true,
    "writable": true
  },
  "resources": {
    "soul_md": true,
    "identity_md": false,
    "agents_md": true,
    "user_md": true,
    "memory_md": true,
    "memory_dir": true,
    "daily_logs": { "count": 10, "latest": "2026-03-12.md" },
    "active_context": true,
    "project_files": { "count": 2 },
    "agent_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
  },
  "openclaw": {
    "config_found": true,
    "workspace_configured": "/home/user/.openclaw/workspace"
  },
  "alf": {
    "config_exists": true,
    "api_key_set": true,
    "agent_tracked": true,
    "last_synced_sequence": 5,
    "service_reachable": true
  },
  "issues": [],
  "suggestions": ["Run: alf sync -r openclaw -w /home/user/.openclaw/workspace"]
}

JSON Output (issues found)

{
  "ok": false,
  "runtime": "openclaw",
  "ready_to_sync": false,
  "workspace": { "path": "/home/user/.openclaw/workspace", "source": "default", "exists": false, "writable": false },
  "resources": { ... },
  "alf": { "config_exists": false, "api_key_set": false, "agent_tracked": false, "last_synced_sequence": null, "service_reachable": false },
  "issues": [
    { "severity": "error", "code": "workspace_not_found", "message": "Workspace directory not found", "fix": "Pass correct path: alf check -r openclaw -w /path/to/workspace" },
    { "severity": "error", "code": "no_api_key", "message": "No API key configured", "fix": "Run: alf login --key <your-api-key>" }
  ],
  "suggestions": ["Get an API key at https://agent-life.ai/settings/api-keys"]
}

Issue Codes

CodeSeverityMeaningFix
workspace_not_founderrorWorkspace directory doesn't existPass correct -w path
workspace_not_writablewarningWorkspace exists but isn't writableCheck permissions
workspace_emptywarningNo .md files in workspace rootWorkspace may not be initialized
no_soul_mdwarningSOUL.md not foundAgent has no persona file; will export with fallback name
no_memory_contentwarningNo MEMORY.md and no memory/ directoryNothing to sync yet
memory_dir_emptywarningmemory/ exists but has no .md filesNo daily logs yet
no_api_keyerrorNo API key in ~/.alf/config.tomlalf login --key <key>
service_unreachableerrorAPI endpoint not respondingCheck network, API URL
openclaw_config_not_foundinfo~/.openclaw/openclaw.json not foundOpenClaw may not be installed
workspace_mismatchwarning-w path differs from openclaw.json configured pathMay be intentional

alf login

Store an API key for the agent-life sync service.

Usage

alf login --key <api-key>

Flags

FlagShortRequiredDescription
--key-kNoAPI key to store. Without --key, attempts interactive login (not yet implemented).

JSON Output (success)

{
  "ok": true,
  "key_masked": "alf_sk_1...cdef",
  "config_path": "/home/user/.alf/config.toml"
}

JSON Output (error — interactive login)

{
  "ok": false,
  "error": "Interactive login not yet implemented. Use: alf login --key <your-api-key>",
  "hint": "Get an API key at https://agent-life.ai/settings/api-keys"
}

alf export

Export an agent's complete state from a framework workspace to an .alf archive.

Usage

alf export -r <runtime> -w <workspace> [-o <output>]

Flags

FlagShortRequiredDescription
--runtime-rYesopenclaw or zeroclaw
--workspace-wYesPath to the agent workspace directory
--output-oNoOutput file path (default: auto-generated in current directory)

JSON Output (success)

{
  "ok": true,
  "output": "/home/user/agent-export-2026-03-14.alf",
  "agent_name": "Atlas",
  "alf_version": "1.0.0-rc.1",
  "memory_records": 47,
  "file_size": 102400
}

alf sync

Incremental sync to the cloud. First sync uploads a full snapshot; subsequent syncs upload deltas.

Usage

alf sync -r <runtime> -w <workspace>

Flags

FlagShortRequiredDescription
--runtime-rYesopenclaw or zeroclaw
--workspace-wYesPath to the agent workspace directory

JSON Output (success — delta)

{
  "ok": true,
  "sequence": 5,
  "delta": true,
  "changes": { "creates": 2, "updates": 1, "deletes": 0 },
  "snapshot_path": "/home/user/.alf/state/a1b2c3d4-snapshot.alf",
  "no_changes": false
}

JSON Output (success — no changes)

{
  "ok": true,
  "sequence": 5,
  "delta": false,
  "changes": null,
  "snapshot_path": "/home/user/.alf/state/a1b2c3d4-snapshot.alf",
  "no_changes": true
}

JSON Output (error)

{
  "ok": false,
  "error": "Conflict: server has sequence 5, you sent base_sequence 3",
  "hint": "Run 'alf restore' to pull latest, then sync again"
}

Error Codes

CodeHTTPMeaningFix
conflict409Base sequence mismatchalf restore first, then sync again
unauthorized401Bad or revoked API keyalf login --key <new-key>
agent_limit402Subscription agent limit reachedUpgrade at agent-life.ai

alf restore

Download the latest snapshot (plus uncompacted deltas) from the service and import into a workspace.

Usage

alf restore -r <runtime> -w <workspace> [-a <agent-id>]

Flags

FlagShortRequiredDescription
--runtime-rYesopenclaw or zeroclaw
--workspace-wYesPath to the target workspace directory
--agent-aNoAgent ID. If omitted and exactly one agent is tracked locally, that agent is used.

JSON Output (success)

{
  "ok": true,
  "agent_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "agent_name": "Atlas",
  "sequence": 5,
  "runtime": "openclaw",
  "memory_records": 47,
  "workspace": "/home/user/.openclaw/workspace",
  "warnings": []
}

alf import

Import an .alf archive into a framework workspace.

Usage

alf import -r <runtime> -w <workspace> <alf-file>

Flags

FlagShortRequiredDescription
--runtime-rYesopenclaw or zeroclaw
--workspace-wYesPath to the target workspace directory

Positional Arguments

ArgumentDescription
<alf-file>Path to the .alf archive to import

JSON Output (success)

{
  "ok": true,
  "workspace": "/home/user/.openclaw/workspace",
  "agent_name": "Atlas",
  "memory_records": 47,
  "identity_imported": true,
  "principals_count": 1,
  "credentials_count": 3,
  "warnings": []
}

alf validate

Validate an .alf or .alf-delta file against the ALF JSON schemas.

Usage

alf validate <alf-file>

Positional Arguments

ArgumentDescription
<alf-file>Path to the .alf or .alf-delta archive to validate

JSON Output (success — valid)

{
  "ok": true,
  "valid": true,
  "errors": [],
  "warnings": []
}

JSON Output (success — validation findings)

{
  "ok": true,
  "valid": false,
  "errors": [
    { "path": "manifest.format_version", "message": "Missing required field" }
  ],
  "warnings": [
    { "path": "memory/2026-Q1.jsonl[3].memory_type", "message": "Unknown enum value: 'custom_type'" }
  ]
}

alf help

Show explorable help topics and environment status.

Usage

alf help [topic]

Topics

TopicDescription
(none)Overview: commands, file locations, current status summary
statusFull environment and service reachability (JSON by default)
filesDirectory layout and file locations
troubleshootCommon issues and fixes

The --json flag on alf help status is still accepted for backward compatibility but is a no-op (JSON is already the default).

JSON Output (alf help status)

{
  "config_path": "/home/user/.alf/config.toml",
  "config_exists": true,
  "api_key_set": true,
  "state_dir": "/home/user/.alf/state",
  "state_dir_exists": true,
  "service_reachable": true,
  "agents": [
    {
      "agent_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "last_synced_sequence": 5,
      "last_synced_at": "2026-03-14T10:30:00Z",
      "snapshot_exists": true
    }
  ],
  "agent_service_status": [
    {
      "agent_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "online": true,
      "name": "Atlas",
      "server_latest_sequence": 5,
      "error": null
    }
  ]
}

Error JSON

When any command fails, stdout contains a JSON error object:

{
  "ok": false,
  "error": "descriptive error message",
  "hint": "suggested fix or next step"
}

The hint field is omitted when there is no specific remediation to suggest. The same error is also written to stderr for human visibility.

Configuration

~/.alf/config.toml

[service]
api_url = "https://api.agent-life.ai"  # API endpoint
api_key = ""                            # Set via `alf login`

[defaults]
runtime = "openclaw"                    # Default --runtime value
workspace = ""                          # Set via alf check discovery or manually

Environment Variables

VariableUsed ByDescription
ALF_HUMANCLISet to 1 for human-readable output on stdout
ALF_INSTALL_DIRinstall.shOverride install directory
ALF_VERSIONinstall.shPin to a specific release tag
ALF_RELEASE_URLinstall.shOverride GitHub release base URL (for testing)
ALF_BACKUP_URLinstall.shOverride backup base URL (for testing)
ALF_QUIETinstall.shSet to 1 to suppress stderr progress

Install

curl -sSL https://agent-life.ai/install.sh | sh

The install script outputs JSON to stdout on completion:

{"ok":true,"version":"v0.2.0","installed_version":"alf 0.2.0","path":"/usr/local/bin/alf","checksum_verified":true}

Exit codes: 0 success, 2 unsupported platform, 3 download failed, 4 checksum mismatch, 5 post-install verification failed.

File Layout

~/.alf/
├── config.toml                         # API key, URL, defaults
└── state/
    ├── {agent_id}.toml                 # Sync cursor per agent
    └── {agent_id}-snapshot.alf         # Last snapshot (delta base)