|
| 1 | +# Managed Codex Containers |
| 2 | + |
| 3 | +This guide is for managed Codex or CI-style containers where you control a repo checkout and setup script, |
| 4 | +but do not control the host machine or a long-lived Docker Desktop style environment. |
| 5 | + |
| 6 | +Use this path when: |
| 7 | + |
| 8 | +- the container is ephemeral or cache-backed |
| 9 | +- you only have a setup script and optional maintenance script |
| 10 | +- `hack global install` is too heavy or not applicable |
| 11 | +- you want tickets, integrations, docs, and repo-local CLI workflows without the full local host stack |
| 12 | + |
| 13 | +## What slim mode does |
| 14 | + |
| 15 | +Slim mode is enabled by setting `HACK_EXECUTION_MODE=codex` or `HACK_EXECUTION_MODE=slim`. |
| 16 | + |
| 17 | +It is designed to skip machine-level Hack surfaces: |
| 18 | + |
| 19 | +- Caddy |
| 20 | +- CoreDNS |
| 21 | +- Loki |
| 22 | +- Grafana |
| 23 | +- local CA and TLS bootstrap |
| 24 | +- Docker event watching in `hackd` |
| 25 | + |
| 26 | +This mode is intentionally not a substitute for a full local workstation setup. |
| 27 | + |
| 28 | +## Install from a release |
| 29 | + |
| 30 | +Run this in your managed Codex setup script: |
| 31 | + |
| 32 | +```bash |
| 33 | +curl -fsSL \ |
| 34 | + https://github.com/hack-dance/hack/releases/latest/download/hack-codex-install.sh \ |
| 35 | + | bash |
| 36 | +``` |
| 37 | + |
| 38 | +The installer downloads the latest Hack release tarball, installs the binary into `~/.hack/bin`, |
| 39 | +and writes a thin `hack` wrapper with these defaults: |
| 40 | + |
| 41 | +- `HACK_EXECUTION_MODE=codex` |
| 42 | +- `HACK_DAEMON_DISABLE_DOCKER_EVENTS=1` |
| 43 | +- `HACK_SETUP_SYNC_MODE=warn` |
| 44 | + |
| 45 | +## Recommended setup script |
| 46 | + |
| 47 | +```bash |
| 48 | +set -euo pipefail |
| 49 | + |
| 50 | +mise install bun@1.3.5 |
| 51 | +export PATH="$HOME/.local/share/mise/shims:$PATH" |
| 52 | + |
| 53 | +bun install |
| 54 | +curl -fsSL \ |
| 55 | + https://github.com/hack-dance/hack/releases/latest/download/hack-codex-install.sh \ |
| 56 | + | bash |
| 57 | +``` |
| 58 | + |
| 59 | +## Recommended maintenance script |
| 60 | + |
| 61 | +```bash |
| 62 | +set -euo pipefail |
| 63 | + |
| 64 | +export PATH="$HOME/.local/share/mise/shims:$PATH" |
| 65 | +bun install --frozen-lockfile || bun install |
| 66 | +``` |
| 67 | + |
| 68 | +If you are developing inside the Hack repo itself, the repo-local helpers are still available: |
| 69 | + |
| 70 | +```bash |
| 71 | +bash scripts/install-codex-slim.sh |
| 72 | +bash scripts/maintain-codex-slim.sh |
| 73 | +``` |
| 74 | + |
| 75 | +## Good fit for slim mode |
| 76 | + |
| 77 | +- `hack tickets` |
| 78 | +- `hack linear` |
| 79 | +- `hack x github` |
| 80 | +- repo-local docs, specs, and agent setup |
| 81 | +- command and config surfaces that do not require the machine-wide runtime stack |
| 82 | + |
| 83 | +## Not available in slim mode |
| 84 | + |
| 85 | +- `hack global install` |
| 86 | +- `hack global up` |
| 87 | +- `hack global status` |
| 88 | +- `hack global logs` |
| 89 | +- explicit Loki-backed log paths such as `hack logs --loki` |
| 90 | + |
| 91 | +When you need full remote runtime orchestration instead of repo-local agent workflows, use the |
| 92 | +[remote node container image](remote-node-container.md) instead. |
0 commit comments