Skip to content

Commit 7da1cc2

Browse files
committed
Rewrite README for the v3 local-first product
1 parent 6774244 commit 7da1cc2

1 file changed

Lines changed: 164 additions & 88 deletions

File tree

README.md

Lines changed: 164 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -4,149 +4,225 @@
44

55
# Hack
66

7-
Hack is a local-first developer runtime for running repo environments cleanly on one machine.
7+
Hack is a local-first developer runtime for repo environments.
88

9-
Hack v3 narrows the product to the local core:
9+
It gives each project a predictable local runtime, stable HTTPS hostnames, resolved environment
10+
variables, persistent work sessions, diagnostics, and optional git-backed tickets without requiring a
11+
hosted Hack service.
1012

11-
- project init and runtime orchestration
12-
- stable local routing and TLS
13-
- env management and host/container env injection
14-
- persistent sessions
15-
- diagnostics and recovery
16-
- optional repo-local tickets
17-
- a slim macOS companion for local status, control, and logs
13+
## What Hack Does
1814

19-
Hack no longer treats hosted auth, the web dashboard, built-in GitHub workflows, or Linear sync as supported product surfaces.
15+
Hack is built for local development on machines that run many projects, branches, agents, and
16+
supporting services at the same time.
2017

21-
## Core workflow
18+
- Start and stop project runtimes with `hack up`, `hack down`, and `hack restart`.
19+
- Open stable local HTTPS URLs like `https://myapp.hack` with `hack open`.
20+
- Route service subdomains through local Caddy and trusted development TLS.
21+
- Resolve env overlays and secrets from `.hack/` and inject them into compose, host commands, and sessions.
22+
- Keep tmux-backed project workspaces alive with `hack session`.
23+
- Diagnose Docker, DNS, TLS, env, lifecycle, and stale runtime state with `hack doctor`.
24+
- Track optional repo-local work with `hack tickets`.
25+
- Use a slim macOS companion for local project status, controls, logs, and quick actions.
26+
27+
Hack v3 is intentionally self-contained. The supported product is the local CLI/runtime and macOS
28+
companion. Hosted auth, account/org/team management, the web dashboard, built-in GitHub workflows,
29+
and built-in Linear sync are not part of the v3 product.
30+
31+
## Install
32+
33+
Homebrew:
34+
35+
```bash
36+
brew tap hack-dance/tap
37+
brew install hack-dance/tap/hack
38+
```
39+
40+
Shell installer:
41+
42+
```bash
43+
curl -fsSL \
44+
https://github.com/hack-dance/hack/releases/latest/download/hack-install.sh \
45+
| bash
46+
```
47+
48+
Codex or managed container installer:
49+
50+
```bash
51+
curl -fsSL \
52+
https://github.com/hack-dance/hack/releases/latest/download/hack-codex-install.sh \
53+
| bash
54+
```
55+
56+
## Quick Start
57+
58+
Bootstrap the global local infrastructure once:
2259

2360
```bash
2461
hack global install
62+
```
63+
64+
Initialize a repo:
65+
66+
```bash
67+
cd /path/to/project
2568
hack init
69+
```
70+
71+
Run it:
72+
73+
```bash
2674
hack up --detach
2775
hack open
2876
hack logs --pretty
2977
```
3078

31-
Useful follow-ups:
79+
Stop it:
80+
81+
```bash
82+
hack down
83+
```
84+
85+
If anything looks wrong, start with:
3286

3387
```bash
34-
hack restart
3588
hack doctor
36-
hack session
37-
hack env list
38-
hack host exec --scope api -- bun test
39-
hack tickets list
89+
hack doctor --fix
4090
```
4191

42-
Portable envs and secrets:
92+
## Daily Commands
93+
94+
```bash
95+
hack status
96+
hack ps
97+
hack restart
98+
hack open
99+
hack logs --pretty
100+
hack logs <service>
101+
hack exec <service> -- bun test
102+
hack run <service> -- bun db:migrate
103+
```
43104

44-
- Commit `.hack/hack.env.default.yaml` and optional `.hack/hack.env.<overlay>.yaml`.
45-
- Keep `.hack.secret.key` out of git, or provide `HACK_ENV_SECRET_KEY` in CI and managed containers.
46-
- Linked git worktrees can reuse an existing checkout-family secret key when their local copy is missing.
47-
- Let Hack inject resolved env directly into runtime commands by default.
48-
- Materialize `.hack/.env` only when you explicitly need a compatibility file.
105+
Host-side commands can use the same resolved project env:
49106

50-
## What stays in v3
107+
```bash
108+
hack host exec --scope api -- bun test
109+
hack host shell --env qa --scope api
110+
```
51111

52-
- `hack init`
53-
- `hack up`, `hack down`, `hack restart`
54-
- `hack open`, `hack logs`, `hack ps`
55-
- `hack env`, `hack host exec`, `hack host shell`
56-
- `hack session`
57-
- `hack doctor`, `hack daemon`, `hack crash-capture`
58-
- `hack tickets`
59-
- macOS app for local project/global status and Ghostty-backed bottom logs panel
112+
Persistent workspaces:
60113

61-
## What was removed
114+
```bash
115+
hack session
116+
hack session start <project>
117+
hack session exec <workspace> "bun test"
118+
```
62119

63-
- hosted Hack auth and account/org/team management
64-
- built-in GitHub integration flows
65-
- built-in Linear integration flows
66-
- web dashboard and browser control plane
67-
- auth-broker service and hosted control-plane dependency
120+
Optional repo-local tickets:
68121

69-
Removed commands remain as compatibility stubs and print migration guidance.
122+
```bash
123+
hack tickets create --title "Fix lifecycle cleanup"
124+
hack tickets list
125+
hack tickets show T-00001
126+
hack tickets status T-00001 in_progress
127+
```
70128

71-
## Env model
129+
## Env And Secrets
72130

73-
Hack’s canonical env files live in `.hack/`:
131+
Hack uses YAML env files in `.hack/` as the source of truth:
74132

75-
- shared repo files:
76-
- `.hack/hack.env.default.yaml`
77-
- `.hack/hack.env.<overlay>.yaml`
78-
- worktree-local override files:
79-
- `.hack/hack.env.local.yaml`
80-
- `.hack/hack.env.<overlay>.local.yaml`
133+
```text
134+
.hack/hack.env.default.yaml
135+
.hack/hack.env.<overlay>.yaml
136+
.hack/hack.env.local.yaml
137+
.hack/hack.env.<overlay>.local.yaml
138+
```
81139

82-
Resolution order:
140+
Shared files can be committed. `*.local.yaml` files are worktree-local overrides.
83141

84-
1. shared default
85-
2. shared selected overlay
86-
3. worktree-local default
87-
4. worktree-local selected overlay
142+
Runtime commands read the YAML model directly. Use `hack env materialize` only when an external tool
143+
needs a compatibility `.hack/.env` file on disk.
88144

89-
Secrets use the project key provider. Key lookup order is:
145+
Secret key lookup is local-first:
90146

91147
1. current checkout `.hack.secret.key`
92148
2. shared key under the git common dir for linked worktrees
93149
3. `HACK_ENV_SECRET_KEY`
94150

95-
## Install
151+
Use `HACK_ENV_SECRET_KEY` in CI and managed containers instead of copying `.hack.secret.key` into an
152+
image.
96153

97-
Homebrew:
154+
Read more in [Env & secrets](./docs/env.md).
98155

99-
```bash
100-
brew tap hack-dance/tap
101-
brew install hack-dance/tap/hack
102-
```
156+
## Lifecycle Processes
103157

104-
Shell installer:
158+
Projects often need host-side setup before the compose stack starts: AWS SSO, SSM tunnels, local
159+
proxies, database forwards, or one-off bootstrap commands.
160+
161+
Put that work in `.hack/hack.config.json` under `lifecycle` or `startup` so Hack can run it
162+
consistently during `hack up` and clean up the processes it owns during `hack down`.
163+
164+
For fixed-port helpers, use `singleton.ports` and usually `onConflict: "adopt"` when an existing
165+
healthy listener set should be reused instead of starting duplicate tunnel stacks.
166+
167+
Read more in [Lifecycle](./docs/lifecycle.md).
168+
169+
## Portable Containers
170+
171+
Hack publishes runtime images to Docker Hub and GHCR.
105172

106173
```bash
107-
curl -fsSL \
108-
https://github.com/hack-dance/hack/releases/latest/download/hack-install.sh \
109-
| bash
174+
docker pull hackdance/hack:latest
175+
docker pull hackdance/hack:slim
110176
```
111177

112-
## Portable containers
178+
Use `hackdance/hack:latest` when you want the fuller runtime image with Docker CLI, compose, and
179+
remote-node support available.
113180

114-
Hack ships public runtime images on Docker Hub and GHCR:
181+
Use `hackdance/hack:slim` as a smaller base for Codex, CI, or managed containers where you want
182+
`hack`, Bun, env resolution, sessions, and tickets without the full host stack.
115183

116-
- full remote runtime: `hackdance/hack:latest`
117-
- slim portable base: `hackdance/hack:slim`
184+
For reproducible remote or managed environments, install project dependencies normally, install Hack,
185+
and pass `HACK_ENV_SECRET_KEY` at runtime so encrypted project env can be resolved.
118186

119-
Use the full image when you need the remote node runtime with bundled Docker CLI, compose, and
120-
gateway bootstrap. Use the slim image as a base for Codex, CI, or other managed containers where
121-
you want `hack`, Bun, and the local-first env/session/tickets workflows available without the full
122-
host stack.
187+
Start with [Codex managed environments](./docs/guides/codex-managed-environments.md) for a concrete
188+
setup guide.
123189

124-
For portable container setups, pass `HACK_ENV_SECRET_KEY` at runtime instead of copying
125-
`.hack.secret.key` into the image.
190+
## macOS Companion
126191

127-
The Codex-first managed-container example lives in [docs/guides/codex-managed-environments.md](./docs/guides/codex-managed-environments.md)
128-
and the mounted-project smoke harness lives at [scripts/portable-container-smoke.sh](./scripts/portable-container-smoke.sh).
192+
The macOS app is a thin local companion for Hack-managed projects.
129193

130-
## macOS app
131-
132-
The macOS app is a thin local companion. It keeps:
194+
It provides:
133195

134196
- project list and project detail
135-
- global and daemon status
136-
- start/stop/restart/open actions
137-
- log entrypoints
138-
- trust and doctor guidance
197+
- global runtime and daemon status
198+
- `up`, `down`, `restart`, and `open` actions
199+
- log entrypoints and a Ghostty-backed bottom panel
200+
- doctor and trust guidance
139201
- menu bar quick actions
140-
- the Ghostty-backed bottom panel for local logs and terminal output
141202

142-
## Experimental remote
203+
The CLI remains the source of truth. The app is there to make local runtime state easier to see and
204+
operate.
143205

144-
Remote, gateway, node, and dispatch remain in the repo as unsupported experimental surfaces. They are not part of the default v3 product story and are not release blockers unless they break the local core.
206+
## Documentation
145207

146-
## Docs
208+
Start here:
147209

210+
- [Core docs](./docs/core.md)
148211
- [CLI reference](./docs/cli.md)
149-
- [Environment model](./docs/env.md)
150-
- [Architecture](./docs/architecture.md)
212+
- [Initialize a project](./docs/guides/init-project.md)
213+
- [Env & secrets](./docs/env.md)
214+
- [Lifecycle](./docs/lifecycle.md)
151215
- [Sessions](./docs/sessions.md)
152216
- [Tickets](./docs/guides/tickets.md)
217+
- [Portable Codex environments](./docs/guides/codex-managed-environments.md)
218+
- [Architecture](./docs/architecture.md)
219+
220+
Reference and advanced material:
221+
222+
- [Docs index](./docs/README.md)
223+
- [Extensions and reference](./docs/reference.md)
224+
- [Integrations boundary](./docs/integrations.md)
225+
- [Unsupported experimental beta workflows](./docs/beta.md)
226+
227+
Remote, gateway, node, and dispatch commands remain source-available but unsupported experimental.
228+
They are not required for the default local development path.

0 commit comments

Comments
 (0)