src/octopal/contains the main Python package: CLI, channels, gateway, memory, policy, providers, Octo runtime, scheduler, WhatsApp/Telegram integrations, workers, and shared utilities.webapp/holds the Vite-based dashboard frontend.src/contains app code anddist/contains built assets.tests/contains the pytest suite for CLI, dashboard, runtime, worker orchestration, memory, and channel behavior.scripts/contains setup and maintenance helpers such as bootstrap and worker-template sync utilities.docker/contains container assets, including the worker image Dockerfile.data/is runtime state storage for SQLite, metrics, auth state, and logs; avoid committing generated contents.workspace/is the default Octo/worker workspace and scratch area.workspace_templates/contains bootstrap content copied into new workspaces.docs/stores additional project documentation.
uv syncinstalls the project and dev dependencies for day-to-day development.python -m venv .venvandpip install -e .[dev]are the non-uveditable setup path.uv run octopal configureruns the interactive configuration wizard and bootstraps missing workspace files.uv run octopal config show [--reveal-secrets]prints the effective config for inspection, anduv run octopal config migratewrites the current.env-backed settings intoconfig.json.uv run octopal startstarts Octopal in background mode.uv run octopal start --foregroundruns the Octo and gateway in the foreground.uv run octopal stop,uv run octopal restart, anduv run octopal statusmanage the local runtime.uv run octopal updateapplies the latest release update flow for an existing install.uv run octopal logsprintsdata/logs/octopal.log, anduv run octopal logs --followtails it.uv run octopal gatewaystarts the FastAPI gateway directly.uv run octopal dashboard --onceprints one dashboard snapshot;uv run octopal dashboard --watchruns the live terminal dashboard;uv run octopal dashboard --jsonemits a machine-readable snapshot;--compactand--last <N>tune terminal output.uv run octopal workers listshows registered workers, their current status, and the current task when available.uv run octopal connector status [--json]checks connector authorization/readiness after connector setup flows;uv run octopal connector auth <name>anduv run octopal connector disconnect <name> [--forget-credentials]handle CLI-based connector auth maintenance.uv run octopal sync-worker-templates --overwriterefreshes default worker templates intoworkspace/workers.uv run octopal memory statsanduv run octopal memory cleanup [--keep-days <days>] [--keep-count <count>] [--dry-run]cover common memory maintenance flows.uv run octopal whatsapp install-bridge,uv run octopal whatsapp link [--timeout <seconds>],uv run octopal whatsapp status, anduv run octopal whatsapp logoutmanage the WhatsApp bridge lifecycle.uv run octopal tools resolve [--profile <name>] [--preset all|octo] [--available-only] [--json]explains which tools are available and why others are blocked.uv run octopal skill list,uv run octopal skill install <source>,uv run octopal skill update <skill-id>,uv run octopal skill verify <skill-id>,uv run octopal skill enable <skill-id>,uv run octopal skill disable <skill-id>,uv run octopal skill trust <skill-id>,uv run octopal skill untrust <skill-id>,uv run octopal skill prepare-env <skill-id>,uv run octopal skill remove-env <skill-id>, anduv run octopal skill remove <skill-id>cover the installed skill workflow.uv run octopal build-worker-image --tag octopal-worker:latestbuilds the Docker worker image.uv run pytestruns the test suite.uv run ruff check .,uv run black --check ., anduv run mypy srcare the configured lint/format/type-check commands.npm installandnpm run buildfromwebapp/build the dashboard bundle manually when needed.
- Python code lives under
src/with imports rooted atoctopal. - Use 4-space indentation, type hints on new or changed Python code, and descriptive module names.
- Follow the configured tooling in
pyproject.toml: Black for formatting, Ruff for linting/import order, and MyPy for type checks. - Keep CLI entrypoints in
src/octopal/cli/and group related runtime code under focused packages such asgateway/,memory/,octo/, andworkers/. - Frontend code in
webapp/src/should stay TypeScript-first and match the existing Vite/Tailwind setup.
- Add Python tests under
tests/usingtest_<module>.pynaming. - Prefer focused pytest coverage near the behavior you change, especially for CLI flows, runtime safety checks, worker orchestration, and dashboard APIs.
- Run
uv run pytestbefore finishing substantial changes. For frontend-only changes, also runnpm run buildinwebapp/. - When you add new tooling or test workflows, update this file and
README.md. - GitHub releases use date-based versioning in
src/octopal/_version.pyand tags likevYYYY.MM.DDorvYYYY.MM.DD.N.
- Use concise, imperative commit subjects such as
update AGENTS guideorharden worker status recovery. - Keep commits scoped to one logical change when practical.
- PRs should include a short description, linked issue if relevant, and logs or screenshots for user-facing CLI/dashboard changes.
- Use
uv run octopal configureto manage the primaryconfig.jsonsettings. - Connector setup is CLI-first: enable services in
uv run octopal configure, runuv run octopal connector auth <name>, checkuv run octopal connector status, then restart Octopal if the CLI asks for it. - If Docker CLI/daemon or the worker image is unavailable, Octopal may temporarily fall back to
same_env; verify the effective launcher inuv run octopal statusor the dashboard and treat it as a local-development fallback, not the preferred isolation mode. - Tailscale Integration: Managed in the
gatewaysection ofconfig.jsonviatailscale_auto_serve(boolean) andtailscale_ips(comma-separated string). - Important settings include channel credentials, provider API keys, dashboard protection, and the storage paths in
config.json. - Treat
data/, WhatsApp auth state, and generated workspace files as local runtime artifacts unless the repo explicitly needs fixtures.
- The Octo can invoke
octo_context_resetto compact or reset overloaded chat context. - Preferred default is
mode=softwith structured handoff fields:goal_now,done,open_threads,critical_constraints, andnext_step. - Persist reset artifacts in workspace memory:
memory/handoff.md,memory/handoff.jsonmemory/context-audit.md,memory/context-audit.jsonl
- Confirmation is required when:
mode=hardconfidence < 0.7- repeated resets occur without progress (
N=2)
- After reset, force a wake-up choice (
continue / clarify / replan) before major actions.