@sendhoney/cli 0.1.2 → 0.1.3

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 (2) hide show
  1. package/README.md +99 -32
  2. package/package.json +21 -10
package/README.md CHANGED
@@ -1,20 +1,43 @@
1
- # SendHoney CLI
1
+ # @sendhoney/cli
2
2
 
3
- Authenticated API and operations CLI for SendHoney tech teams. It follows the
4
- small launcher pattern used by the GameDay and Decoded CLIs, while keeping API
5
- behavior server-side.
3
+ SendHoney platform CLI for authenticated API, CRUD, release, and ThunderCompute operations. Follows the small launcher pattern used by the GameDay and Decoded CLIs, while keeping API behavior server-side.
6
4
 
7
- Run `sendhoney` with no arguments for the interactive resource menu. It groups
8
- the generated endpoint contract by domain and resource, hides service-only
9
- routes by default, prompts for route parameters and JSON, and confirms deletes.
10
- Use `sendhoney menu --operator` for service routes.
5
+ ---
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # npm (latest)
11
+ npm install -g @sendhoney/cli
12
+
13
+ # npm (pinned)
14
+ npm install -g @sendhoney/cli@0.1.3
15
+
16
+ # Homebrew
17
+ brew tap sendhoney/tap && brew install sendhoney
18
+
19
+ # curl installer
20
+ curl -fsSL https://sendhoney.app/cli/install.sh | bash
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Quick start
11
26
 
12
27
  ```bash
28
+ # 1. Generate the endpoint contract catalog
13
29
  pnpm --filter @sendhoney/cli generate-catalog
14
- # Opens Keycloak in the browser and completes a PKCE login through localhost.
15
- node apps/sendhoney-cli/bin/sendhoney login
16
- # CI/service account alternative:
30
+
31
+ # 2. Log in (opens Keycloak PKCE in the browser via localhost)
32
+ sendhoney login
33
+
34
+ # 3. CI / service account alternative (token never printed)
17
35
  sendhoney login --token "$SENDHONEY_TOKEN"
36
+
37
+ # 4. Browse and call API resources interactively
38
+ sendhoney menu
39
+
40
+ # 5. Non-interactive examples
18
41
  sendhoney resources list
19
42
  sendhoney resources current
20
43
  sendhoney endpoints list
@@ -37,28 +60,72 @@ sendhoney credentials update --id CREDENTIAL_ID --json @rotated-credential.json
37
60
  sendhoney credentials validate --secret-refs @secret-refs.json
38
61
  ```
39
62
 
40
- Installation:
63
+ ---
64
+
65
+ ## Commands
66
+
67
+ | Command | Description |
68
+ |---------|-------------|
69
+ | `login [--token TOKEN] \| [--username USER --password PASS]` | Keycloak PKCE browser login or direct token/password auth |
70
+ | `logout` | Clear stored credentials |
71
+ | `whoami` | Return the authenticated user profile |
72
+ | `menu [--operator]` | Interactive resource menu grouped by domain |
73
+ | `resources list \| current` | List organization modules / current org |
74
+ | `endpoints list` | List published API endpoints |
75
+ | `billing balance [--org-id ID]` | Organization billing balance |
76
+ | `billing ledger [--org-id ID]` | Organization billing ledger |
77
+ | `billing rates` | Billing rate card |
78
+ | `api catalog [--search TEXT] [--method GET]` | Search/filter endpoint catalog |
79
+ | `api get\|post\|put\|patch\|delete PATH [--json JSON]` | Direct API request |
80
+ | `crud PATH list\|create\|update\|delete [--id ID] [--json JSON] [--yes]` | Generic CRUD against any API path |
81
+ | `credentials list [--tenant-id ID]` | List tenant-scoped channel credentials (metadata only) |
82
+ | `credentials add [--type TYPE] [--json JSON\|@FILE]` | Add a new credential |
83
+ | `credentials update --id ID [--json JSON\|@FILE]` | Rotate/update an existing credential |
84
+ | `credentials validate --secret-refs @FILE \| --secret-ref REF` | Validate secret references |
85
+ | `thundercompute catalog\|health\|models\|status\|pull\|ensure\|chat` | ThunderCompute / RunPod AI model operations |
86
+ | `release check [--platform android\|ios\|all]` | Check mobile release readiness |
87
+
88
+ ---
89
+
90
+ ## Authentication
91
+
92
+ `sendhoney login` uses Keycloak Authorization Code + PKCE and refreshes expired access tokens automatically. Use `SENDHONEY_TOKEN` for CI / service accounts.
93
+
94
+ Credentials are stored in `$XDG_CONFIG_HOME/sendhoney/config.json` (or `~/.config/sendhoney/config.json`) with mode `0600`; tokens are never printed by the CLI.
95
+
96
+ ---
97
+
98
+ ## Credentials
99
+
100
+ Credential operations are tenant-scoped through the SendHoney API. `list` returns metadata only; secret references and payload fields are redacted from CLI output. `add` and `update` send `secretPayload` to the server, where it is stored through the configured secret manager. Use `@file` for payloads so credentials do not enter shell history. `update` rotates the secret reference on the existing credential record without retrieving the secret value.
101
+
102
+ ---
103
+
104
+ ## Expert interface
105
+
106
+ The expert interface is the Go program in `apps/sendhoney-tui`. It shares this config file and speaks to the module-agent routes. See `docs/SENDHONEY_TUI.md`. npm, Homebrew, and the curl installer do not install that binary.
107
+
108
+ ---
109
+
110
+ ## Publishing
111
+
112
+ Maintained in the `sendhoney-api-monorepo-oatpp-v2` repo under `apps/sendhoney-cli`.
113
+ Publish to npmjs via **staged publishing** (matches the SendHoney deployment flow):
114
+
115
+ 1. Stage the package (uploaded to npm staging, not yet public):
116
+ ```bash
117
+ pnpm --filter @sendhoney/cli generate-catalog
118
+ cd apps/sendhoney-cli
119
+ npm stage publish --access public
120
+ ```
121
+ 2. Log in to https://www.npmjs.com
122
+ 3. Go to https://www.npmjs.com/package/@sendhoney/cli
123
+ 4. Promote the staged version from **Staging → Public**
124
+
125
+ Alternatively, run the publish script which stages and prints the promotion link:
41
126
 
42
127
  ```bash
43
- npm install -g @sendhoney/cli
44
- brew tap sendhoney/tap && brew install sendhoney
45
- curl -fsSL https://sendhoney.app/cli/install.sh | bash
128
+ ./scripts/publish-sendhoney-cli.sh
46
129
  ```
47
130
 
48
- `sendhoney login` uses Keycloak Authorization Code + PKCE and refreshes expired
49
- access tokens automatically. Use `SENDHONEY_TOKEN` for CI/service accounts.
50
- Credentials are stored in
51
- `$XDG_CONFIG_HOME/sendhoney/config.json` (or `~/.config/sendhoney/config.json`)
52
- with mode `0600`; tokens are never printed by the CLI.
53
-
54
- Credential operations are tenant-scoped through the SendHoney API. `list`
55
- returns metadata only; secret references and payload fields are redacted from
56
- CLI output. `add` and `update` send `secretPayload` to the server, where it is
57
- stored through the configured secret manager. Use `@file` for payloads so
58
- credentials do not enter shell history. `update` rotates the secret reference
59
- on the existing credential record without retrieving the secret value.
60
-
61
- The expert interface is the Go program in `apps/sendhoney-tui`. It shares
62
- this config file and speaks to the module-agent routes. See
63
- `docs/SENDHONEY_TUI.md`. npm, Homebrew, and the curl installer do not
64
- install that binary.
131
+ npm disallows republishing an already-published version, so always bump `version` in `package.json` before staging.
package/package.json CHANGED
@@ -1,20 +1,31 @@
1
1
  {
2
2
  "name": "@sendhoney/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "SendHoney platform CLI for authenticated API, CRUD, release, and ThunderCompute operations.",
5
5
  "private": false,
6
- "bin": { "sendhoney": "bin/sendhoney" },
7
- "files": ["bin/", "scripts/", "README.md", "endpoints.json"],
8
- "scripts": {
9
- "generate-catalog": "node scripts/generate-catalog.mjs",
10
- "postinstall": "node scripts/postinstall.js"
6
+ "bin": {
7
+ "sendhoney": "bin/sendhoney"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "scripts/",
12
+ "README.md",
13
+ "endpoints.json"
14
+ ],
15
+ "engines": {
16
+ "node": ">=22"
11
17
  },
12
- "engines": { "node": ">=22" },
13
18
  "license": "UNLICENSED",
14
- "publishConfig": { "access": "public" },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
15
22
  "repository": {
16
23
  "type": "git",
17
24
  "url": "https://gitea.sendhoney.app/sendhoney/sendhoney-api-monorepo-oatpp-v2"
18
25
  },
19
- "homepage": "https://sendhoney.app/docs/cli"
20
- }
26
+ "homepage": "https://sendhoney.app/docs/cli",
27
+ "scripts": {
28
+ "generate-catalog": "node scripts/generate-catalog.mjs",
29
+ "postinstall": "node scripts/postinstall.js"
30
+ }
31
+ }