@kaynooo/cli-stack 0.7.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -19
- package/dist/cli.js +525 -621
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# stack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A stable host port per service name for Claude Code, the same on every machine.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
bun install -g @kaynooo/cli-stack
|
|
@@ -11,22 +11,5 @@ bun install -g @kaynooo/cli-stack
|
|
|
11
11
|
| Command | What it does |
|
|
12
12
|
| --- | --- |
|
|
13
13
|
| `stack port <name>` | prints the port the name always hashes to (32-bit FNV-1a, 1024-32767), so a service keeps the same port on every machine |
|
|
14
|
-
| `stack audit [dir]` | cross-checks `release.config.ts` in `dir` (the current directory) against the compose files it syncs |
|
|
15
14
|
|
|
16
|
-
`stack port` takes `--min` and `--max` to change the range: the default stops below 32768, where Linux starts handing out ephemeral ports, `--min` refuses anything under 1024, and `--max` goes up to 65535. The hash used to lose precision past 2^53 and the range ran to 65535, so every name now maps to a different port than before; a port already written in a compose file keeps working, only a newly picked one comes out different. When something on this machine already listens on the port it says so on stderr; the number is still printed and the exit code stays 0. `--json` prints `{name, port, listening}`.
|
|
17
|
-
|
|
18
|
-
## Audit
|
|
19
|
-
|
|
20
|
-
The checks, in the order they are reported:
|
|
21
|
-
|
|
22
|
-
- `sync` and `build`: every `deploySyncFiles` entry, `sourceDir`, `buildContext`, `dockerfile` and buildSecret `src` (a leading `~` is the home directory) exists, and a buildSecret `env` is set in the shell.
|
|
23
|
-
- `compose`: `docker compose config` succeeds on the base file and on each overlay merged over it. The base is the shortest compose file name among `deploySyncFiles`.
|
|
24
|
-
- `env`: every `${VAR}`, `${VAR:?msg}` or bare `$VAR` without a default is in `requiredServerEnv`, and every listed key is referenced; the `$${VAR}` escape and commented lines are skipped.
|
|
25
|
-
- `version`: each `versionEnv` is interpolated by a compose file, and each `*_VERSION` a compose file interpolates is declared by a release.
|
|
26
|
-
- `image`, `restart` and `post-deploy`: services the config names exist, and registry images are built by a release.
|
|
27
|
-
- `health` and `routing`: restarted services have a healthcheck, ports and traefik labels live in overlays, and `composeArgs` does not drop them.
|
|
28
|
-
- `layout`, `nuxt` and `gitignore`: bind mounts appear in the base file's header, `NUXT_*` variables match the runtime config, and `.release-logs` and `.release-worktrees` are ignored.
|
|
29
|
-
|
|
30
|
-
Exit codes: 0 no error (warnings allowed), 1 at least one error, 2 no `release.config.ts`. `--json` prints `{ root, composeFiles, findings }` where a finding is `{ level, check, message }`.
|
|
31
|
-
|
|
32
|
-
It needs docker for `docker compose config`. When the package `release.config.ts` imports `defineConfig` from is not installed, a stand-in that returns its argument is used.
|
|
15
|
+
`stack port` takes `--min` and `--max` to change the range: the default stops below 32768, where Linux starts handing out ephemeral ports, `--min` refuses anything under 1024, and `--max` goes up to 65535; a `--min` at or past the default top, given alone, spreads up to 65535. The hash used to lose precision past 2^53 and the range ran to 65535, so every name now maps to a different port than before; a port already written in a compose file keeps working, only a newly picked one comes out different. When something on this machine already listens on the port it says so on stderr; the number is still printed and the exit code stays 0. `--json` prints `{name, port, listening}`.
|