docs: add `portal update` and `portal version` documentation
- getting-started: add "Updating the CLI" section after installation - cli-reference: document `portal update` and `portal version` commands - cli-reference: add update hint in installation section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Yechan Kim committed
Apr 16, 2026 at 20:05 UTC
9b29c61bc1a36b5525b24ccfe05307b3b083e9f6
2 files changed
+57
-1
docs/src/routes/cli-reference/+page.md
+41
-1
@@ -30,7 +30,7 @@ If your relay publishes its own installer:
30
curl -sSL https://portal.example.com/install.sh | bash
31
```
32
33
-The installer downloads the `portal` binary and adds it to your PATH. No configuration file is written.
33
+The installer downloads the `portal` binary and adds it to your PATH. No configuration file is written. Already installed? Run `portal update` to get the latest version.
34
35
## Commands
36
@@ -136,6 +136,46 @@ portal list [flags]
136
137
Unlike `portal expose`, `portal list` does not run the relay discovery expansion loop. It only resolves the registry seed list plus explicit `--relays` values.
138
139
+### `portal update`
140
+
141
+Update the CLI binary to the latest release.
142
+
143
+```bash
144
+portal update
145
+```
146
+
147
+The update flow:
148
+
149
+1. Checks the latest version by resolving the GitHub releases redirect URL
150
+2. Compares with the currently installed version
151
+3. If a newer version exists: downloads the binary, verifies its SHA256 checksum, and replaces the current executable
152
+4. If already up to date: prints a message and exits
153
+
154
+No flags. Works on macOS, Linux, and Windows. Requires write access to the directory containing the `portal` binary.
155
+
156
+**Examples:**
157
+
158
+```bash
159
+# Update to the latest version
160
+portal update
161
+# Already up to date (v2.1.5).
162
+
163
+# Or when a new version is available:
164
+portal update
165
+# Updating v2.1.5 → v2.2.0 ...
166
+# Updated v2.1.5 → v2.2.0
167
+```
168
+
169
+### `portal version`
170
+
171
+Print the currently installed version.
172
+
173
+```bash
174
+portal version
175
+```
176
+
177
+No flags. Outputs the version string (e.g., `v2.1.5`) and exits.
178
+
179
## Behavior Notes
180
181
- **Identity persistence** - `portal expose` loads or creates a signing identity at `identity.json` (or `--identity-path`). Reusing the same path keeps the same address across runs.
docs/src/routes/getting-started/+page.md
+16
@@ -30,6 +30,22 @@ irm https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1
30
31
The installer downloads the `portal` binary and places it in your PATH. No configuration file is created — Portal works out of the box.
32
33
+## Updating the CLI
34
+
35
+Already have Portal installed? Update to the latest version with a single command:
36
+
37
+```bash
38
+portal update
39
+```
40
+
41
+Portal checks for the latest GitHub release, downloads the new binary, verifies its SHA256 checksum, and replaces the current executable in place. If you're already on the latest version, it simply reports that no update is needed.
42
+
43
+You can check the currently installed version at any time:
44
+
45
+```bash
46
+portal version
47
+```
48
+
49
## Expose Your First App
50
51
Start a local application (or use any existing one), then run: