@gapi/gcli 1.8.241 → 1.8.242

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-CLI.md CHANGED
@@ -29,6 +29,10 @@ Commands:
29
29
  cron:create [options] Create cron
30
30
  cron:delete [options] Delete cron
31
31
  cron:list [options] List of all cron jobs for project
32
+ mq-trigger:list [options] List the message-queue triggers of a project
33
+ mq-trigger:create [options] Run a lambda for every message on a RabbitMQ queue
34
+ mq-trigger:update [options] Change a message-queue trigger (same flags as create)
35
+ mq-trigger:delete [options] Delete a message-queue trigger
32
36
  cluster:create [options] Provision a private Talos cluster for a project (runs in the background - takes several minutes; use --wait to block)
33
37
  cluster:apply [options] Make a private cluster match the `cluster:` section of lambforge.yaml: creates it if missing, then applies topology, workers, control planes, load balancer and autoscaling
34
38
  cluster:list [options] List every private cluster this project has (it may have several - dev/stage/prod, ...)
@@ -502,6 +506,69 @@ Options:
502
506
  -p, --project <project>
503
507
  -h, --help display help for command
504
508
  
509
+ --- Subcommand: mq-trigger:list ---
510
+ Usage: gcli mq-trigger:list [options]
511
+
512
+ List the message-queue triggers of a project
513
+
514
+ Options:
515
+ -p, --project <project>
516
+ -h, --help display help for command
517
+ 
518
+ --- Subcommand: mq-trigger:create ---
519
+ Usage: gcli mq-trigger:create [options]
520
+
521
+ Run a lambda for every message on a RabbitMQ queue
522
+
523
+ Options:
524
+ -p, --project <project>
525
+ -n, --name <name> Trigger name
526
+ -l, --lambda <lambda> Lambda the trigger runs per message
527
+ --request-topic <queue> Queue the trigger consumes
528
+ --response-topic <queue> Queue for the lambda response
529
+ --error-topic <queue> Queue for failed messages
530
+ --broker <rabbitMqId> RabbitMQ broker id (see rabbitmq:list) - needed
531
+ when several brokers share queue names
532
+ --max-retries <n>
533
+ --cool-down-period <seconds>
534
+ --polling-interval <seconds>
535
+ --min-replicas <n>
536
+ --max-replicas <n>
537
+ --threshold <n> Messages per replica before scaling out
538
+ -h, --help display help for command
539
+ 
540
+ --- Subcommand: mq-trigger:update ---
541
+ Usage: gcli mq-trigger:update [options]
542
+
543
+ Change a message-queue trigger (same flags as create)
544
+
545
+ Options:
546
+ -p, --project <project>
547
+ -n, --name <name> Trigger name
548
+ -l, --lambda <lambda> Lambda the trigger runs per message
549
+ --request-topic <queue> Queue the trigger consumes
550
+ --response-topic <queue> Queue for the lambda response
551
+ --error-topic <queue> Queue for failed messages
552
+ --broker <rabbitMqId> RabbitMQ broker id (see rabbitmq:list) - needed
553
+ when several brokers share queue names
554
+ --max-retries <n>
555
+ --cool-down-period <seconds>
556
+ --polling-interval <seconds>
557
+ --min-replicas <n>
558
+ --max-replicas <n>
559
+ --threshold <n> Messages per replica before scaling out
560
+ -h, --help display help for command
561
+ 
562
+ --- Subcommand: mq-trigger:delete ---
563
+ Usage: gcli mq-trigger:delete [options]
564
+
565
+ Delete a message-queue trigger
566
+
567
+ Options:
568
+ -p, --project <project>
569
+ -n, --name <name> Trigger name
570
+ -h, --help display help for command
571
+ 
505
572
  --- Subcommand: cluster:create ---
506
573
  Usage: gcli cluster:create [options]
507
574
 
package/README.md CHANGED
@@ -47,6 +47,20 @@ For automated pipelines (e.g., GitHub Actions), you can use `npx` with a long-li
47
47
  run: npx gcli login --ci --token ${{ secrets.GCLI_AUTH_TOKEN }}
48
48
  ```
49
49
 
50
+ Create the token in the dashboard (Project → CI/CD) with only the permissions the pipeline needs. Every project command has a permission:
51
+
52
+ | Permission | Commands |
53
+ |---|---|
54
+ | Lambdas: read / deploy / create / delete | `lambda:get/list/log/build:log/test`, `lambda:update`, `lambda:create`, `lambda:delete` |
55
+ | Environments: read / write / delete | `environment:list/get`, `environment:create/update`, `environment:delete` |
56
+ | Schedules: read / write | `cron:list`, `cron:create/delete` |
57
+ | RabbitMQ: read / install / uninstall | `rabbitmq:list`, `rabbitmq:create`, `rabbitmq:delete` |
58
+ | Queue triggers: read / manage | `mq-trigger:list`, `mq-trigger:create/update/delete` |
59
+ | Plugins: read / install | `plugin:list/installed`, `plugin:install/uninstall` |
60
+ | Clusters: read / scale / create / tear down / kubeconfig | `cluster:list/status/health/scale-events/cost`, `cluster:scale/autoscale/multi-node/single-node/load-balancer/apply`, `cluster:create/apply`, `cluster:teardown`, `cluster:kubeconfig` |
61
+
62
+ A token can also be limited to some lambdas (lambda, schedule and queue-trigger commands). Typical tokens: *Deploy only* (`lambda:update`), or *DevOps (clusters)* for an infra repo that runs `gcli cluster:apply`. A command the token may not run fails with `ci-token-missing-scope: <operation> needs <permission>`. `runner:*` and `project:list` are personal and not available to CI tokens.
63
+
50
64
  ## Authentication
51
65
 
52
66
  Before interacting with the platform, you must authenticate. You can log in using an API key or a personal access token.
@@ -225,6 +239,21 @@ storage:
225
239
  size: SMALL
226
240
  ```
227
241
 
242
+ ### Message-Queue Triggers
243
+
244
+ A trigger runs a lambda for every message on a RabbitMQ queue (and can publish the response and failures to other queues).
245
+
246
+ ```bash
247
+ gcli mq-trigger:create --name orders --lambda order-handler \
248
+ --request-topic orders --response-topic orders-done --error-topic orders-failed \
249
+ --broker '<brokerId>' # see rabbitmq:list; needed when brokers share queue names
250
+ gcli mq-trigger:update --name orders --max-replicas 5 --threshold 20 # only the flags you pass change
251
+ gcli mq-trigger:list
252
+ gcli mq-trigger:delete --name orders
253
+ ```
254
+
255
+ Scaling flags: `--max-retries`, `--cool-down-period`, `--polling-interval`, `--min-replicas`, `--max-replicas`, `--threshold` (messages per replica).
256
+
228
257
  ### Marketplace Plugins
229
258
 
230
259
  Plugins (Redis, MongoDB, NATS, FalkorDB, ...) can be installed on the shared cluster or on any private cluster - the same plugin can be installed on several clusters at once.
@@ -0,0 +1,21 @@
1
+ ## 2026-10-19 - ci-token-scopes: mq-trigger:list/create/update/delete commands; README documents CI token permissions per command
2
+
3
+ **Feature:** ci-token-scopes · **Type:** feat
4
+
5
+ - New `mq-trigger:list`, `mq-trigger:create`, `mq-trigger:update`,
6
+ `mq-trigger:delete` (`src/commands/triggers/message-queue/`) - message-queue
7
+ triggers had an API and a dashboard page but no CLI. Flags: `--name`,
8
+ `--lambda`, `--request-topic`, `--response-topic`, `--error-topic`,
9
+ `--broker` (RabbitMQ id), scaling counts; `update` reads the current
10
+ trigger and sends it with the passed flags on top (the service needs the
11
+ full spec).
12
+ - README: CI/CD section lists the permission each command needs (CI token
13
+ scopes now cover every project command, incl. clusters for DevOps
14
+ tokens) and a Message-Queue Triggers section; `README-CLI.md`
15
+ regenerated from the built CLI's `--help`.
16
+ - **Test:** `npx jest test/mq-trigger.spec.ts` (flag mapping, create needs
17
+ lambda + queue, numbers validated, update merged over the current trigger).
18
+ - **Debug:** `docs/features/ci-token-scopes.md`; `ci-token-missing-scope`
19
+ comes from the services - reissue the token with that permission.
20
+ - **Verification:** jest 75/75; tsc clean; `gcli mq-trigger:create --help`
21
+ from a fresh build; `release/index.js` restored after the build.
@@ -33,3 +33,4 @@ Outline (drop sections that don't apply):
33
33
  | `local-ai-runners` | [local-ai-runners.md](local-ai-runners.md) | `runner:*` commands; canonical doc in graphql-server |
34
34
  | `lambforge-agent-skill` | [lambforge-agent-skill.md](lambforge-agent-skill.md) | The agent skill that teaches gcli + `mcp:start`; canonical doc in gql-fission |
35
35
  | `dedicated-platform-cluster` | [dedicated-platform-cluster.md](dedicated-platform-cluster.md) | `cluster:status/health/scale/autoscale/...` commands; canonical doc in lambforge-agent |
36
+ | `ci-token-scopes` | [ci-token-scopes.md](ci-token-scopes.md) | Which permission each command needs; `mq-trigger:*` commands; canonical doc in graphql-server |
@@ -0,0 +1,25 @@
1
+ # ci-token-scopes (gcli slice)
2
+
3
+ **Canonical doc:** `graphql-server/docs/features/ci-token-scopes.md` ·
4
+ **Since:** 2026-10-19
5
+
6
+ gcli itself enforces nothing - a CI/CD token (`gcli login --ci --token …`)
7
+ is checked by the services. What this package owns:
8
+
9
+ - Every project command maps to one permission (README → CI/CD
10
+ Integration has the table). A refused command prints the service error
11
+ `ci-token-missing-scope: <operation> needs <scope>` /
12
+ `ci-token-lambda-not-allowed` / `ci-token-wrong-project`.
13
+ - `mq-trigger:list/create/update/delete`
14
+ (`src/commands/triggers/message-queue/`, `GraphqlClienAPI.
15
+ listMessageQueueTriggers / saveMessageQueueTrigger / deleteMessageQueueTrigger`)
16
+ - the `mq-trigger:*` permissions had no CLI before. `update` reads the
17
+ current trigger and sends it with the given flags on top
18
+ (`mergeOverExisting`): the service hands the payload to Fission as the
19
+ whole spec and picks the cluster by `lambdaName`, so a partial payload
20
+ would drop settings. Counts are validated as whole numbers
21
+ (`toTriggerInput`). The trigger types are declared in `gql-client.ts`
22
+ (not in the bundled introspection yet).
23
+ - Not for CI tokens: `runner:*`, `project:list`, `mcp:start`.
24
+
25
+ **Test:** `npx jest test/mq-trigger.spec.ts`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.241",
3
+ "version": "1.8.242",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"