@groundfloorcloud/cli 0.1.13 → 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.
Files changed (3) hide show
  1. package/README.md +66 -11
  2. package/dist/index.js +1167 -824
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -45,6 +45,18 @@ gf coderunner ls
45
45
  gf deploy
46
46
  ```
47
47
 
48
+ Non-interactive use (CI, containers): set `GROUNDFLOOR_TOKEN` to a Control
49
+ Plane JWT. It takes precedence over the saved `gf login` session (an expired
50
+ `GROUNDFLOOR_TOKEN` is ignored when a saved session exists, so a stale export
51
+ does not shadow it). Mint one from an M2M client:
52
+
53
+ ```bash
54
+ export GROUNDFLOOR_TOKEN="$(gf m2m token)" # needs GROUNDFLOOR_M2M_CLIENT_ID / _SECRET
55
+ export GROUNDFLOOR_WORKSPACE_ID=<workspace-id>
56
+ # non-production cells also need GROUNDFLOOR_API_URL
57
+ gf coderunner ls
58
+ ```
59
+
48
60
  Use the session from a shell or script:
49
61
 
50
62
  ```bash
@@ -81,7 +93,7 @@ key. `gf coderunner vault-token` is deprecated.
81
93
  gf deploy
82
94
  gf deploy --git https://github.com/me/my-fn.git --ref main
83
95
  gf deploy --name my-fn --runtime python --cpu 250m --memory 256Mi \
84
- -e API_KEY=secret
96
+ -e LOG_LEVEL=debug
85
97
  gf deploy --workload-type service
86
98
  gf deploy --workload-type schedule --schedule "*/5 * * * *"
87
99
  gf deploy --app-id <app-uuid>
@@ -93,6 +105,33 @@ How the target is chosen:
93
105
  - Otherwise the name comes from `--name`, then `groundfloor.json`, then the
94
106
  folder or repo name. A matching slug is reused; otherwise a new coderunner
95
107
  is created.
108
+ - `--app-id` applies only when a **new** coderunner is created. When an
109
+ existing one is reused or `-c` is given, it is ignored and `gf deploy` warns.
110
+
111
+ Deploy target safety:
112
+
113
+ - The workspace comes from `-w`, `GROUNDFLOOR_WORKSPACE_ID`, or the saved
114
+ machine-wide default (`gf workspaces use`). The saved default is shared by
115
+ every shell on the machine, so it is never used silently: without an
116
+ interactive terminal `gf deploy` refuses and asks for `-w <workspace-id>`;
117
+ on a terminal it prints the workspace name and id and asks to confirm.
118
+ `-w` and `GROUNDFLOOR_WORKSPACE_ID` deploy without that prompt.
119
+ - Reusing a same-named coderunner prints its name, id and environment and asks
120
+ to confirm. Without a terminal, pass `-y/--yes`.
121
+ - Check the printed coderunner id and URL after the deploy; an unexpected new
122
+ id means it went somewhere you did not intend.
123
+
124
+ **Redeploys and env vars.** The platform stores only the env var *names* of a
125
+ deployment, never the values. A redeploy that does not resend a variable
126
+ (`-e`, or `groundfloor.json` `env`) drops it from the new deployment. `gf
127
+ deploy` warns about previously-set keys that are not being resent. Resend every
128
+ variable you need on each deploy.
129
+
130
+ **Secrets at runtime.** Do not rely on `--secret` to pass secrets into a
131
+ deployment. Read them at runtime with an M2M client that has `secrets:read`
132
+ (`gf m2m token`, then `GET /v1/workspaces/{id}/secrets`). `--secret NAME`
133
+ injection only works where the platform has secret injection enabled, which is
134
+ currently not the case; the server rejects it with a 422 otherwise.
96
135
 
97
136
  Runtime is auto-detected when omitted (`package.json` → node,
98
137
  `requirements.txt` / `pyproject.toml` → python), defaulting to python.
@@ -135,7 +174,13 @@ wrong identity for testing Coderunner Vault/Files as the workload.
135
174
 
136
175
  | Flag | Description |
137
176
  |------|-------------|
138
- | `-w, --workspace <id>` | Workspace override (else `gf workspaces use`). |
177
+ | `-w, --workspace <id>` | Target workspace. Required without a terminal unless `GROUNDFLOOR_WORKSPACE_ID` is set; the saved default needs an interactive confirm. |
178
+ | `-n, --name <name>` | Coderunner name (else `groundfloor.json`, then folder name). |
179
+ | `-c, --coderunner <id\|slug>` | Deploy into this existing coderunner. |
180
+ | `--app-id <uuid>` | Bind a **new** coderunner to an App as a helper. Ignored on reuse. |
181
+ | `--secret <NAME>` | Inject a workspace secret (repeatable). Only works where the platform has injection enabled; prefer runtime reads via M2M `secrets:read`. |
182
+ | `--api-url <url>` | Control Plane base URL override. |
183
+ | `-y, --yes` | Skip the reuse confirmation (required without a terminal). |
139
184
  | `-p, --path <dir>` | Directory to package (default: cwd). |
140
185
  | `--git <url>` / `--ref <ref>` | Clone and deploy a remote repo. |
141
186
  | `--subdir <dir>` | Package a subdirectory of the source. |
@@ -159,8 +204,9 @@ halves), `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.jks`, `*.keystore`, `*.ppk`,
159
204
  `.gcloud/`, `.gnupg/`, `.docker/`, `.kube/`, `.terraform/` or `.chef/`.
160
205
 
161
206
  Every exclusion is printed, and so is every dot-file that survived the filter.
162
- There is no flag to turn it off: pass values with `gf secrets` or
163
- `-e KEY=VALUE` instead.
207
+ There is no flag to turn it off: keep credentials in `gf secrets` and read them
208
+ at runtime (M2M `secrets:read`), or pass non-sensitive config with
209
+ `-e KEY=VALUE`. Credential-shaped `-e` keys are rejected.
164
210
 
165
211
  This is a **denylist**, so it only knows names. A secret in a file called
166
212
  `config.json`, `settings.py` or `serviceAccount.json` is still uploaded —
@@ -184,7 +230,7 @@ npm run release
184
230
  gf apps publish --path release.zip
185
231
  ```
186
232
 
187
- `gf apps init` downloads the public ZIP from the Customer Portal
233
+ `gf apps init` downloads the public ZIP from the Client Portal
188
234
  (`/downloads/shell-starter-kit.zip` on the current cell) and stamps
189
235
  `APP_ID` / `groundfloor.manifest.json` `appId` to the slug.
190
236
 
@@ -213,7 +259,7 @@ gf dataplane status
213
259
  gf dataplane provision
214
260
 
215
261
  gf secrets ls
216
- gf secrets set DATABASE_URL 'postgres://…'
262
+ printf '%s' "$DATABASE_URL" | gf secrets set DATABASE_URL - # stdin keeps the value out of shell history
217
263
  gf secrets get DATABASE_URL
218
264
  gf secrets rm DATABASE_URL
219
265
 
@@ -226,6 +272,11 @@ gf apps ls
226
272
  gf apps get <id|slug>
227
273
  ```
228
274
 
275
+ `gf env` and `gf secrets get` print raw secret values to stdout by design; do
276
+ not run them where output is logged. For `gf m2m token`, set
277
+ `GROUNDFLOOR_M2M_CLIENT_SECRET` instead of `--client-secret` (argv is visible
278
+ in `ps` and shell history).
279
+
229
280
  ## Feature flags
230
281
 
231
282
  Per-environment toggles and config values. `-e` takes an environment id or name
@@ -261,12 +312,15 @@ https://docs.groundfloor.cloud/docs/configure/feature-flags.
261
312
  | `gf coderunner ls` (`cr ls`) | List coderunners. |
262
313
  | `gf coderunner status -c <id\|slug>` | Status and current deployment. |
263
314
  | `gf coderunner logs -c <id\|slug>` | Process Log (stdout/stderr). Also printed automatically on `gf deploy` failure. |
264
- | `gf coderunner cancel-deployment -c <id\|slug>` | Delete the current (or `--deployment-id`) deployment. |
315
+ | `gf coderunner cancel-deployment -c <id\|slug>` | **Destructive.** Deletes the current (or `--deployment-id`) deployment; if it is the live one the service goes offline. Confirms on a terminal; requires `-y/--yes` without one. |
265
316
  | `gf coderunner run -c <id\|slug> [--payload '{}']` | Invoke a deployed function or job. |
266
317
  | `gf m2m token` | Print a short Control Plane JWT from M2M client_id + secret. Not `gf token`. |
267
318
  | `gf coderunner vault-token` | **Deprecated.** Use `gf m2m token`. |
268
- | `gf deploy` | Package code and deploy as a coderunner. |
269
- | `gf domains ls\|add\|rm\|verify -c <id\|slug>` | Custom domains for a service. |
319
+ | `gf deploy` | Package code and deploy as a coderunner (see Deploy flags). |
320
+ | `gf domains ls\|add\|rm\|verify --app <id\|slug>` | Custom domains for a standalone App. Domains belong to Apps; standalone coderunner domain routes are not supported. |
321
+ | `gf identities ls\|mint --identity <id>` | Workload identities (Vault principals); first mint returns `refresh_secret` once. |
322
+ | `gf usage [--account <id>] [--since-days <n>] [--json]` | Read-only account quota/usage and billing estimate. The account is the billing parent of the workspace, not the workspace id. |
323
+ | `gf api <path> [-X <method>] [--body <json>]` | Call a Control Plane path; `{workspace_id}` expands to the current workspace. |
270
324
  | `gf secrets ls\|get\|set\|rm` | Workspace secrets. |
271
325
  | `gf flags ls\|get\|set\|rm\|compare\|promote` | Feature flags per environment (`-e <id\|name>`). |
272
326
  | `gf files ls\|upload\|download\|rm` | Workspace files. |
@@ -290,11 +344,12 @@ still override the hosts for that login.
290
344
  | IdP issuer | `--issuer` | `GROUNDFLOOR_ISSUER` | Groundfloor managed IdP |
291
345
  | OIDC client id | `--client-id` | `GROUNDFLOOR_CLIENT_ID` | `groundfloor-cli` |
292
346
  | Default workspace | (via `gf workspaces use`) | `GROUNDFLOOR_WORKSPACE_ID` | (none) |
347
+ | Access token | (none) | `GROUNDFLOOR_TOKEN` | (none; wins over the saved session) |
293
348
 
294
349
  State is stored under `~/.groundfloor/`:
295
350
 
296
351
  - `auth.json` — cached tokens (chmod `600`).
297
- - `config.json` — non-secret defaults (issuer, client id, api url, workspace).
352
+ - `config.json` — non-secret defaults (issuer, client id, api url, workspace); chmod `600`.
298
353
 
299
354
  ### Redirect URI mismatch
300
355
 
@@ -308,7 +363,7 @@ sign-in fails with an invalid redirect URI:
308
363
 
309
364
  ## More
310
365
 
311
- - [Customer Portal](https://app.groundfloor.cloud)
366
+ - [Client Portal](https://console.groundfloor.cloud)
312
367
  - [Developers](https://docs.groundfloor.cloud/docs/developer-tools/cli)
313
368
  - [Deploy with agents](https://docs.groundfloor.cloud/docs/developer-tools/ai-agents)
314
369
  - [Coderunner](https://docs.groundfloor.cloud/docs/deploy)