gitterm 0.0.1
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 +117 -0
- package/dist/index.js +10371 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# gitterm
|
|
2
|
+
|
|
3
|
+
A lightweight tunnel agent that securely exposes **local development ports** through your **gitterm.dev** workspace URL.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Run directly with npx (recommended)
|
|
9
|
+
npx gitterm
|
|
10
|
+
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g gitterm
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### 1. Login to GitTerm
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx gitterm login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This will open a browser for authentication. Once logged in, your credentials are saved locally.
|
|
24
|
+
|
|
25
|
+
### 2. Connect Your Local Server
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Start your local server first
|
|
29
|
+
opencode serve --port 3000 # or whatever starts your server on port 3000
|
|
30
|
+
|
|
31
|
+
# Then connect it to your gitterm workspace
|
|
32
|
+
npx gitterm tunnel --workspace-id "your-workspace-id" --port 3000
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
That's it! Your local server is now accessible at `https://your-subdomain.gitterm.dev`.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### `login`
|
|
40
|
+
|
|
41
|
+
Sign in via device-code flow.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx gitterm login
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `logout`
|
|
48
|
+
|
|
49
|
+
Clear saved credentials.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx gitterm logout
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `connect`
|
|
56
|
+
|
|
57
|
+
Connect a local port to your gitterm workspace.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx gitterm connect --workspace-id <id> --port <number>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Required options:**
|
|
64
|
+
|
|
65
|
+
- `--workspace-id <id>` - Your workspace ID
|
|
66
|
+
- `--port <number>` - Local port to expose
|
|
67
|
+
|
|
68
|
+
**Optional:**
|
|
69
|
+
|
|
70
|
+
- `--expose <name=port>` - Expose additional ports (repeatable)
|
|
71
|
+
- `--ws-url <url>` - Custom tunnel proxy URL (default: wss://tunnel.gitterm.dev/tunnel/connect)
|
|
72
|
+
- `--server-url <url>` - Custom API server URL (default: https://api.gitterm.dev)
|
|
73
|
+
- `--token <jwt>` - Tunnel JWT (overrides saved login)
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
### Basic Usage
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Expose a local dev server
|
|
81
|
+
npx gitterm connect --workspace-id "ws_abc123" --port 3000
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Multiple Ports
|
|
85
|
+
|
|
86
|
+
Expose additional services as subdomains:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx gitterm connect \
|
|
90
|
+
--workspace-id "ws_abc123" \
|
|
91
|
+
--port 3000 \
|
|
92
|
+
--expose api=3001 \
|
|
93
|
+
--expose docs=4000
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This maps:
|
|
97
|
+
|
|
98
|
+
- `https://your-subdomain.gitterm.dev` -> `localhost:3000`
|
|
99
|
+
- `https://your-subdomain-api.gitterm.dev` -> `localhost:3001`
|
|
100
|
+
- `https://your-subdomain-docs.gitterm.dev` -> `localhost:4000`
|
|
101
|
+
|
|
102
|
+
## How It Works
|
|
103
|
+
|
|
104
|
+
1. The agent opens an outbound WebSocket connection to the GitTerm tunnel proxy
|
|
105
|
+
2. Authenticates using your saved credentials or a provided JWT
|
|
106
|
+
3. Proxies HTTP requests from your `*.gitterm.dev` URL to your local port
|
|
107
|
+
4. Supports streaming responses (SSE, WebSocket upgrades coming soon)
|
|
108
|
+
|
|
109
|
+
## Notes
|
|
110
|
+
|
|
111
|
+
- This tool does **not** start servers for you. Run your local server first, then connect.
|
|
112
|
+
- Credentials are stored in `~/.config/gitterm/cli.json`
|
|
113
|
+
- The tunnel stays open until you press Ctrl+C
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT
|