neatlogs-cli 0.2.0-team-test.2 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -2,7 +2,25 @@
2
2
 
3
3
  All notable changes to `neatlogs-cli` are documented in this file.
4
4
 
5
- ## Unreleased
5
+ ## 0.2.1
6
+
7
+ - Verify `auth status` against the Public API instead of treating a configured
8
+ credential as authenticated; return exit 3 for rejected or missing credentials.
9
+ - Add explicit `--credential-source profile|token|auto` selection so SDK keys
10
+ can coexist with stored OAuth or service-account credentials. Automatic
11
+ precedence, conflict rejection, and host binding remain unchanged.
12
+ - Explain host selection, project discovery and credential recovery in JSON
13
+ and terminal diagnostics; update the onboarding and installation guidance.
14
+
15
+ ## 0.2.0
16
+
17
+ - Include project archive/restore, soft deletion, existing-member access and
18
+ reviewer-aware evaluation activation commands from the production Public API.
19
+ - Add classifier label, dataset, training, publication and bounded historical-job
20
+ contracts. Paid jobs remain subject to deployment admission and explicit budgets.
21
+ - Map validated classifier input and resource-state errors to actionable exit
22
+ codes, retaining strict response validation and credential redaction.
23
+ - Align the embedded OpenAPI contract with the deployed production source.
6
24
 
7
25
  ## 0.2.0-team-test.2
8
26
 
@@ -14,12 +32,8 @@ All notable changes to `neatlogs-cli` are documented in this file.
14
32
 
15
33
  ## 0.2.0-team-test.1
16
34
 
17
- - Add project archive, restore, soft deletion, and existing-member access commands.
18
- - Add evaluation draft discard and reviewer-aware activation commands.
19
- - Add classifier dataset, training, publication, and bounded job management commands.
20
- - Add bounded historical detection job commands and refresh the Public API contract.
21
- - Publish this candidate to the `team-test` channel for Dev acceptance; provider
22
- admission and historical backfill still require their environment prerequisites.
35
+ - Add project lifecycle, existing-member access, reviewer-aware evaluation activation,
36
+ classifier workflows, and bounded historical job commands for Dev acceptance.
23
37
 
24
38
  ## 0.1.0 (release candidate)
25
39
 
@@ -30,7 +44,7 @@ All notable changes to `neatlogs-cli` are documented in this file.
30
44
  contracts and safe request-ID diagnostics from the retest repairs.
31
45
  - Publication and deployed end-to-end acceptance remain release requirements.
32
46
 
33
- ## 0.1.0-team-test.7 (unpublished; superseded by 0.1.0)
47
+ ## 0.1.0-team-test.7
34
48
 
35
49
  - Include the merged fresh-start fixes: read-only default OAuth scopes and
36
50
  field-specific guidance for required analytics dates and other arguments.
@@ -87,3 +101,7 @@ All notable changes to `neatlogs-cli` are documented in this file.
87
101
  ## 0.1.0-team-test.1
88
102
 
89
103
  - Team-testing prerelease of the NeatLogs public API CLI.
104
+
105
+ ## 0.1.0
106
+
107
+ - Initial public release of the NeatLogs public API CLI.
package/README.md CHANGED
@@ -34,20 +34,18 @@ flowchart LR
34
34
 
35
35
  ## Human quickstart
36
36
 
37
- The stable release candidate in this checkout is `neatlogs-cli@0.1.0`, under
38
- the MIT license in [LICENSE](LICENSE). It is not published by a source change.
39
- Verify `npm view neatlogs-cli@0.1.0 version` before using the stable install
40
- command; the currently published team-test release remains available through
41
- `npm install --global neatlogs-cli@team-test` until the reviewed release ships.
37
+ This checkout prepares `neatlogs-cli@0.2.1`, under the MIT license in
38
+ [LICENSE](LICENSE). Release changes are described in [CHANGELOG.md](CHANGELOG.md).
39
+ Publication is a separate release step; check `npm view neatlogs-cli version`
40
+ for the current stable release.
42
41
 
43
42
  1. Install the CLI and confirm that it runs.
44
43
 
45
44
  ```bash
46
- npm install --global neatlogs-cli@0.1.0
45
+ npm install --global neatlogs-cli
47
46
  neatlogs --version
48
47
  ```
49
48
 
50
- The stable candidate is `0.1.0`; publication must be independently verified.
51
49
  Use Node.js 22 or
52
50
  24. The complete dev setup and verification flow is in the
53
51
  [team quickstart](../backend/docs/public-api/dev-team-quickstart.md).
@@ -55,34 +53,57 @@ command; the currently published team-test release remains available through
55
53
  2. Save the host, select the profile, and sign in.
56
54
 
57
55
  ```bash
58
- neatlogs profile set work --host '<https-app-origin>'
56
+ neatlogs profile set work --host 'https://app.neatlogs.com'
59
57
  neatlogs profile use work
60
- neatlogs auth login
58
+ neatlogs --host https://app.neatlogs.com --profile work auth login --device
61
59
  ```
62
60
 
63
- An interactive terminal opens browser OAuth and prints the URL as a
64
- copy/paste fallback. A non-interactive or headless terminal automatically
65
- uses Device Flow; `--device` selects it explicitly.
61
+ Approve the displayed code in your browser. Omit `--device` for browser
62
+ OAuth on an interactive terminal; headless terminals use Device Flow.
66
63
 
67
64
  3. List the projects you can access.
68
65
 
69
66
  ```bash
70
- neatlogs projects list
67
+ env -u NEATLOGS_API_KEY -u NEATLOGS_TOKEN -u NEATLOGS_PROJECT_ID neatlogs --profile work projects list
71
68
  ```
72
69
 
73
70
  4. Save the project you want this profile to use.
74
71
 
75
72
  ```bash
76
- neatlogs profile set work --host '<https-app-origin>' --project '<project-uuid>'
73
+ neatlogs profile set work --host 'https://app.neatlogs.com' --project '<project-uuid>'
77
74
  ```
78
75
 
79
76
  5. Check your identity and read recent traces.
80
77
 
81
78
  ```bash
82
- neatlogs whoami
83
- neatlogs traces list --limit 10
79
+ env -u NEATLOGS_API_KEY -u NEATLOGS_TOKEN neatlogs --profile work whoami
80
+ env -u NEATLOGS_API_KEY -u NEATLOGS_TOKEN neatlogs --profile work traces list --limit 10
81
+ env -u NEATLOGS_API_KEY -u NEATLOGS_TOKEN neatlogs --profile work traces get <trace-id>
84
82
  ```
85
83
 
84
+ The read commands use POSIX `env -u` to exclude SDK credentials only from the
85
+ CLI process, keeping them available to the application. In other shells, use
86
+ an equivalent clean credential environment. These examples work with the
87
+ published 0.2.0 package.
88
+
89
+ These examples use the US dashboard host; use `https://eu.app.neatlogs.com`
90
+ for EU. `projects list` must run without `--project` or `NEATLOGS_PROJECT_ID`.
91
+ A saved profile's project is automatically omitted for discovery.
92
+
93
+ `--credential-source profile` (available in 0.2.1) ignores both credential environment
94
+ variables and uses the selected or active profile's stored OAuth login. This
95
+ lets an SDK application keep its `NEATLOGS_API_KEY` in the same shell. With the
96
+ published 0.2.0 CLI, omit this new option and run each OAuth CLI command through
97
+ `env -u NEATLOGS_API_KEY -u NEATLOGS_TOKEN` on POSIX shells, or use an equivalent
98
+ clean credential environment on other platforms. Do not remove the SDK key
99
+ from the application's configuration.
100
+
101
+ A key-only user can verify SDK ingestion/readback with the SDK's documented
102
+ `doctor --local` and `doctor --probe` commands without CLI login. Report CLI
103
+ readback as **waiting on a human** unless OAuth approval or a suitable service
104
+ account is available. A synthetic probe proves the telemetry pipeline; verify
105
+ the application's actual trace separately.
106
+
86
107
  `profile set` stores non-secret host and project preferences. Login stores the
87
108
  OAuth credentials separately in the native operating-system vault.
88
109
 
@@ -147,10 +168,6 @@ The consent page lists only the permissions requested by this login command.
147
168
  `offline_access` allows refresh tokens; it is not an API permission shown by
148
169
  `whoami`.
149
170
 
150
- Existing OAuth credentials retain their issued scopes after a CLI upgrade.
151
- Log out of the selected profile and sign in again to apply the stable release's
152
- read-oriented defaults; request write scopes explicitly when needed.
153
-
154
171
  ## Agent and CI automation
155
172
 
156
173
  In **Settings → Service Accounts**, create a dedicated account, bind only the
@@ -591,8 +608,26 @@ request.
591
608
  ## Configuration and output
592
609
 
593
610
  - `NEATLOGS_TOKEN` is the primary credential source; `NEATLOGS_API_KEY` is the
594
- legacy fallback. An environment credential takes precedence over a selected
595
- stored profile and is identified as `environment` by `auth status`.
611
+ legacy public API key fallback, not an SDK project key. In the default
612
+ `--credential-source auto` mode, environment credentials take precedence over
613
+ a selected stored profile and differing token/key values fail closed.
614
+ - `--credential-source profile` explicitly ignores both credential environment
615
+ variables and uses the saved login, including its host/project defaults.
616
+ Host overrides must still match the credential-bound host.
617
+ - `--credential-source token` reads only `NEATLOGS_TOKEN`, ignoring the SDK's
618
+ `NEATLOGS_API_KEY`. A missing or invalid token fails without falling back to
619
+ another identity. Use this for service-account automation sharing an SDK shell.
620
+ - `auth status` now verifies access against the public API. OAuth and service
621
+ tokens use project discovery (`context:read`); legacy public API keys use
622
+ their bound `whoami` context. No selected project is needed. Rejected/missing
623
+ credentials report `authenticated: false` and exit 3. Scope failures and
624
+ network failures retain their distinct errors instead of claiming the user
625
+ is signed out. Success reports `verification: "public_api"`; this does not
626
+ guarantee permission to read every project's traces.
627
+ Older published clients only checked local credential presence, so use
628
+ project-scoped `whoami` and a trace read when validating those versions.
629
+ - Authentication and configuration diagnostics include a static, secret-free
630
+ `hint` in JSON and human output with the recovery steps.
596
631
  - `--profile <name>` selects non-secret host/project preferences and its
597
632
  separately stored OAuth credential. Stored tokens are never sent when a
598
633
  `--host` or `NEATLOGS_HOST` override differs from the credential-bound host.