@tsuga/cli 1.0.10 → 1.0.12
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 +68 -30
- package/dist/cli.js +108 -40
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -43,36 +43,9 @@ Show current configuration:
|
|
|
43
43
|
tsuga config
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
## Clusters
|
|
47
|
-
|
|
48
|
-
If your tenant has multiple clusters, you can target a specific one:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# List clusters
|
|
52
|
-
tsuga cluster list
|
|
53
|
-
|
|
54
|
-
# Save the cluster you want to use by default
|
|
55
|
-
tsuga cluster use <cluster-id>
|
|
56
|
-
|
|
57
|
-
# Clear the saved cluster
|
|
58
|
-
tsuga cluster reset
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
You can also override the cluster per-command:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# Environment variable
|
|
65
|
-
export TSUGA_CLUSTER_ID=<cluster-id>
|
|
66
|
-
|
|
67
|
-
# CLI flag (highest priority)
|
|
68
|
-
tsuga --cluster <cluster-id> logs search
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Priority order: `--cluster` flag → `TSUGA_CLUSTER_ID` env var → saved config. If unset, the backend falls back to the first cluster.
|
|
72
|
-
|
|
73
46
|
## Defaults
|
|
74
47
|
|
|
75
|
-
|
|
48
|
+
Commands have built-in defaults so you can omit common flags:
|
|
76
49
|
|
|
77
50
|
| Flag | Default |
|
|
78
51
|
| --------------- | ------- |
|
|
@@ -81,7 +54,7 @@ Telemetry commands have built-in defaults so you can omit common flags:
|
|
|
81
54
|
| `--query` | `*` |
|
|
82
55
|
| `--max-results` | `100` |
|
|
83
56
|
|
|
84
|
-
Override defaults
|
|
57
|
+
Override defaults persistently:
|
|
85
58
|
|
|
86
59
|
```bash
|
|
87
60
|
tsuga defaults set from -1h
|
|
@@ -94,12 +67,44 @@ View all current defaults (custom overrides marked with `*`):
|
|
|
94
67
|
tsuga defaults
|
|
95
68
|
```
|
|
96
69
|
|
|
97
|
-
Reset custom defaults:
|
|
70
|
+
Reset all custom defaults:
|
|
98
71
|
|
|
99
72
|
```bash
|
|
100
73
|
tsuga defaults reset
|
|
101
74
|
```
|
|
102
75
|
|
|
76
|
+
Clear a single default by setting it to an empty value:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
tsuga defaults set cluster ''
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Clusters
|
|
83
|
+
|
|
84
|
+
If your tenant has multiple clusters, list them:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
tsuga cluster list
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Pick the cluster you want to use by default via the defaults mechanism:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
tsuga defaults set cluster <cluster-id>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Override per-command without persisting:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Environment variable
|
|
100
|
+
export TSUGA_CLUSTER_ID=<cluster-id>
|
|
101
|
+
|
|
102
|
+
# CLI flag (highest priority)
|
|
103
|
+
tsuga --cluster <cluster-id> logs search
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Priority order: `--cluster` flag → `TSUGA_CLUSTER_ID` env var → `defaults.cluster`. If unset, the backend falls back to the first cluster.
|
|
107
|
+
|
|
103
108
|
## Usage
|
|
104
109
|
|
|
105
110
|
Most resources follow the same CRUD pattern:
|
|
@@ -274,6 +279,39 @@ Inspect service dependency graphs:
|
|
|
274
279
|
tsuga service-graph get <service-id> --from -1h --query 'env:prod'
|
|
275
280
|
```
|
|
276
281
|
|
|
282
|
+
## Experimental
|
|
283
|
+
|
|
284
|
+
Commands under `tsuga experimental` are unstable and may change or be removed without notice. Use them only if you accept that risk.
|
|
285
|
+
|
|
286
|
+
### PromQL
|
|
287
|
+
|
|
288
|
+
Run a PromQL query against the metrics backend. Returns a timeseries shape matching `tsuga aggregation timeseries`.
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
tsuga experimental promql --generate-skeleton > query.json
|
|
292
|
+
# edit query.json
|
|
293
|
+
tsuga experimental promql -f query.json
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Or inline:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
tsuga experimental promql -d '{"query":"sum(rate(http_requests_total[5m]))","timeRange":{"from":1704067200,"to":1704070800},"step":"30s"}'
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
`timeRange.from` / `timeRange.to` are Unix timestamps in seconds.
|
|
303
|
+
|
|
304
|
+
## LLM telemetry
|
|
305
|
+
|
|
306
|
+
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).
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
tsuga setup claude-code --endpoint <otlp-base-url> --ingestion-api-key <key>
|
|
310
|
+
tsuga setup codex --endpoint <otlp-base-url> --ingestion-api-key <key>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Both options also read from env (`TSUGA_OTLP_ENDPOINT`, `TSUGA_INGESTION_API_KEY`). Pass `--no-include-prompts` to strip user prompts + tool content from telemetry (default: include). The previous config is saved alongside the file as `.bak.<ISO>`; restart any running `claude` / `codex` sessions afterward.
|
|
314
|
+
|
|
277
315
|
## Documentation
|
|
278
316
|
|
|
279
317
|
Browse and search the Tsuga documentation:
|