@@ -104,14 +104,6 @@ If anything fails, use `hack logs --pretty` and summarize next steps.
104104
105105If the agent cannot run shell commands, use MCP instead: `hack setup mcp` and `hack mcp serve`.
106106
107- ### Initialize a repo (manual)
108- ```bash
109- cd /path/to/your-repo
110- hack init
111- hack up --detach
112- hack open
113- ```
114-
115107### Configuration (.hack/hack.config.json)
116108- `name`: project slug (also used for Docker Compose project name)
117109- `dev_host`: base hostname (`<dev_host >.hack`)
@@ -152,16 +144,16 @@ hack config set logs.snapshot_backend "compose"
152144
153145## Commands (high level)
154146
155- - **Global**: ` hack global install|up|down|status|logs|logs-reset|ca|cert|trust`
156- - **Project**: `hack init|up|down|restart|ps|run|logs|open|tui`
157- - **Config**: `hack config get|set`
158- - **Projects**: `hack projects|prune `
159- - **Status**: `hack status` (shortcut for `hack projects --details`)
160- - **Branch**: `hack branch add|list|remove|open `
161- - **Agents**: `hack setup cursor|claude|codex|agents|mcp`, `hack agent prime|init|patterns`, `hack mcp serve|install|print `
162- - **Diagnostics**: `hack doctor|daemon|log-pipe `
163- - **Secrets**: `hack secrets get|set|delete`
164- - **Crash override**: `hack the planet`
147+ Run `hack help` (or ` hack help < command >`) for full usage.
148+
149+ Common:
150+ - `hack global install|up|down `
151+ - `hack init|up|down|logs|open|tui`
152+ - `hack status `
153+ - `hack remote setup `
154+ - `hack gateway enable `
155+
156+ Full command table + flags: `docs/cli.md`.
165157
166158Run `hack help <command >` for detailed help.
167159
@@ -391,13 +383,16 @@ hack branch open feature-x
391383```
392384
393385
394- ## Service-to-service connections (DB/Redis)
386+ ## Service-to-service connections (HTTP vs DB/Redis)
395387
396388If your app runs in Docker (the default in `hack`), don’t connect to `127.0.0.1` / `localhost` for Postgres/Redis.
397389Inside a container, `localhost` is that container, not the other compose services.
398390
399- With CoreDNS enabled (`internal.dns: true`), containers can use the same `https://*.hack` URLs as your host.
400- If CoreDNS isn’t running (or you disable it), use the Compose service hostname on the default network:
391+ For HTTP services, use the same `https://*.hack` URLs you use on the host. `hack up` injects internal DNS,
392+ TLS trust, and `extra_hosts` mappings so `*.hack` resolves reliably inside containers. If you see `ENOTFOUND`
393+ inside containers, run `hack restart` to refresh the host mappings.
394+
395+ For non-HTTP services, use the Compose service hostname on the default network:
401396
402397- `Postgres: db:5432`
403398- `Redis: redis:6379`
@@ -489,7 +484,8 @@ hack up --project my-project
489484OAuth providers (notably Google) require `localhost` or a host that ends with a real public suffix.
490485
491486We keep `.hack` as the primary local dev domain, and optionally expose an alias domain for OAuth flows.
492- Default: `*.hack.gy` → `127.0.0.1` (via dnsmasq + OS resolver).
487+ If the OAuth alias is enabled, `hack global install` configures `*.hack.gy` to resolve to `127.0.0.1`
488+ via dnsmasq + the OS resolver.
493489
494490If you use Next.js (or another dev server that cares about dev origins), configure its dev allowlist to include the proxy domains.
495491Next.js supports `allowedDevOrigins` (wildcards supported) in `next.config.js`:
@@ -532,21 +528,16 @@ Use `--out <dir>` if you want certs written somewhere else.
532528
533529## Internal DNS (containers)
534530
535- `hack global install` runs CoreDNS on the `hack-dev` network and pins Caddy + CoreDNS to stable IPs.
536- CoreDNS answers `*.hack` and `*.hack.*` with Caddy’s IP so containers can use the same `https://*.hack`
537- URLs as the host. All other DNS is forwarded to Docker’s resolver.
531+ `hack global install` runs CoreDNS on the `hack-dev` network. CoreDNS answers `*.hack` and `*.hack.*` with
532+ Caddy’s current IP so containers can use the same `https://*.hack` URLs as the host.
533+
534+ Some runtimes don’t honor custom DNS for `*.hack` reliably, so `hack up` also injects `extra_hosts` mappings
535+ to the Caddy IP. If the Caddy IP changes, `hack status`, `hack doctor`, and the TUI show a warning; fix it
536+ with `hack restart` to refresh the mapping.
538537
539538When `internal.tls` is enabled, `hack up` mounts the Caddy Local CA into each container and sets common
540539SSL env vars so HTTPS to `*.hack` is trusted inside containers.
541540
542- If you created the `hack-dev` network before this feature, recreate it once so the static IPs can be
543- assigned (better runtime compatibility):
544-
545- ```bash
546- docker network rm hack-dev
547- hack global install
548- ```
549-
550541If you update `hack`, rerun `hack global install` once to refresh the CoreDNS config.
551542
552543
@@ -705,11 +696,12 @@ See examples:
705696
706697- Logs missing in Grafana: ensure Alloy is running (`hack global status`) and try `{app="docker"}` in Explore.
707698
708- - `ENOTFOUND` for `*.hack`/`*.hack.gy` inside containers: refresh CoreDNS config with `hack global install`,
709- then restart CoreDNS: `docker compose -f ~/.hack/caddy/docker-compose.yml restart coredns` .
699+ - `ENOTFOUND` for `*.hack` inside containers: run `hack restart` to refresh `extra_hosts` mappings (check
700+ `hack status` or the TUI for Caddy IP mismatch warnings) .
710701
711702- `EAI_AGAIN` for external domains inside containers (e.g. `api.clerk.com`): CoreDNS isn’t forwarding.
712- Run `hack global install` and restart CoreDNS as above.
703+ Run `hack global install` and restart CoreDNS:
704+ `docker compose -f ~/.hack/caddy/docker-compose.yml restart coredns`.
713705
714706- `hack global up` warns about `hack-dev` network labels or missing subnet: remove the network and reinstall:
715707 `docker network rm hack-dev` then `hack global install`.
0 commit comments