@nouter/platform-cli 0.3.0 → 0.4.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 +68 -6
- package/dist/index.js +2302 -410
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,24 +55,73 @@ any URL. A config without a stored URL is not used either: run `login` again.
|
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
nouter-platform login --api-key # reads the key from stdin
|
|
58
|
-
nouter-platform login --browser # the console approves it
|
|
59
|
-
nouter-platform
|
|
58
|
+
nouter-platform login --browser # the console approves it; a loopback server gets the code
|
|
59
|
+
nouter-platform login --paste # paste code#state, for a remote session
|
|
60
|
+
nouter-platform whoami --json
|
|
60
61
|
nouter-platform agents list
|
|
61
62
|
nouter-platform agents get <agent-id>
|
|
62
63
|
nouter-platform environments list
|
|
63
64
|
nouter-platform environments get <environment-id>
|
|
64
65
|
nouter-platform apply -f ./resources --dry-run
|
|
66
|
+
nouter-platform auth sessions list
|
|
67
|
+
nouter-platform elevate
|
|
65
68
|
nouter-platform logout
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
`login --api-key` is the non-interactive path for CI and for terminals without
|
|
69
72
|
a browser. The key is read from stdin and never from `argv`.
|
|
70
73
|
|
|
71
|
-
`login --browser`
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
`login --browser` opens the console at `/cli/login` and waits for the approval
|
|
75
|
+
on a loopback server; the code never shows in the terminal. `login --paste`
|
|
76
|
+
prints the console URL and reads `code#state` from stdin without echo, for a
|
|
77
|
+
remote session (SSH, Codespaces or Linux without a display). With no flag the
|
|
78
|
+
CLI detects a remote session and picks paste mode, saying which signal it saw;
|
|
79
|
+
`--browser` and `--paste` win over the detection. The session is stored in
|
|
80
|
+
0600 inside a 0700 directory; a file another user can read is rejected with
|
|
81
|
+
`STORAGE_INSECURE` (exit 77).
|
|
74
82
|
|
|
75
|
-
`logout`
|
|
83
|
+
`logout` revokes the session in the server and then removes the local
|
|
84
|
+
credential; if the server does not answer it removes the local one and exits 2.
|
|
85
|
+
`logout --all` revokes every session of the user. `auth sessions list` and
|
|
86
|
+
`auth sessions revoke <session-id>` manage the sessions, and `elevate` renews the
|
|
87
|
+
two-hour step-up that the destructive verbs ask for. With `--json`, errors
|
|
88
|
+
carry a stable `error.code` and the CLI exits 0, 2, 64, 75, 77 or 130.
|
|
89
|
+
|
|
90
|
+
## Sessions and usage
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
nouter-platform sessions list --agent <agent-id> --status idle --since 2026-11-01
|
|
94
|
+
nouter-platform sessions get <session-id>
|
|
95
|
+
nouter-platform sessions events <session-id> --type span.model_request_end
|
|
96
|
+
nouter-platform usage --days 7 --group-by day,model
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`sessions` reads agent sessions, not the login sessions of `auth sessions`.
|
|
100
|
+
`list` filters by `--agent`, `--agent-version`, `--user-profile`, `--status`,
|
|
101
|
+
`--since`/`--until` and `--order`, and `--include-archived` adds the archived
|
|
102
|
+
ones. `get` prints the detail, its stats and its cost, and `events` prints the
|
|
103
|
+
trace of the session, one line per event: a `span.model_request_end` shows the
|
|
104
|
+
tokens of that request, and the body of the model request is not in the API
|
|
105
|
+
yet. The three accept `--json` for the raw response.
|
|
106
|
+
|
|
107
|
+
`usage` reads the cost ledger in one page. `--days 7|30|90` sets the window
|
|
108
|
+
(default 30) or `--since`/`--until` give a range; `--group-by` takes up to five
|
|
109
|
+
of `day`, `model`, `agent`, `agent_version`, `user_profile` and `session`, with
|
|
110
|
+
`day` as the default, and `--user-profile` filters the rows. When the response
|
|
111
|
+
has a `next_page`, the command prints the full command that repeats the page on
|
|
112
|
+
stderr and exits 0; it repeats the `--group-by`, `--since`/`--until`,
|
|
113
|
+
`--user-profile` and `--limit` that were used, because the cursor alone does not
|
|
114
|
+
reproduce the query, and it quotes the cursor when the shell would interpret it.
|
|
115
|
+
`--json` prints the whole response, including `models`, `sessions` and
|
|
116
|
+
`line_items`, and the same warning goes to stderr.
|
|
117
|
+
|
|
118
|
+
`sessions` needs `sessions:read` on a **workspace** credential; an organization
|
|
119
|
+
key gets a 403 `workspace_required`. `usage` needs `usage:read`: an
|
|
120
|
+
organization key sees the whole organization and a workspace key only its own.
|
|
121
|
+
|
|
122
|
+
The two commands report cost in different units, and neither one converts:
|
|
123
|
+
`sessions` shows `usage.list_cost.amount` in cents (`"4"` is `$0.04`), and
|
|
124
|
+
`usage` shows `cost_micros` in micro-USD (`"3402110"` is `$3.402110`).
|
|
76
125
|
|
|
77
126
|
## Apply
|
|
78
127
|
|
|
@@ -115,6 +164,19 @@ change.
|
|
|
115
164
|
preset). A document with `_oma.retention` also needs `agents:admin`, which only
|
|
116
165
|
an `admin` or `owner` login has.
|
|
117
166
|
|
|
167
|
+
## Feedback
|
|
168
|
+
|
|
169
|
+
Report product bugs, feature requests and questions at
|
|
170
|
+
https://github.com/Nouter-ai/feedback. Use the "Bug report / Error", "Feature
|
|
171
|
+
request / Funcionalidad" or "Question / Pregunta" form. In the "Product /
|
|
172
|
+
Producto" field, "This feedback channel / Este canal de feedback" is for
|
|
173
|
+
feedback about the channel itself.
|
|
174
|
+
Only bugs and features of Nouter products.
|
|
175
|
+
What a single customer needs belongs to that customer's implementation, not to
|
|
176
|
+
an issue. Never include customer data. Agents: read
|
|
177
|
+
https://github.com/Nouter-ai/feedback/blob/main/AGENTS.md before opening one.
|
|
178
|
+
Security issues go through the repository's private vulnerability reporting.
|
|
179
|
+
|
|
118
180
|
## License
|
|
119
181
|
|
|
120
182
|
Apache-2.0. See `LICENSE` and `NOTICE`.
|