uplink-cli 0.1.21 → 0.1.22

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.
@@ -3,6 +3,19 @@ import { join } from "path";
3
3
  import { apiRequest } from "../../http";
4
4
 
5
5
  export async function createAndStartTunnel(port: number): Promise<string> {
6
+ // Check if tunnel already running on this port
7
+ const existing = findTunnelClients().filter(c => c.port === port);
8
+ if (existing.length > 0) {
9
+ return [
10
+ `⚠ Tunnel already running on port ${port}`,
11
+ ``,
12
+ `→ PID: ${existing[0].pid}`,
13
+ `→ Token: ${existing[0].token.substring(0, 8)}...`,
14
+ ``,
15
+ `Use "Stop Tunnel" first to disconnect the existing tunnel.`,
16
+ ].join("\n");
17
+ }
18
+
6
19
  const result = await apiRequest("POST", "/v1/tunnels", { port });
7
20
  const url = result.url || "(no url)";
8
21
  const token = result.token || "(no token)";
@@ -1339,6 +1339,19 @@ export const menuCommand = new Command("menu")
1339
1339
  });
1340
1340
 
1341
1341
  async function createAndStartTunnel(port: number): Promise<string> {
1342
+ // Check if tunnel already running on this port
1343
+ const existing = findTunnelClients().filter(c => c.port === port);
1344
+ if (existing.length > 0) {
1345
+ return [
1346
+ `⚠ Tunnel already running on port ${port}`,
1347
+ ``,
1348
+ `→ PID: ${existing[0].pid}`,
1349
+ `→ Token: ${existing[0].token.substring(0, 8)}...`,
1350
+ ``,
1351
+ `Use "Stop Tunnel" first to disconnect the existing tunnel.`,
1352
+ ].join("\n");
1353
+ }
1354
+
1342
1355
  // Create tunnel
1343
1356
  const result = await apiRequest("POST", "/v1/tunnels", { port });
1344
1357
  const url = result.url || "(no url)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uplink-cli",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Expose localhost to the internet in seconds. Interactive terminal UI, permanent custom domains, zero config. A modern ngrok alternative.",
5
5
  "keywords": [
6
6
  "tunnel",