@himring/cli 0.0.0-stage → 0.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ ## 0.2.0 (2026-11-29)
2
+
3
+ ### Features
4
+
5
+ - **clients:** derive commands and tool exposure from OpenAPI ([cdc1d79](https://github.com/himringhq/himring-sdk/commit/cdc1d795a2906c84afc84a38126fbc4590ea4492))
6
+ - **release:** stage npm packages for maintainer approval instead of publishing them ([dc7f331](https://github.com/himringhq/himring-sdk/commit/dc7f3311589fff04f3d839ef8cc194d5500eafbc))
7
+
8
+ ### Fixes
9
+
10
+ - **sdk:** bound file-backed blob uploads and preserve CLI refusal exits ([3aebfd1](https://github.com/himringhq/himring-sdk/commit/3aebfd1292652763bf5296e470d10e74d468337a))
11
+ - **clients:** check released tools and commands against their pinned contract ([1ad5108](https://github.com/himringhq/himring-sdk/commit/1ad510812bcc911efb7b2dc742225ce52e30d192))
12
+
13
+ ### Other changes
14
+
15
+ - update the npm, Python, and agent-hooks dependencies ([6e44985](https://github.com/himringhq/himring-sdk/commit/6e44985da6e7d3b80397b3574980b95f76a6fe58))
16
+ - bump the production group with 2 updates ([daa1ce9](https://github.com/himringhq/himring-sdk/commit/daa1ce9ab2369581a363d169478bb92e2d0f7af8))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Himring, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,55 @@
1
- # Temporary Holding Version
1
+ # @himring/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@himring/cli` installs the `himring` command, which runs the operations of the [Himring](https://himring.ai) API from a shell or a script. It builds the flags and input checks of each command from the operation catalogue that `@himring/sdk` generates from the OpenAPI documents of the API, so its limits match the API that it calls.
4
+
5
+ ```bash
6
+ npm install --global @himring/cli
7
+ himring --help
8
+ ```
9
+
10
+ The CLI works in Node.js 22 or later.
11
+
12
+ ## Sign in or use an API key
13
+
14
+ Set `HIMRING_API_KEY` to the key of a project, and every command sends it. To sign in as a person, pipe the password so that it stays out of your shell history:
15
+
16
+ ```bash
17
+ printf '%s' "$PASSWORD" | himring auth sign-in --email owner@example.com --password-stdin --code 123456
18
+ ```
19
+
20
+ The CLI keeps the session in `credentials.json` inside `HIMRING_CONFIG_DIR`, or inside `$XDG_CONFIG_HOME/himring` or `~/.config/himring` when that variable is unset. It writes the file readable only by you, and it files each session under the API address that issued it, so it never sends a stored session to another address. `himring auth sign-out` ends the session and removes it from the file.
21
+
22
+ ## Run a command
23
+
24
+ Commands take the shape `himring <resource> <verb>`, and each field of the operation becomes a flag. A field that ends in `_id` drops the suffix, so `knowledge_base_id` becomes `--knowledge-base`, and a field that holds JSON takes a file, or `-` for stdin, through a flag that ends in `-file`.
25
+
26
+ ```bash
27
+ export HIMRING_PROJECT=prj_0f3c9a7d5e1b42c6a8d4e2f19b7c6a30
28
+ himring knowledge-bases search --knowledge-base kb_6e2a1c9f4b8d47e3a5c0d9f2b1e7a463 --question "How long do refunds take?"
29
+ himring indexes create --name articles --config-file articles.json
30
+ himring files upload --knowledge-base kb_6e2a1c9f4b8d47e3a5c0d9f2b1e7a463 --folder ./policies --dry-run
31
+ ```
32
+
33
+ The CLI checks every input against the schema of its operation before it sends anything. A file that holds more bytes than the operation takes, a list limit above its maximum, or an ID that would change the request path fails at once with exit code 2, and no request leaves your machine. Commands such as `projects delete` and `files upload --delete` need `--yes`, and the commands that change records take `--dry-run`, which shows the request without sending it.
34
+
35
+ ## Read the output
36
+
37
+ The CLI prints readable text by default. Pass `--output json` to receive one JSON object on the last line of stdout, with `status`, `data`, `error`, and `metadata` fields. A failure carries `error.code`, `error.message`, and `error.suggestion`, and `error.missing_permission` when an API key lacks a permission. The CLI refuses an answer that breaks the documented schema with the code `invalid_response`, and its text output shows control characters from an answer as visible escapes.
38
+
39
+ The exit code tells a script what happened: 0 for success, 2 for invalid input, 3 for a credentials file that it cannot read or write, 4 for a record that does not exist, 5 for a missing or refused credential, 6 for a conflict, 7 for a rate limit, 10 when the API cannot be reached, 11 when a service behind the API is not ready, 12 when the API failed, and 13 when only some files of a folder were sent. `himring --help` lists them in full.
40
+
41
+ ## Download files
42
+
43
+ `himring indexes download`, `himring files download`, and the export commands write the file under the name that the API gives, cleaned so that it stays inside the current folder, or to the path that you pass with `--out`. The CLI writes to a temporary file next to the target and moves it into place only when the whole file has arrived, so a download that you stop with Ctrl-C, that stalls, or that the connection cuts short leaves nothing behind. It refuses to replace a file that exists unless you pass `--force`.
44
+
45
+ ## Environment
46
+
47
+ | Variable | Use |
48
+ | ------------------------ | ---------------------------------------------------------------------------------------------------------- |
49
+ | `HIMRING_API_URL` | The address of the API, in place of `--api-url`. The default is the first server of the OpenAPI documents. |
50
+ | `HIMRING_API_TIMEOUT_MS` | How long each request may take, in place of `--timeout-ms`. |
51
+ | `HIMRING_API_KEY` | The API key of a project, in place of a session. |
52
+ | `HIMRING_SESSION_TOKEN` | A session token, in place of the credentials file. |
53
+ | `HIMRING_PROJECT` | The project ID, in place of `--project`. |
54
+ | `HIMRING_PASSWORD` | The password, in place of `--password-stdin`. |
55
+ | `HIMRING_CONFIG_DIR` | The folder of `credentials.json`. |