Appendix L: Rapid Reference
This appendix is the 50-most-useful commands and patterns quick reference — the condensed cheat sheet for practitioners who know the concepts but need to recall exact syntax. It covers gateway management, file operations as agent instructions, shell commands, Python quick patterns, cron expressions, web operations, messaging commands, agent management, debugging commands, file permissions, SOUL.md snippets, MEMORY.md entry templates, and error handling templates. If you forget everything else in this handbook, keep this appendix.
The format is intentionally terse — just the command or pattern with minimal context. This is a reference, not a tutorial. Each section is self-contained so you can find what you need without reading surrounding material. Commands are shown as they would appear in agent instructions (e.g., "Run: find /clawd -name '*.md' -newer /tmp/checkpoint") rather than in pure shell form.
The SOUL.md snippets section provides directly copy-able templates for common routing keywords (research, status, log expense, brief me), output preferences (WhatsApp plain text under 200 words, reports GitHub Markdown with H2 headers, data files JSON pretty-printed), and hard rules (never delete without confirmation, never send to third parties without review, always log to memory). The MEMORY.md templates section provides entry formats for routing decisions, operator preferences, system configuration, and known issues — consistent formatting that makes memory files scannable and searchable.
The error handling template provides a directly usable Python implementation with safe_operation function that wraps operations with logging, handles FileNotFoundError and PermissionError specifically, and returns a fallback value on failure. This is production-quality error handling in a single copy-able block.
Key Items
- **Gateway commands** — `openclaw gateway status/start/stop/restart` for lifecycle management; `tail -f ~/.openclaw/logs/gateway.log` for live log monitoring; restart required after openclaw.json changes
- **Python quick patterns** — JSON read/write with pathlib, CSV read with pandas, datetime formatting, file existence check, directory creation with `mkdir(parents=True, exist_ok=True)`; these are the most common Python operations in automation scripts
- **Cron expression patterns** — Daily at 7am UTC (`0 7 * * *`), weekdays at 7am CST (`0 13 * * 1-5`), every 2 hours (`0 */2 * * *`), every 15 minutes (`*/15 * * * *`), first of month (`0 0 1 * *`); covers the most common scheduling needs
- **File permissions quick reference** — Scripts 755, data files 644, secrets 600 with directory 700; `chmod 700 secrets/` must happen immediately when creating secrets directory
- **Error handling template** — `safe_operation(fn, description, fallback=None)` with FileNotFoundError, PermissionError, and generic Exception handling; production-quality error wrapping in one copy-able function
Related Concepts
- [[kelly-handbook-ch6-scheduling-and-cron]] for cron scheduling reference
- [[kelly-handbook-ch3-file-automation]] for file operations patterns
- [[kelly-handbook-ch2-architecture]] for context file structures
- [[karpathy-llm-wiki]] for the LLM wiki pattern this KB follows