@gitterm/cli 0.0.6 → 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/README.md +43 -2
- package/dist/index.js +138770 -9170
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,42 @@ gitterm workspace pause <workspaceId>
|
|
|
27
27
|
gitterm workspace restart <workspaceId>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Remote sandboxes
|
|
31
|
+
|
|
32
|
+
Run builds, tests, and previews in a sandbox without a remote agent. Accounts live in
|
|
33
|
+
`~/.config/gitterm/sandbox.json`, which holds names only. Keys come from environment
|
|
34
|
+
variables:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"account": "e2b",
|
|
39
|
+
"accounts": {
|
|
40
|
+
"e2b": { "mode": "direct", "provider": "e2b", "apiKeyEnv": "E2B_API_KEY" },
|
|
41
|
+
"gitterm": { "mode": "managed" }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
gitterm sandbox account # selected mode, account, who is charged
|
|
48
|
+
gitterm sandbox create --lifetime 30
|
|
49
|
+
gitterm sandbox list # live sandboxes for the account
|
|
50
|
+
gitterm sandbox sync <id> # current checkout, including uncommitted changes
|
|
51
|
+
gitterm sandbox exec <id> "npm test" --wait 300
|
|
52
|
+
gitterm sandbox job <id> <jobId> --offset 0 --limit 65536
|
|
53
|
+
gitterm sandbox cancel <id> <jobId>
|
|
54
|
+
gitterm sandbox preview <id> 3000 --command "npm run dev" --serve
|
|
55
|
+
gitterm sandbox artifact <id> <jobId> dist/app.tar.gz
|
|
56
|
+
gitterm sandbox apply <id> <localPath> dist/app.tar.gz # checked against that job's snapshot
|
|
57
|
+
gitterm sandbox resume <id> # managed sandboxes paused for inactivity
|
|
58
|
+
gitterm sandbox destroy <id>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Add `--account <name>` to use another account. Direct accounts need no Gitterm login.
|
|
62
|
+
`exec` and `job` exit with the job's exit code when it fails (1 if it timed out or was
|
|
63
|
+
cancelled), so scripts and CI see the failure.
|
|
64
|
+
See [Agent sandboxes](../../docs/agent-sandboxes.md).
|
|
65
|
+
|
|
30
66
|
## Switching servers (hosted vs self-hosted)
|
|
31
67
|
|
|
32
68
|
By default the CLI talks to the hosted GitTerm API at `https://api.gitterm.dev`.
|
|
@@ -53,7 +89,7 @@ Env vars override the saved config (useful for CI or one-off commands):
|
|
|
53
89
|
|
|
54
90
|
```bash
|
|
55
91
|
export GITTERM_SERVER_URL=https://gitterm.example.com
|
|
56
|
-
export GITTERM_API_TOKEN=gt_... # from
|
|
92
|
+
export GITTERM_API_TOKEN=gt_... # from API tokens in the dashboard
|
|
57
93
|
|
|
58
94
|
gitterm auth status
|
|
59
95
|
gitterm workspace list
|
|
@@ -98,7 +134,7 @@ code, you approve the device in your browser, and the CLI receives a user API to
|
|
|
98
134
|
- Credentials are stored in `~/.config/gitterm/cli.json`
|
|
99
135
|
- The same token works with [`@gitterm/sdk`](https://www.npmjs.com/package/@gitterm/sdk)
|
|
100
136
|
and other GitTerm integrations
|
|
101
|
-
- Create revocable tokens
|
|
137
|
+
- Create revocable tokens under **API tokens** in the dashboard
|
|
102
138
|
and pass them via `GITTERM_API_TOKEN` (with optional `GITTERM_SERVER_URL`)
|
|
103
139
|
|
|
104
140
|
## Inside a GitTerm workspace
|
|
@@ -110,9 +146,14 @@ images. When those credentials are present, the CLI switches to a restricted com
|
|
|
110
146
|
gitterm workspace info
|
|
111
147
|
gitterm ports list
|
|
112
148
|
gitterm ports open 3000 --name app
|
|
149
|
+
gitterm ports open 8080 --name api --public
|
|
150
|
+
gitterm ports visibility 3000 public
|
|
113
151
|
gitterm ports close 3000
|
|
114
152
|
```
|
|
115
153
|
|
|
154
|
+
Ports are private by default: only your signed-in GitTerm browser session can reach the URL.
|
|
155
|
+
Public ports can be reached by anyone with the URL, which is what APIs and webhooks need.
|
|
156
|
+
|
|
116
157
|
No account commands are exposed in this mode. The workspace cannot list or operate on
|
|
117
158
|
other workspaces and cannot create a workspace. The CLI does not fall back to a saved user
|
|
118
159
|
login when any workspace identity variable is present.
|