@anyslate/cli
v0.1.0
Published
AnySlate CLI — lifecycle hooks + checkpoint / upload-artifact for AI memory capture. All hook subcommands submit to the Activity feed via the activity_submit MCP tool (Phase 14).
Downloads
130
Maintainers
Readme
@anyslate/cli
Thin lifecycle-hook + checkpoint client for the AnySlate AI Memory Layer.
All hook subcommands submit to your Activity feed via the activity_submit MCP tool (Phase 14). Low-risk same-session items auto-promote into canonical memory after a 30-second quiet period; ambiguous items wait for you to approve them in the desktop AI Memory → Activity panel.
Install
npm i -g @anyslate/cli
# or
npx @anyslate/cli --helpRequires Node ≥ 20.
Authenticate
Mint an MCP token in the desktop app at Settings → AI Memory → Connect, then:
anyslate login --token as_mcp_your_token_hereOr set environment variables:
export ANYSLATE_MCP_TOKEN=as_mcp_your_token_here
export ANYSLATE_API_URL=https://mcp.anyslate.io # optional
export ANYSLATE_HANDLE=h_xxx # optional, scope to one handleEnv vars override ~/.anyslate/cli.json.
Subcommands
anyslate hook <session-start|post-tool-use|stop> [--strict]
anyslate checkpoint --note "..." [--kind milestone] [--session <id>]
anyslate upload-artifact --session <id> --kind <kind> [--file <path>]
anyslate login --token <BEARER> [--handle <ID>] [--api-url <URL>]
anyslate version | helpanyslate hook ...
Reads JSON event payload from stdin (Claude Code lifecycle event format). Fails open by default — a network blip logs a warning to stderr and exits 0 so your Claude Code session continues. Pass --strict to opt into exit 1 on failure (useful in CI smoke tests).
hook session-start → topic_shift; hook stop → conversation_end; hook post-tool-use maps Edit/Write/MultiEdit → artifact_produced, Bash/Shell/Run → task_completed, everything else → topic_shift.
anyslate checkpoint
User-initiated, exits non-zero on failure. Defaults --kind milestone, --source api. Allowed kinds: topic_shift | decision_committed | task_completed | task_added | artifact_produced | milestone | conversation_end.
anyslate upload-artifact
Reads file or stdin, calls the upload_artifact MCP tool. Returns cloud://artifact/<id> on stdout. Allowed kinds: code_block | file_path | error_message | shell_command | config_snippet | url_reference | fenced_quote. 5 MB content cap.
anyslate login
Writes ~/.anyslate/cli.json with mode 0600. Idempotent — preserves the apiUrl/handle if you only update the token.
Wiring into Claude Code
See docs/AI_MEMORY_LAYER/GUIDE.md §6.5 for the full ~/.claude/settings.json block.
Tests
npm test
# 23 tests · node --test · no external depsLicense
MIT
