@hamedb89/localghost 0.1.12 → 0.1.15

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/docs/flows.md CHANGED
@@ -5,13 +5,16 @@
5
5
  As a developer, I want Localghost to be a drop-in dev dependency so I can add friendly local hostnames without rebuilding the same Caddy and hosts setup in every repo.
6
6
 
7
7
  ```sh
8
+ npm install -D @hamedb89/localghost
9
+ pnpm add -D @hamedb89/localghost
8
10
  yarn add -D @hamedb89/localghost
11
+ bun add -d @hamedb89/localghost
9
12
  ```
10
13
 
11
- Then initialize the project contract:
14
+ Choose the install command for the repository's package manager. Then initialize the project contract:
12
15
 
13
16
  ```sh
14
- yarn localghost init --write-scripts
17
+ localghost init --write-scripts
15
18
  ```
16
19
 
17
20
  ## Project Contract
@@ -32,7 +35,7 @@ api.app.localhost 8787
32
35
  As a developer, I want to know whether my laptop is ready before Localghost changes system files.
33
36
 
34
37
  ```sh
35
- yarn localghost doctor
38
+ localghost doctor
36
39
  ```
37
40
 
38
41
  Localghost checks for Caddy and prints the exact install command when it is missing. It does not run Homebrew automatically.
@@ -42,8 +45,8 @@ Localghost checks for Caddy and prints the exact install command when it is miss
42
45
  As a developer, I want to know when Localghost itself is stale without paying for a network check on every run.
43
46
 
44
47
  ```sh
45
- yarn localghost update
46
- LOCALGHOST_NO_UPDATE_CHECK=1 yarn localghost doctor
48
+ localghost update
49
+ LOCALGHOST_NO_UPDATE_CHECK=1 localghost doctor
47
50
  ```
48
51
 
49
52
  Localghost checks npm after successful commands, caches the result for 24 hours, and ignores check failures. `LOCALGHOST_NO_UPDATE_CHECK=1` and `--no-update-check` disable the automatic check.
@@ -53,7 +56,7 @@ Localghost checks npm after successful commands, caches the result for 24 hours,
53
56
  As a developer, I want one explicit setup command that updates only the managed Localghost block in `/etc/hosts` and validates Caddy.
54
57
 
55
58
  ```sh
56
- yarn localghost:setup
59
+ localghost setup
57
60
  ```
58
61
 
59
62
  ## Daily Dev
@@ -61,8 +64,8 @@ yarn localghost:setup
61
64
  As a developer, I want a daily command that starts the local HTTP proxy from the same config file, with local HTTPS available only when I ask for it.
62
65
 
63
66
  ```sh
64
- yarn localghost:ready
65
- yarn localghost:proxy
67
+ localghost status --ready
68
+ localghost dev
66
69
  ```
67
70
 
68
71
  Most repos will run this next to their app server, for example Vite on `127.0.0.1:5173`.
@@ -70,7 +73,7 @@ Most repos will run this next to their app server, for example Vite on `127.0.0.
70
73
  When a repo really needs local certificates:
71
74
 
72
75
  ```sh
73
- yarn localghost:proxy:https
76
+ localghost dev --https
74
77
  ```
75
78
 
76
79
  ## Config Discovery
@@ -78,9 +81,9 @@ yarn localghost:proxy:https
78
81
  As a developer, I want Localghost to fit repos that already have naming conventions without hidden file searches.
79
82
 
80
83
  ```sh
81
- yarn localghost print --config .localghost.preview
82
- yarn localghost print --config .localghost.private --config .localghost
83
- yarn localghost print --config-pattern '^\.localghost\.(private|preview)$'
84
+ localghost print --config .localghost.preview
85
+ localghost print --config .localghost.private --config .localghost
86
+ localghost print --config-pattern '^\.localghost\.(private|preview)$'
84
87
  ```
85
88
 
86
89
  Localghost uses the first existing configured file. Regex discovery scans filenames in the project root.
@@ -90,7 +93,7 @@ Localghost uses the first existing configured file. Regex discovery scans filena
90
93
  As a developer, I want to see the local domain layer as a simple `domain -> upstream` map.
91
94
 
92
95
  ```sh
93
- yarn localghost routes
96
+ localghost routes
94
97
  ```
95
98
 
96
99
  ```txt
@@ -115,9 +118,11 @@ export default {
115
118
 
116
119
  The plugin defaults to HTTP. Pass `https: true` only when Vite is expected to sit behind a Caddy HTTPS proxy. Localghost prints URLs but does not open browser tabs.
117
120
 
118
- If `.localghost` is missing, an interactive `yarn dev` asks whether to create it, asks for the primary `.localhost` domain, allows extra domains, explains the `/etc/hosts` password prompt, and runs setup when confirmed. Non-interactive runs fail with the exact setup command instead of guessing.
121
+ If `.localghost` is missing, an interactive development run asks whether to create it, asks for the primary `.localhost` domain, allows extra domains, explains the `/etc/hosts` password prompt, and runs setup when confirmed. Non-interactive runs fail with the exact setup command instead of guessing.
122
+
123
+ ## Ghost Tunnel (Experimental)
119
124
 
120
- ## Ghost Tunnel
125
+ Ghost Tunnel is an experimental opt-in feature. Its configuration, transports, CLI behavior, and public APIs may change between releases and should not be used for production-critical access.
121
126
 
122
127
  As a production app, I want one opt-in flag that makes `<route>-<project>-<owner>.ghost.<domain>` a known product entrypoint on top of the deployed Vite app, without running local Caddy or requiring the local `.localghost` file.
123
128
 
@@ -141,8 +146,8 @@ When `ghostTunnel` is configured, route and Vite startup logs print the producti
141
146
  As a developer, I want to retest setup without deleting my project config.
142
147
 
143
148
  ```sh
144
- yarn localghost reset
145
- yarn localghost setup
149
+ localghost reset
150
+ localghost setup
146
151
  ```
147
152
 
148
153
  `reset` removes only the managed hosts block, generated Caddyfile, and setup state. It leaves `.localghost` in place.
@@ -152,8 +157,8 @@ yarn localghost setup
152
157
  As a developer, I want to cleanly remove Localghost from a project when the repo is archived or no longer needs friendly hostnames.
153
158
 
154
159
  ```sh
155
- yarn localghost teardown
156
- yarn localghost teardown --remove-caddyfile
160
+ localghost teardown
161
+ localghost teardown --remove-caddyfile
157
162
  ```
158
163
 
159
164
  `teardown` removes only the Localghost managed `/etc/hosts` block. The generated Caddyfile is kept unless `--remove-caddyfile` is passed.
@@ -163,8 +168,8 @@ yarn localghost teardown --remove-caddyfile
163
168
  As a developer or agent, I want to see what Localghost changed without reading system files directly.
164
169
 
165
170
  ```sh
166
- yarn localghost status
167
- yarn localghost status --json
171
+ localghost status
172
+ localghost status --json
168
173
  ```
169
174
 
170
175
  Localghost records setup and teardown in `ops/local/localghost-state.json`. That file is project-local state, not OS temp state.
@@ -174,9 +179,9 @@ Localghost records setup and teardown in `ops/local/localghost-state.json`. That
174
179
  As a Codex or agent user, I want commands that are inspectable and scriptable without opening a browser.
175
180
 
176
181
  ```sh
177
- yarn localghost print
178
- yarn localghost doctor
179
- yarn localghost update
182
+ localghost print
183
+ localghost doctor
184
+ localghost update
180
185
  ```
181
186
 
182
187
  The CLI reference lives in [localghost(1)](./localghost.1.md). Future flows can add MCP helpers and repo templates, but the base package should remain a small, predictable CLI.
@@ -1,4 +1,7 @@
1
- # Ghost Tunnel
1
+ # Ghost Tunnel (Experimental)
2
+
3
+ > [!WARNING]
4
+ > Ghost Tunnel is experimental. Its configuration, transport protocol, CLI behavior, and public APIs may change between releases. Do not rely on it for production-critical access. Review authentication, exposed routes, Redis credentials, and network reachability before sharing a tunnel.
2
5
 
3
6
  Ghost Tunnel is the production-facing Localghost entrypoint for apps that want a stable wildcard route on top of their existing Vite product:
4
7
 
package/docs/github.md CHANGED
@@ -4,11 +4,11 @@ Use this copy for the GitHub repo About box, topics, and social cards. Keep it s
4
4
 
5
5
  ## Repository Description
6
6
 
7
- Friendly local hostnames for app repos. Install the dev dependency, run `yarn dev`, and get clean `.localhost` URLs with Caddy and Vite-safe hosts.
7
+ Friendly local hostnames for app repos. Install with npm, pnpm, Yarn, or Bun and get clean `.localhost` URLs with Caddy and Vite-safe hosts.
8
8
 
9
9
  Shorter alternative:
10
10
 
11
- Friendly local hostnames for app repos. `yarn add -D`, `yarn dev`, ready.
11
+ Friendly local hostnames for app repos. Add the package, run `localghost`, ready.
12
12
 
13
13
  ## Topics
14
14
 
@@ -62,7 +62,7 @@ After creating `hamedb89/localghost`, this sets the public repo metadata:
62
62
 
63
63
  ```sh
64
64
  gh repo edit hamedb89/localghost \
65
- --description "Friendly local hostnames for app repos. Install the dev dependency, run yarn dev, and get clean .localhost URLs with Caddy and Vite-safe hosts." \
65
+ --description "Friendly local hostnames for app repos. Install with npm, pnpm, Yarn, or Bun and get clean .localhost URLs with Caddy and Vite-safe hosts." \
66
66
  --homepage "https://hamedb89.github.io/localghost/" \
67
67
  --add-topic localhost \
68
68
  --add-topic local-development \
@@ -81,7 +81,7 @@ gh repo edit hamedb89/localghost \
81
81
  The first visible paragraph should make the entrypoint feel obvious before it gets into configuration:
82
82
 
83
83
  ```txt
84
- Localghost is a tiny Node.js CLI for friendly local domains in app repos. Add it as a dev dependency, run `yarn dev`, and use `http://app.localhost/` instead of remembering which localhost port belongs to which process.
84
+ Localghost is a tiny Node.js CLI for friendly local domains in app repos. Add it with your package manager, run `localghost`, and use `http://app.localhost/` instead of remembering which localhost port belongs to which process.
85
85
  ```
86
86
 
87
87
  Then the next docs layer can explain `.localghost`, Caddy, `/etc/hosts`, Vite `allowedHosts`, and configuration options.
@@ -16,22 +16,24 @@ localghost reset [--project name]
16
16
  localghost teardown [--project name] [--remove-caddyfile]
17
17
  localghost status [--ready] [--json]
18
18
  localghost ps [--json]
19
+ localghost guide [--agent] [--json]
19
20
  localghost tunnel [--cwd path] [--config file] [--config-pattern regex] [--ghost-config file] [--target-host host]
21
+ localghost release <patch|minor|major>
20
22
  localghost update [--json]
21
23
  localghost dev [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust]
22
24
  localghost run [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust] [--dynamic-port] -- command
23
25
  localghost print [--config file] [--config-pattern regex]
24
26
  ```
25
27
 
26
- With no subcommand, Localghost detects the package manager from `packageManager` or a lockfile, prefers a non-recursive `dev:raw` script, falls back to `dev`, and runs the result through the normal Caddy lifecycle. `--dry-run` prints the detected command without checking or changing machine setup. Set `command: ["pnpm", "dev:web"]` in `localghost.config.mjs` when inference should be explicit.
28
+ With no subcommand, Localghost detects npm, pnpm, Yarn, or Bun from `packageManager` or a lockfile, prefers a non-recursive `dev:raw` script, falls back to `dev`, and runs the result through the normal Caddy lifecycle. Supported runtime flags such as `--https`, `--clean-caddy`, `--auto-repair`, and `--dynamic-port` are forwarded to that lifecycle. `--dry-run` prints the detected command without checking or changing machine setup. Set `command: ["<package-manager>", "dev:web"]` in `localghost.config.mjs` when inference should be explicit.
27
29
 
28
30
  For multiple independently started applications, configure `services` in `localghost.config.mjs`. Each service declares a unique name and host plus its project-relative working directory, requested port, and optional command. Bare `localghost` starts one Caddy process and all service commands, passes service-specific `LOCALGHOST_PORT`, `VITE_PORT`, and `LOCALGHOST_SERVICE` variables, and stops the group when any process exits.
29
31
 
30
32
  ```js
31
33
  export default {
32
34
  services: [
33
- { name: "web", cwd: "apps/web", host: "xyz.localhost", port: 5173, command: ["pnpm", "dev"] },
34
- { name: "api", cwd: "apps/api", host: "api.xyz.localhost", port: 8787, command: ["pnpm", "dev"] }
35
+ { name: "web", cwd: "apps/web", host: "xyz.localhost", port: 5173 },
36
+ { name: "api", cwd: "apps/api", host: "api.xyz.localhost", port: 8787 }
35
37
  ]
36
38
  };
37
39
  ```
@@ -63,7 +65,7 @@ Options:
63
65
  - `--port <number>`: primary app port.
64
66
  - `--api-host <host>`: API hostname.
65
67
  - `--api-port <number>`: API port.
66
- - `--package-manager <npm|yarn|pnpm>`: package manager for suggested commands.
68
+ - `--package-manager <npm|pnpm|yarn|bun>`: package manager for suggested commands.
67
69
  - `--write-scripts`: add Localghost scripts to `package.json`.
68
70
  - `--force`: overwrite an existing config file.
69
71
 
@@ -136,7 +138,20 @@ localghost ps
136
138
  localghost ps --json
137
139
  ```
138
140
 
139
- ### tunnel
141
+ ### guide
142
+
143
+ Prints the recommended repository integration and command workflow. Use `--agent` for the coding-agent-oriented guide and `--json` for machine-readable integration hints.
144
+
145
+ ```sh
146
+ localghost guide --agent
147
+ localghost guide --agent --json
148
+ ```
149
+
150
+ Localghost stores remembered project and instance port assignments in `~/.localghost`. Only Localghost-managed processes are represented there; unrelated processes are still checked by the operating system when a port is selected.
151
+
152
+ ### tunnel (experimental)
153
+
154
+ Ghost Tunnel is experimental. Its configuration, transport protocol, CLI behavior, and public APIs may change between releases; do not rely on it for production-critical access.
140
155
 
141
156
  Runs the local Ghost Tunnel agent for `ghostTunnel.transport: "tunnel"`. The command reads the Localghost project config, reads exact public hosts from `.ghosttunnel`, sends route heartbeats to the configured Redis REST store, polls for queued requests, and serves them from the matching local port.
142
157
 
@@ -154,6 +169,18 @@ Checks npm for a newer Localghost release. Pass `--json` for scripts and agents.
154
169
  localghost update
155
170
  ```
156
171
 
172
+ ### release
173
+
174
+ Dispatches the repository's guarded GitHub Actions release pipeline from `main`. The command requires an installed and authenticated GitHub CLI.
175
+
176
+ ```sh
177
+ localghost release patch
178
+ localghost release minor
179
+ localghost release major
180
+ ```
181
+
182
+ The pipeline synchronizes version metadata, runs package and runtime verification, creates the version commit and tag, publishes npm with provenance, and creates generated GitHub release notes.
183
+
157
184
  ### routes
158
185
 
159
186
  Prints the local domain layer as `domain -> upstream` routes. HTTP is the default. Pass `--https` or `--ssl` if the browser-facing domain should be shown as HTTPS.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hamedb89/localghost",
3
- "version": "0.1.12",
3
+ "version": "0.1.15",
4
4
  "description": "Friendly local hostnames for app repos with .localghost, Caddy, /etc/hosts, and Vite.",
5
5
  "type": "module",
6
6
  "bin": {