@nimbus-sh/cli 0.1.8 → 0.1.10
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 +20 -19
- package/dist/commands/scaffold.js +7 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @nimbus-sh/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
cache
|
|
3
|
+
Scaffold a Nimbus Worker, mint and verify tokens, open sessions, and sync the
|
|
4
|
+
runtime cache.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
@@ -24,14 +24,16 @@ bun packages/cli/src/scaffold-bin.ts my-app
|
|
|
24
24
|
### `nimbus init [directory]`
|
|
25
25
|
|
|
26
26
|
Scaffolds a Nimbus-powered Workers project. `.` uses the current directory.
|
|
27
|
+
|
|
27
28
|
The generated app embeds the interactive Nimbus UI and enables the
|
|
28
|
-
authenticated remote sandbox API. Add
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
authenticated remote sandbox API. Add your own auth routes in `src/index.ts`
|
|
30
|
+
before you mint user tokens from the backend.
|
|
31
|
+
|
|
32
|
+
The app also carries the session agent UI. To configure Cloudflare OAuth and
|
|
33
|
+
Workers AI, add the non-secret `NIMBUS_CF_OAUTH_CLIENT_ID`,
|
|
32
34
|
`NIMBUS_CF_OAUTH_SCOPES`, `NIMBUS_AGENT_MODEL`, and
|
|
33
|
-
`NIMBUS_AGENT_GATEWAY_ID` vars
|
|
34
|
-
|
|
35
|
+
`NIMBUS_AGENT_GATEWAY_ID` vars. Then store `NIMBUS_AGENT_COOKIE_SECRET` with
|
|
36
|
+
`wrangler secret put`.
|
|
35
37
|
|
|
36
38
|
```bash
|
|
37
39
|
nimbus init my-nimbus
|
|
@@ -116,9 +118,8 @@ Exit codes: 0 success, 65 token-validation failure, 78 env missing.
|
|
|
116
118
|
|
|
117
119
|
### `nimbus runtime sync`
|
|
118
120
|
|
|
119
|
-
Uploads runtime blobs
|
|
120
|
-
|
|
121
|
-
runtime cache operations.
|
|
121
|
+
Uploads runtime blobs and manifests, then updates the runtime catalog. This
|
|
122
|
+
is the user-facing path for the Python, Ruby, and clang runtime caches.
|
|
122
123
|
|
|
123
124
|
```bash
|
|
124
125
|
CLOUDFLARE_ACCOUNT_ID=<id> nimbus runtime sync --bucket nimbus-runtime-cache-public clang
|
|
@@ -152,12 +153,12 @@ NIMBUS_TOKEN=<jwt-with-session-create> \
|
|
|
152
153
|
nimbus session new
|
|
153
154
|
```
|
|
154
155
|
|
|
155
|
-
The token is sent only as an `Authorization: Bearer` header
|
|
156
|
-
appears in any URL. The printed attach URL is the server's redirect
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
The token is sent only as an `Authorization: Bearer` header. It never
|
|
157
|
+
appears in any URL. The printed attach URL is the server's redirect Location
|
|
158
|
+
verbatim. On enforced deployments that URL carries a short-lived (90 s),
|
|
159
|
+
single-use bootstrap token pinned to the new session. Opening it once sets
|
|
160
|
+
the session cookie and redirects to the clean `/s/<id>/` URL. Reusing it
|
|
161
|
+
returns 401.
|
|
161
162
|
|
|
162
163
|
## Programmatic use
|
|
163
164
|
|
|
@@ -167,8 +168,8 @@ Every verb is also exported as a function:
|
|
|
167
168
|
import { mintToken, syncRuntimes, scaffold } from '@nimbus-sh/cli';
|
|
168
169
|
```
|
|
169
170
|
|
|
170
|
-
`mintToken(argv)` and
|
|
171
|
-
code
|
|
171
|
+
`mintToken(argv)` and its siblings return a Promise<number>, the process exit
|
|
172
|
+
code. They write to `process.stdout` and `process.stderr` directly.
|
|
172
173
|
|
|
173
174
|
## Engines
|
|
174
175
|
|
|
@@ -174,10 +174,14 @@ function renderWranglerJsonc(name) {
|
|
|
174
174
|
},
|
|
175
175
|
|
|
176
176
|
"durable_objects": {
|
|
177
|
-
"bindings": [
|
|
177
|
+
"bindings": [
|
|
178
|
+
{ "name": "NIMBUS_SESSION", "class_name": "NimbusSession" },
|
|
179
|
+
{ "name": "NIMBUS_PUBLIC_DIRECTORY", "class_name": "NimbusPublicDirectory" }
|
|
180
|
+
]
|
|
178
181
|
},
|
|
179
182
|
"migrations": [
|
|
180
|
-
{ "tag": "nimbus-v1", "new_sqlite_classes": ["NimbusSession"] }
|
|
183
|
+
{ "tag": "nimbus-v1", "new_sqlite_classes": ["NimbusSession"] },
|
|
184
|
+
{ "tag": "nimbus-v2", "new_sqlite_classes": ["NimbusPublicDirectory"] }
|
|
181
185
|
],
|
|
182
186
|
|
|
183
187
|
"worker_loaders": [{ "binding": "LOADER" }],
|
|
@@ -210,6 +214,7 @@ import { defineNimbusConfig } from '@nimbus-sh/config';
|
|
|
210
214
|
// auto-populate loopback bindings (env.SUPERVISOR, etc.).
|
|
211
215
|
export {
|
|
212
216
|
NimbusSession,
|
|
217
|
+
NimbusPublicDirectory,
|
|
213
218
|
SupervisorRPC,
|
|
214
219
|
NimbusAssetsRPC,
|
|
215
220
|
NimbusLoaderRPC,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-sh/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Nimbus CLI — `create-nimbus-app` scaffolder + `token mint` + `runtime sync`.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsc -p tsconfig.json --noCheck --noEmit false --declaration true --declarationMap true --outDir dist --rootDir src && chmod +x dist/bin.js dist/scaffold-bin.js",
|
|
44
|
-
"prepack": "
|
|
44
|
+
"prepack": "bun run build",
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@nimbus-sh/sdk": "^0.
|
|
49
|
-
"@nimbus-sh/worker": "^0.
|
|
48
|
+
"@nimbus-sh/sdk": "^0.7.0",
|
|
49
|
+
"@nimbus-sh/worker": "^0.8.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=20"
|