You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
- make OAuth alias hosts the automatic browser-facing default when OAuth
is enabled
- add project-level `open.prefer` and one-shot `hack open --prefer
<auto|alias|dev>` controls
- apply the preference consistently to service shorthand,
linked-worktree branch URLs, and `hack branch open`
- preserve explicit URLs and fully qualified hostnames exactly as
entered
- update generated config/schema, CLI reference, docs, and agent
guidance
## Why
Projects that enable OAuth need browser-facing `.hack.gy` aliases for
callbacks and shared cookie domains, while `dev_host` should remain the
stable primary routing identity. Previously `hack open` always returned
the primary `.hack` host, forcing applications and agents to reconstruct
or redirect to the alias themselves.
## User impact
With the default `open.prefer: auto`, `hack open` now opens the alias
whenever `oauth.enabled` is true and falls back to the dev host
otherwise. Users can pin either behavior in project config or override
one invocation. Container-to-container traffic remains on Compose DNS.
## Validation
- `bun run check`
- `bunx tsc -p packages/cli/tsconfig.json --noEmit`
- `bun run build`
- focused unit/documentation tests: 34 passed
- `bun tests/e2e/run.ts --only=worktree-branch-default`
- full unit suite: 915 passed, 5 skipped; the sole failure is the
existing sandbox-only `ps` EPERM in `daemon-command.test.ts`
- full local E2E: 8 scenarios passed; lifecycle process-table scenario
is likewise sandbox-blocked by `ps`
## Release signal
Feature change; publish as a minor release.
Copy file name to clipboardExpand all lines: .codex/skills/hack-cli/SKILL.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ Use `hack` as the primary interface for local-first development.
12
12
13
13
## Integration freshness
14
14
15
-
- These instructions were generated by hack CLI v3.3.6; treat cached rules from another version as potentially stale.
15
+
- These instructions were generated by hack CLI v3.4.1; treat cached rules from another version as potentially stale.
16
16
- At session start, audit project and global integrations with `hack setup sync --all-scopes --check`.
17
17
- If anything is stale, missing, or deprecated, run `hack setup sync --all-scopes`, then reload the agent session so cached instructions are replaced.
18
18
- Never copy or hand-edit generated Hack rules to refresh them; update the CLI and run the sync command.
19
-
- Content revision: `64098e5ae1ea` (version alone is not a freshness guarantee).
19
+
- Content revision: `902b04fe1469` (version alone is not a freshness guarantee).
20
20
21
21
## Product boundary
22
22
@@ -52,6 +52,7 @@ Use `hack` as the primary interface for local-first development.
52
52
- Primary host comes from `dev_host` (default: `<project>.hack`).
53
53
- Subdomain pattern is `<sub>.<dev_host>` (for example: `api.myapp.hack`).
54
54
- OAuth alias (when enabled) also routes `<dev_host>.<tld>` and `<sub>.<dev_host>.<tld>` (default tld: `gy`).
55
+
- Browser launches automatically prefer a routed OAuth alias when enabled; custom development hosts outside `.hack` stay on the primary host. Set `open.prefer` or pass `hack open --prefer <auto|alias|dev>` to override.
55
56
- Not every compose service is routable: only services with Caddy labels and on `hack-dev` are exposed.
56
57
- Required labels for HTTP services: `caddy`, `caddy.reverse_proxy`, `caddy.tls=internal`.
57
58
- Quick checks: `hack open`, `hack open <sub>`, `hack open --json`.
@@ -70,7 +71,7 @@ Use `hack` as the primary interface for local-first development.
70
71
- Source-of-truth files: `.hack/docker-compose.yml`, `.hack/hack.config.json`, `.hack/hack.env.default.yaml`, and optional `.hack/hack.env.<overlay>.yaml`.
71
72
- Worktree-local env override files: `.hack/hack.env.local.yaml` and `.hack/hack.env.<overlay>.local.yaml`.
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
74
+
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.internal/compose.runtime.override.yml`, `.hack/.branch/compose.<branch>.override.yml`, `.hack/.branch/compose.<branch>.runtime.override.yml`.
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
@@ -104,7 +105,7 @@ Use `hack` as the primary interface for local-first development.
104
105
- Command inside an already-running service container: `hack exec <service> -- <cmd...>`.
105
106
- Host script that needs hack-stored env: `hack host exec --env <overlay> --scope <service> -- <cmd...>` — this is THE way to run repo scripts; never read .env files directly.
-Call a service over HTTP (from the host or between containers): use its Caddy hostname `https://<sub>.<dev_host>`; discover routable URLs with `hack open --json`.
108
+
-Browser/host URL: use `hack open <service> --json` (OAuth aliases are preferred when enabled). Container-to-container traffic should use Compose DNS.
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
37
+
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.internal/compose.runtime.override.yml`, `.hack/.branch/compose.<branch>.override.yml`, `.hack/.branch/compose.<branch>.runtime.override.yml`.
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
@@ -61,7 +61,7 @@ Prefer `hack` when shell access is available. Use MCP only when shell access is
61
61
- Command inside an already-running service container: `hack exec <service> -- <cmd...>`.
62
62
- Host script that needs hack-stored env: `hack host exec --env <overlay> --scope <service> -- <cmd...>` — this is THE way to run repo scripts; never read .env files directly.
- Call a service over HTTP (from the host or between containers): use its Caddy hostname `https://<sub>.<dev_host>`; discover routable URLs with `hack open --json`.
64
+
- Browser/host URL: use `hack open <service> --json` (OAuth aliases are preferred when enabled). Container-to-container traffic should use Compose DNS.
- Primary host comes from `dev_host` (default: `<project>.hack`).
246
246
- Subdomain pattern is `<sub>.<dev_host>` (for example: `api.myapp.hack`).
247
247
- OAuth alias (when enabled) also routes `<dev_host>.<tld>` and `<sub>.<dev_host>.<tld>` (default tld: `gy`).
248
+
- Browser launches automatically prefer a routed OAuth alias when enabled; custom development hosts outside `.hack` stay on the primary host. Set `open.prefer` or pass `hack open --prefer <auto|alias|dev>` to override.
248
249
- Not every compose service is routable: only services with Caddy labels and on `hack-dev` are exposed.
249
250
- Required labels for HTTP services: `caddy`, `caddy.reverse_proxy`, `caddy.tls=internal`.
250
251
- Quick checks: `hack open`, `hack open <sub>`, `hack open --json`.
@@ -261,7 +262,7 @@ Project files (managed vs generated):
261
262
- Source-of-truth files: `.hack/docker-compose.yml`, `.hack/hack.config.json`, `.hack/hack.env.default.yaml`, and optional `.hack/hack.env.<overlay>.yaml`.
262
263
- Worktree-local env override files: `.hack/hack.env.local.yaml` and `.hack/hack.env.<overlay>.local.yaml`.
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
265
+
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.internal/compose.runtime.override.yml`, `.hack/.branch/compose.<branch>.override.yml`, `.hack/.branch/compose.<branch>.runtime.override.yml`.
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
@@ -291,7 +292,7 @@ Running things (decision guide):
291
292
- Command inside an already-running service container: `hack exec <service> -- <cmd...>`.
292
293
- Host script that needs hack-stored env: `hack host exec --env <overlay> --scope <service> -- <cmd...>` — this is THE way to run repo scripts; never read .env files directly.
-Call a service over HTTP (from the host or between containers): use its Caddy hostname `https://<sub>.<dev_host>`; discover routable URLs with `hack open --json`.
295
+
-Browser/host URL: use `hack open <service> --json` (OAuth aliases are preferred when enabled). Container-to-container traffic should use Compose DNS.
- Primary host comes from `dev_host` (default: `<project>.hack`).
116
116
- Subdomain pattern is `<sub>.<dev_host>` (for example: `api.myapp.hack`).
117
117
- OAuth alias (when enabled) also routes `<dev_host>.<tld>` and `<sub>.<dev_host>.<tld>` (default tld: `gy`).
118
+
- Browser launches automatically prefer a routed OAuth alias when enabled; custom development hosts outside `.hack` stay on the primary host. Set `open.prefer` or pass `hack open --prefer <auto|alias|dev>` to override.
118
119
- Not every compose service is routable: only services with Caddy labels and on `hack-dev` are exposed.
119
120
- Required labels for HTTP services: `caddy`, `caddy.reverse_proxy`, `caddy.tls=internal`.
120
121
- Quick checks: `hack open`, `hack open <sub>`, `hack open --json`.
@@ -131,7 +132,7 @@ Project files (managed vs generated):
131
132
- Source-of-truth files: `.hack/docker-compose.yml`, `.hack/hack.config.json`, `.hack/hack.env.default.yaml`, and optional `.hack/hack.env.<overlay>.yaml`.
132
133
- Worktree-local env override files: `.hack/hack.env.local.yaml` and `.hack/hack.env.<overlay>.local.yaml`.
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
135
+
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.internal/compose.runtime.override.yml`, `.hack/.branch/compose.<branch>.override.yml`, `.hack/.branch/compose.<branch>.runtime.override.yml`.
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
@@ -161,7 +162,7 @@ Running things (decision guide):
161
162
- Command inside an already-running service container: `hack exec <service> -- <cmd...>`.
162
163
- Host script that needs hack-stored env: `hack host exec --env <overlay> --scope <service> -- <cmd...>` — this is THE way to run repo scripts; never read .env files directly.
-Call a service over HTTP (from the host or between containers): use its Caddy hostname `https://<sub>.<dev_host>`; discover routable URLs with `hack open --json`.
165
+
-Browser/host URL: use `hack open <service> --json` (OAuth aliases are preferred when enabled). Container-to-container traffic should use Compose DNS.
0 commit comments