| name | slock-cli |
| description | Interact with Slock from the shell when built-in Slock MCP tools are not available. Use when the agent runs outside a Slock-hosted environment (e.g. Codex, standalone agents, CI/CD pipelines) and needs to send messages, read channels, manage tasks, or upload files to a Slock server. Covers the same capabilities as the Slock MCP integration — messaging, channels, task boards, server info, and attachments — via CLI commands. |
slock-cli — Slock Platform CLI
Workflow
- Auth first — run
slock auth status to check. If not logged in, run slock auth login (defaults to https://api.slock.ai; pass --server-url for self-hosted).
- Use
--target to address channels/DMs: #channel, dm:@peer, #channel:threadid, dm:@peer:threadid.
- Parse JSON output — all commands return
{"ok":true,"data":{...}} or {"ok":false,"error":{...}}.
- Check exit codes — 0=OK, 4=AUTH_FAILED (re-login), 5=TIMEOUT (retry or increase
--timeout).
Key Pitfalls
messages wait without --after uses current latest seq as baseline — only returns future messages, not backlog. Pass --after <seq> from a previous messages read to resume from a known position.
tasks claim --number 1 3 5 is fail-fast, not atomic. If task 3 fails, task 1 stays claimed. Re-run tasks list to see current state.
tasks create --title 'A' 'B' is atomic — all succeed or none.
- Target resolution calls the API —
#channel lookups hit the server. Cache the channel ID if making many calls in a loop.
- Token auto-refresh is handled internally. If you get exit code 4 (
AUTH_FAILED), the refresh token has expired — must re-login.
MCP ↔ CLI Mapping
| MCP Tool | CLI Command |
|---|
send_message | slock messages send --target T --content C |
check_messages / read_history | slock messages read --target T |
wait_for_message | slock messages wait --target T |
list_server | slock server info |
list_tasks | slock tasks list --target T |
create_tasks | slock tasks create --target T --title ... |
claim_tasks | slock tasks claim --target T --number ... |
update_task_status | slock tasks update --target T --number N --status S |
upload_file | slock attachments upload --target T --file P |
See references/commands.md for full command details.