@hamedb89/localghost 0.1.13 → 0.2.0

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
@@ -120,7 +120,9 @@ The plugin defaults to HTTP. Pass `https: true` only when Vite is expected to si
120
120
 
121
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
122
 
123
- ## Ghost Tunnel
123
+ ## Ghost Tunnel (Experimental)
124
+
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.
124
126
 
125
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.
126
128
 
@@ -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
 
@@ -9,21 +9,24 @@ localghost - friendly local hostnames for app repos
9
9
  ```sh
10
10
  localghost [--cwd path] [--dry-run]
11
11
  localghost init [--write-scripts] [--config file] [--host host] [--port port]
12
- localghost doctor
12
+ localghost doctor [--cwd path] [--config file] [--config-pattern regex] [--json]
13
13
  localghost setup [--project name] [--config file] [--config-pattern regex] [--https|--ssl]
14
+ localghost repair [--project name] [--config file] [--config-pattern regex] [--https|--ssl] [--trust] [--reallocate-port] [--prune-registry]
14
15
  localghost trust [--project name] [--config file] [--config-pattern regex] [--https|--ssl]
15
16
  localghost reset [--project name]
16
17
  localghost teardown [--project name] [--remove-caddyfile]
17
18
  localghost status [--ready] [--json]
18
19
  localghost ps [--json]
20
+ localghost guide [--agent] [--json]
19
21
  localghost tunnel [--cwd path] [--config file] [--config-pattern regex] [--ghost-config file] [--target-host host]
22
+ localghost release <patch|minor|major>
20
23
  localghost update [--json]
21
24
  localghost dev [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust]
22
25
  localghost run [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust] [--dynamic-port] -- command
23
26
  localghost print [--config file] [--config-pattern regex]
24
27
  ```
25
28
 
26
- 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. `--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.
29
+ 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
30
 
28
31
  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
32
 
@@ -69,13 +72,13 @@ Options:
69
72
 
70
73
  ### doctor
71
74
 
72
- Checks machine prerequisites.
75
+ Checks machine prerequisites, the configured project port, and Localghost registry state. Use `--json` for agent-readable output. The command reports occupied ports, stale leases, and duplicate allocations without changing state.
73
76
 
74
77
  ```sh
75
78
  localghost doctor
76
79
  ```
77
80
 
78
- Currently checks Caddy and prints `brew install caddy` when missing.
81
+ It checks Caddy and prints `brew install caddy` when missing.
79
82
 
80
83
  ### setup
81
84
 
@@ -95,11 +98,12 @@ localghost trust
95
98
 
96
99
  ### repair
97
100
 
98
- Reconciles the managed hosts block, regenerates and validates the Caddyfile, and refreshes project setup state. Use `--https --trust` to also re-run Caddy's local certificate trust step.
101
+ Reconciles the managed hosts block, regenerates and validates the Caddyfile, and refreshes project setup state. Use `--https --trust` to also re-run Caddy's local certificate trust step. `--reallocate-port` selects and remembers a stable available replacement for an occupied port without editing `.localghost`. `--prune-registry` removes expired or dead leases.
99
102
 
100
103
  ```sh
101
104
  localghost repair
102
105
  localghost repair --https --trust
106
+ localghost repair --reallocate-port --prune-registry
103
107
  ```
104
108
 
105
109
  ### teardown
@@ -136,7 +140,20 @@ localghost ps
136
140
  localghost ps --json
137
141
  ```
138
142
 
139
- ### tunnel
143
+ ### guide
144
+
145
+ Prints the recommended repository integration and command workflow. Use `--agent` for the coding-agent-oriented guide and `--json` for machine-readable integration hints.
146
+
147
+ ```sh
148
+ localghost guide --agent
149
+ localghost guide --agent --json
150
+ ```
151
+
152
+ 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.
153
+
154
+ ### tunnel (experimental)
155
+
156
+ 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
157
 
141
158
  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
159
 
@@ -154,6 +171,18 @@ Checks npm for a newer Localghost release. Pass `--json` for scripts and agents.
154
171
  localghost update
155
172
  ```
156
173
 
174
+ ### release
175
+
176
+ Dispatches the repository's guarded GitHub Actions release pipeline from `main`. The command requires an installed and authenticated GitHub CLI.
177
+
178
+ ```sh
179
+ localghost release patch
180
+ localghost release minor
181
+ localghost release major
182
+ ```
183
+
184
+ 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.
185
+
157
186
  ### routes
158
187
 
159
188
  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.13",
3
+ "version": "0.2.0",
4
4
  "description": "Friendly local hostnames for app repos with .localghost, Caddy, /etc/hosts, and Vite.",
5
5
  "type": "module",
6
6
  "bin": {