@tsuga/cli 1.0.19 → 1.1.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 +27 -6
  2. package/dist/cli.js +60 -65
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,16 +24,37 @@ This runs `npm install -g @tsuga/cli@latest`. The CLI also checks for new versio
24
24
 
25
25
  ## Authentication
26
26
 
27
- Before authenticating, generate an Operation API key from your [Tsuga account settings](https://app.tsuga.com/settings/api-keys?operation=true).
27
+ All authentication lives under `tsuga auth`.
28
28
 
29
- The recommended way to authenticate is to save your Operation API key once:
29
+ ### Log in as a user (recommended)
30
+
31
+ For interactive use, log in as a user with a browser authorization flow:
32
+
33
+ ```bash
34
+ # Prints an authorization URL. On macOS, also opens it in your browser.
35
+ tsuga auth login
36
+
37
+ # Print the saved user access token
38
+ tsuga auth token
39
+
40
+ # Show the current authentication method
41
+ tsuga auth status
42
+
43
+ # Clear the saved user session
44
+ tsuga auth logout
45
+ ```
46
+
47
+ After `tsuga auth login`, commands work without an Operation API key.
48
+
49
+ ### Operation API key
50
+
51
+ 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:
30
52
 
31
53
  ```bash
32
- tsuga auth <operation-api-key>
54
+ tsuga auth operation-key <operation-api-key>
33
55
  ```
34
56
 
35
- This writes your operation-api-key to `~/.config/tsuga/config.json`.
36
- Alternatively, set credentials per-session without saving:
57
+ This writes your operation-api-key to `~/.config/tsuga/config.json`. Alternatively, set it per-session without saving:
37
58
 
38
59
  ```bash
39
60
  # Environment variable
@@ -43,7 +64,7 @@ export TSUGA_OPERATION_API_KEY=<operation-api-key>
43
64
  tsuga --operation-api-key <operation-api-key> dashboards list
44
65
  ```
45
66
 
46
- Priority order: `--operation-api-key` flag → `TSUGA_OPERATION_API_KEY` env var → saved config.
67
+ A `--operation-api-key` flag or `TSUGA_OPERATION_API_KEY` env var overrides the saved credential for that one invocation.
47
68
 
48
69
  ## Configuration
49
70