@tsuga/cli 1.6.0 → 1.8.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 +46 -27
- package/dist/cli.js +69 -62
- package/package.json +1 -1
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"
|
|
@@ -197,11 +198,11 @@ tsuga logs patterns --rationale "exploring telemetry to investigate prod outage"
|
|
|
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
|
|
@@ -364,27 +365,45 @@ 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'
|
|
368
369
|
```
|
|
369
370
|
|
|
370
|
-
##
|
|
371
|
+
## Kubernetes
|
|
371
372
|
|
|
372
|
-
|
|
373
|
+
Explore Kubernetes resources observed across the organization, inferred from your telemetry:
|
|
373
374
|
|
|
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
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## PromQL
|
|
375
394
|
|
|
376
395
|
Run a PromQL query against the metrics backend. Returns a timeseries shape matching `tsuga aggregation timeseries`.
|
|
377
396
|
|
|
378
397
|
```bash
|
|
379
|
-
tsuga
|
|
398
|
+
tsuga promql --generate-skeleton > query.json
|
|
380
399
|
# edit query.json
|
|
381
|
-
tsuga
|
|
400
|
+
tsuga promql -f query.json
|
|
382
401
|
```
|
|
383
402
|
|
|
384
403
|
Or inline:
|
|
385
404
|
|
|
386
405
|
```bash
|
|
387
|
-
tsuga
|
|
406
|
+
tsuga promql -d '{"query":"sum by (\"context.service.name\") (sum_over_time({\"traces.span.metrics.calls\", \"span.kind\"=\"SPAN_KIND_SERVER\"}[5m]))","timeRange":{"from":1704067200,"to":1704070800},"step":"30s"}'
|
|
388
407
|
```
|
|
389
408
|
|
|
390
409
|
`timeRange.from` / `timeRange.to` are Unix timestamps in seconds.
|
|
@@ -394,11 +413,11 @@ tsuga experimental promql -d '{"query":"sum by (\"context.service.name\") (sum_o
|
|
|
394
413
|
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
414
|
|
|
396
415
|
```bash
|
|
397
|
-
tsuga setup claude-code --endpoint <
|
|
398
|
-
tsuga setup codex --endpoint <
|
|
416
|
+
tsuga setup claude-code --endpoint <OTLP_ENDPOINT> --ingestion-api-key <INGESTION_API_KEY>
|
|
417
|
+
tsuga setup codex --endpoint <OTLP_ENDPOINT> --ingestion-api-key <INGESTION_API_KEY>
|
|
399
418
|
```
|
|
400
419
|
|
|
401
|
-
Both options also read from env (`TSUGA_OTLP_ENDPOINT`, `TSUGA_INGESTION_API_KEY`). Pass `--no-include-prompts` to strip user prompts
|
|
420
|
+
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
421
|
|
|
403
422
|
## LLM plugins
|
|
404
423
|
|