@tsuga/cli 1.5.1 → 1.7.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 +47 -24
- package/dist/cli.js +69 -62
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -75,17 +75,17 @@ After `tsuga auth login`, commands work without an Operation API key.
|
|
|
75
75
|
For non-interactive use (CI, scripts), authenticate with an Operation API key. Generate one from your [Tsuga account settings](https://app.tsuga.com/settings/api-keys?operation=true), then save it once:
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
tsuga auth operation-key <
|
|
78
|
+
tsuga auth operation-key <OPERATION_API_KEY>
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
This writes
|
|
81
|
+
This writes the operation API key to `$XDG_CONFIG_HOME/tsuga/config.json`, or `~/.config/tsuga/config.json` when `XDG_CONFIG_HOME` is unset. Alternatively, set it per-session without saving:
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
# Environment variable
|
|
85
|
-
export TSUGA_OPERATION_API_KEY=<
|
|
85
|
+
export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>
|
|
86
86
|
|
|
87
87
|
# CLI flag (highest priority)
|
|
88
|
-
tsuga --operation-api-key <
|
|
88
|
+
tsuga --operation-api-key <OPERATION_API_KEY> dashboards list
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
A `--operation-api-key` flag or `TSUGA_OPERATION_API_KEY` env var overrides the saved credential for that one invocation.
|
|
@@ -141,17 +141,17 @@ tsuga cluster list
|
|
|
141
141
|
Pick the cluster you want to use by default via the defaults mechanism:
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
tsuga config set default cluster <
|
|
144
|
+
tsuga config set default cluster <CLUSTER_ID>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
Override per-command without persisting:
|
|
148
148
|
|
|
149
149
|
```bash
|
|
150
150
|
# Environment variable
|
|
151
|
-
export TSUGA_CLUSTER_ID=<
|
|
151
|
+
export TSUGA_CLUSTER_ID=<CLUSTER_ID>
|
|
152
152
|
|
|
153
153
|
# CLI flag (highest priority)
|
|
154
|
-
tsuga --cluster <
|
|
154
|
+
tsuga --cluster <CLUSTER_ID> logs search
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
Priority order: `--cluster` flag → `TSUGA_CLUSTER_ID` env var → `defaults.cluster`. If unset, the backend falls back to the first cluster.
|
|
@@ -161,18 +161,18 @@ Priority order: `--cluster` flag → `TSUGA_CLUSTER_ID` env var → `defaults.cl
|
|
|
161
161
|
Most resources follow the same CRUD pattern:
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
|
-
tsuga <
|
|
165
|
-
tsuga <
|
|
166
|
-
tsuga <
|
|
167
|
-
tsuga <
|
|
168
|
-
tsuga <
|
|
164
|
+
tsuga <RESOURCE> list
|
|
165
|
+
tsuga <RESOURCE> get <ID>
|
|
166
|
+
tsuga <RESOURCE> create -f payload.json
|
|
167
|
+
tsuga <RESOURCE> update <ID> -f payload.json
|
|
168
|
+
tsuga <RESOURCE> delete <ID>
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
Read-only resources (for example `services`) support only:
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
174
|
tsuga services list
|
|
175
|
-
tsuga services get <
|
|
175
|
+
tsuga services get <ID>
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
You can also pass JSON inline with `-d`:
|
|
@@ -185,7 +185,8 @@ tsuga teams create -d '{"name": "Platform", "visibility": "public"}'
|
|
|
185
185
|
|
|
186
186
|
API-calling commands accept an optional `--rationale` flag to record why they are being run.
|
|
187
187
|
It does not change the result; the text is sent as a request header and recorded in the
|
|
188
|
-
backend request log, which is useful for understanding agent behavior.
|
|
188
|
+
backend request log, which is useful for understanding agent behavior. `feedback` is excluded
|
|
189
|
+
since its message already explains why it's being sent.
|
|
189
190
|
|
|
190
191
|
```bash
|
|
191
192
|
tsuga logs patterns --rationale "exploring telemetry to investigate prod outage"
|
|
@@ -193,15 +194,15 @@ tsuga logs patterns --rationale "exploring telemetry to investigate prod outage"
|
|
|
193
194
|
|
|
194
195
|
### Available resources
|
|
195
196
|
|
|
196
|
-
`cloud-resources`, `dashboards`, `ingestion-api-keys`, `investigations`, `monitors`, `notification-rules`, `notification-silences`, `quality-reports`, `retention-policies`, `routes`, `services`, `slos`, `tag-policies`, `teams`
|
|
197
|
+
`cloud-resources`, `dashboards`, `ingestion-api-keys`, `investigations`, `monitors`, `notification-rules`, `notification-silences`, `quality-reports`, `retention-policies`, `log-routes`, `services`, `slos`, `tag-policies`, `teams`
|
|
197
198
|
|
|
198
199
|
> Notes:
|
|
199
200
|
>
|
|
200
|
-
> - `ingestion-api-keys` does not support `get <
|
|
201
|
+
> - `ingestion-api-keys` does not support `get <ID>`.
|
|
201
202
|
> - `services` is read-only (`list`, `get`).
|
|
202
203
|
> - `cloud-resources` and `quality-reports` are read-only and only support `list`.
|
|
203
|
-
> - For `quality-reports list`, pass `--cluster <
|
|
204
|
-
> - Pass `--team <
|
|
204
|
+
> - For `quality-reports list`, pass `--cluster <CLUSTER_ID>` (or set `TSUGA_CLUSTER_ID` / saved default) when the org has more than one cluster.
|
|
205
|
+
> - Pass `--team <TEAM_NAME>` to `quality-reports list` to scope the response to a single team by name (omits cluster-wide global rows).
|
|
205
206
|
> - `investigations` is beta: it requires an operation API key with the `investigations` permission and the API may change.
|
|
206
207
|
|
|
207
208
|
### Generating a request skeleton
|
|
@@ -239,8 +240,8 @@ tsuga services get abc-123
|
|
|
239
240
|
# Create a notification rule from a file
|
|
240
241
|
tsuga notification-rules create -f rule.json
|
|
241
242
|
|
|
242
|
-
# Update a route
|
|
243
|
-
tsuga routes update abc-123 -d '{"name": "Updated route"}'
|
|
243
|
+
# Update a log route
|
|
244
|
+
tsuga log-routes update abc-123 -d '{"name": "Updated log route"}'
|
|
244
245
|
|
|
245
246
|
# Delete a retention policy
|
|
246
247
|
tsuga retention-policies delete abc-123
|
|
@@ -364,7 +365,29 @@ tsuga aggregation scalar --generate-skeleton > query.json
|
|
|
364
365
|
Inspect service dependency graphs:
|
|
365
366
|
|
|
366
367
|
```bash
|
|
367
|
-
tsuga service-graph get <
|
|
368
|
+
tsuga service-graph get <SERVICE_ID> --from -1h --query 'env:prod'
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Kubernetes
|
|
372
|
+
|
|
373
|
+
Explore Kubernetes resources observed across the organization, inferred from your telemetry:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
tsuga kubernetes pods --search my-service
|
|
377
|
+
tsuga kubernetes clusters
|
|
378
|
+
tsuga kubernetes pod-details --k8s-cluster prod --k8s-namespace default --pod-name my-pod-abc123
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Available resources: `pods`, `clusters`, `namespaces`, `deployments`, `statefulsets`, `daemonsets` (list, with an optional `--search`), and `pod-details`, `pod-manifest`, `deployment-details` (single-resource lookups, with required identifying flags).
|
|
382
|
+
|
|
383
|
+
## Grok
|
|
384
|
+
|
|
385
|
+
Test grok parsing rules against sample log lines before using them in a log route:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
tsuga grok parse --generate-skeleton > grok-test.json
|
|
389
|
+
# edit grok-test.json
|
|
390
|
+
tsuga grok parse -f grok-test.json
|
|
368
391
|
```
|
|
369
392
|
|
|
370
393
|
## Experimental
|
|
@@ -394,11 +417,11 @@ tsuga experimental promql -d '{"query":"sum by (\"context.service.name\") (sum_o
|
|
|
394
417
|
Configure local Claude Code (`~/.claude/settings.json`) or Codex (`~/.codex/config.toml`) to ship OpenTelemetry data to your Tsuga cluster. Needs an OTLP base URL and an [ingestion API key](https://app.tsuga.com/settings/api-keys?ingestion=true) (not the same as your operation API key).
|
|
395
418
|
|
|
396
419
|
```bash
|
|
397
|
-
tsuga setup claude-code --endpoint <
|
|
398
|
-
tsuga setup codex --endpoint <
|
|
420
|
+
tsuga setup claude-code --endpoint <OTLP_ENDPOINT> --ingestion-api-key <INGESTION_API_KEY>
|
|
421
|
+
tsuga setup codex --endpoint <OTLP_ENDPOINT> --ingestion-api-key <INGESTION_API_KEY>
|
|
399
422
|
```
|
|
400
423
|
|
|
401
|
-
Both options also read from env (`TSUGA_OTLP_ENDPOINT`, `TSUGA_INGESTION_API_KEY`). Pass `--no-include-prompts` to strip user prompts
|
|
424
|
+
Both options also read from env (`TSUGA_OTLP_ENDPOINT`, `TSUGA_INGESTION_API_KEY`). Pass `--no-include-prompts` to strip user prompts from telemetry (default: include); for `claude-code` this also strips tool content, but `codex` only strips user prompts. The previous config is saved alongside the file as `.bak.<ISO>`; restart any running `claude` / `codex` sessions afterward.
|
|
402
425
|
|
|
403
426
|
## LLM plugins
|
|
404
427
|
|