@hive3/cli 0.3.0 → 0.5.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 +314 -83
- package/bin/hive.js +8 -0
- package/package.json +6 -4
- package/skills/hive3/SKILL.md +253 -0
- package/skills/hive3/agents/openai.yaml +4 -0
- package/src/api-client.js +79 -11
- package/src/area-commands.js +348 -0
- package/src/commands.js +107 -59
- package/src/config.js +56 -11
- package/src/conversations-client.js +18 -0
- package/src/conversations-commands.js +103 -0
- package/src/extended-commands.js +15 -44
- package/src/feedback-client.js +15 -0
- package/src/feedback-commands.js +148 -0
- package/src/feedback-replay.js +43 -0
- package/src/login.js +93 -16
- package/src/payments-client.js +13 -0
- package/src/payments-commands.js +127 -0
- package/src/selling-client.js +24 -0
- package/src/selling-commands.js +157 -0
- package/src/shared.js +102 -0
- package/src/skill.js +212 -0
- package/src/stripe-client.js +16 -0
- package/src/stripe-commands.js +63 -0
- package/src/team-client.js +11 -0
- package/src/team-commands.js +84 -0
- package/src/update.js +30 -17
- package/src/usage.js +305 -12
package/src/usage.js
CHANGED
|
@@ -1,41 +1,113 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
+
import { teamUsage } from "./team-commands.js";
|
|
4
|
+
import { stripeUsage } from "./stripe-commands.js";
|
|
5
|
+
import { feedbackUsage } from "./feedback-commands.js";
|
|
6
|
+
import { paymentsUsage } from "./payments-commands.js";
|
|
7
|
+
import { conversationsUsage } from "./conversations-commands.js";
|
|
8
|
+
import { sellingUsage } from "./selling-commands.js";
|
|
9
|
+
|
|
3
10
|
export function usage() {
|
|
4
11
|
return [
|
|
5
|
-
"Usage:
|
|
12
|
+
"Usage: hive3 <command> [options]",
|
|
13
|
+
"",
|
|
14
|
+
"Run `hive3 <command> --help` for the actions and flags of one command.",
|
|
6
15
|
"",
|
|
7
16
|
"Commands:",
|
|
8
17
|
" login Connect this CLI through browser approval",
|
|
9
|
-
" logout
|
|
18
|
+
" logout Revoke this CLI key and remove the stored local credential",
|
|
10
19
|
" update [--check] Install or check for the latest Hive CLI",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
20
|
+
" skill <action> Install the Hive3 agent skill for Claude Code, Codex or Cursor (hive3 skill install)",
|
|
21
|
+
" whoami Show the authenticated Hive account and the accounts this key can act on",
|
|
22
|
+
" capabilities List the accounts this key can act on and what it may do there",
|
|
13
23
|
" profile <action> Manage profile text, media IDs, access, and builders; add --account <id-or-handle> for an account you help run",
|
|
14
24
|
" upload <file> Upload an allowed image or document and print its storage ID",
|
|
15
|
-
" account <action> Manage account preferences, exports, and
|
|
25
|
+
" account <action> Manage account preferences, exports, and linked communities",
|
|
16
26
|
" wallets <action> Manage linked wallet visibility/default selection",
|
|
17
27
|
" nfts <action> Manage public NFT exposure",
|
|
18
|
-
" notifications <action> Manage notifications and notification mutes",
|
|
28
|
+
" notifications <action> Manage notifications, unread count, and notification mutes",
|
|
19
29
|
" comments <action> Manage post comments",
|
|
20
|
-
" communities <action>
|
|
30
|
+
" communities <action> Manage community membership and role-derived admin actions",
|
|
21
31
|
" posts <action> Manage posts",
|
|
22
32
|
" events <action> Manage events",
|
|
33
|
+
" worlds [--account a] List the 3D worlds an account's events may book, with the ID to pass to events --world",
|
|
23
34
|
" courses <action> Manage courses",
|
|
24
35
|
" content <action> Manage content",
|
|
25
36
|
" quests <action> Manage quests",
|
|
26
37
|
" jobs <action> Manage jobs",
|
|
38
|
+
" search <query> Search accounts, events, courses, content, quests and jobs",
|
|
39
|
+
" broadcasts <action> Draft, test, schedule and send broadcast emails to an account's members",
|
|
40
|
+
" tickets <action> Create, attach, edit and deactivate sold tickets; view purchased tickets",
|
|
41
|
+
" assistant <action> Manage an account's AI assistant and its knowledge documents",
|
|
42
|
+
" credentials <action> View credentials, award custom credentials, list yours and claimable ones",
|
|
43
|
+
" team <area> <action> Manage Team Tools (current staff only)",
|
|
44
|
+
" stripe <action> Set up and manage the account's Stripe Connect connection",
|
|
45
|
+
" feedback <action> Submit bugs/suggestions and follow up on support tickets",
|
|
46
|
+
" products <action> Manage seller products",
|
|
47
|
+
" subscriptions <action> Manage seller subscription plans",
|
|
48
|
+
" payments <action> View payment history and preview/confirm checkout, subscription and refund workflows",
|
|
49
|
+
" conversations <action> Read and write your DMs and accessible community conversations with separate consent",
|
|
50
|
+
"",
|
|
51
|
+
"Options:",
|
|
52
|
+
" -v, --version Print the CLI version",
|
|
53
|
+
" -h, --help Show help",
|
|
27
54
|
"",
|
|
28
|
-
"Resource
|
|
55
|
+
"Resource actions (posts, events, courses, content, quests, jobs):",
|
|
29
56
|
" list [--limit n] [--cursor c] [--owner-type person|community] [--community-id id]",
|
|
57
|
+
" get <id>",
|
|
30
58
|
" create [--title t] [--body b] [--description d] [--content-type t] [--visibility v]",
|
|
31
59
|
" update <id> [--title t] [--body b] [--description d] [--content-type t] [--visibility v]",
|
|
32
|
-
" archive <id>
|
|
60
|
+
" archive <id>",
|
|
61
|
+
" events create|update also take --world <world-id|default> to book a 3D world; get world IDs from `hive3 worlds`",
|
|
62
|
+
"",
|
|
63
|
+
"Account deletion is not available from the CLI; delete your account in the Hive app under Settings.",
|
|
33
64
|
].join("\n");
|
|
34
65
|
}
|
|
35
66
|
|
|
67
|
+
const ACCOUNT_FLAG_LINE = " --account <id-or-handle> Act on an account you own, administer or moderate instead of your own (once, after the action)";
|
|
68
|
+
|
|
69
|
+
/** @type {Record<string, string[]>} */
|
|
70
|
+
const resourceWorkflowLines = {
|
|
71
|
+
posts: [" like <post-id> Toggle your like on a post"],
|
|
72
|
+
events: [
|
|
73
|
+
" participants <event-id> List RSVPs (managers only)",
|
|
74
|
+
" rsvp <event-id> [--enroll true|false] [--file json] RSVP or withdraw your RSVP",
|
|
75
|
+
" approve|deny <event-id> <enrollment-id> Decide an RSVP",
|
|
76
|
+
" attendance <event-id> <enrollment-id> [--attended true|false] [--file json]",
|
|
77
|
+
],
|
|
78
|
+
courses: [
|
|
79
|
+
" enrollments <course-id> List enrollments (managers only)",
|
|
80
|
+
" enroll <course-id> [--enroll true|false] [--file json] Enroll or withdraw",
|
|
81
|
+
" approve|deny <course-id> <account-id> Decide an enrollment",
|
|
82
|
+
" complete <course-id> <lesson-id> Mark a lesson complete",
|
|
83
|
+
],
|
|
84
|
+
content: [],
|
|
85
|
+
quests: [
|
|
86
|
+
" enrollments <quest-id> List enrollments (managers only)",
|
|
87
|
+
" enroll <quest-id> [--enroll true|false] [--file json] Enroll or withdraw",
|
|
88
|
+
" approve|deny <quest-id> <enrollment-id> Decide an enrollment",
|
|
89
|
+
" evidence list <quest-id> [--status s] List submitted evidence",
|
|
90
|
+
" evidence submit <quest-id> --objective-id id [--content text] [--file json]",
|
|
91
|
+
" evidence approve|deny <quest-id> <evidence-id> Decide evidence",
|
|
92
|
+
],
|
|
93
|
+
jobs: [
|
|
94
|
+
" apply <job-id> --file application.json Apply (the file must include a resume)",
|
|
95
|
+
" applications [job-id] List applications (managers only)",
|
|
96
|
+
" status <application-id> --status <pending|reviewed|accepted|rejected>",
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
|
|
36
100
|
export function resourceUsage(kind) {
|
|
37
101
|
return [
|
|
38
|
-
`Usage:
|
|
102
|
+
`Usage: hive3 ${kind} <action> [options]`,
|
|
103
|
+
"",
|
|
104
|
+
"Actions:",
|
|
105
|
+
" list [--limit n] [--cursor c] [--owner-type person|community] [--community-id id]",
|
|
106
|
+
" get <id>",
|
|
107
|
+
" create [fields] [--owner-type person|community --community-id id] [--idempotency-key key]",
|
|
108
|
+
" update <id> [fields]",
|
|
109
|
+
" archive <id>",
|
|
110
|
+
...(resourceWorkflowLines[kind] ?? []),
|
|
39
111
|
"",
|
|
40
112
|
"Create/update fields:",
|
|
41
113
|
" --title <text>",
|
|
@@ -44,11 +116,232 @@ export function resourceUsage(kind) {
|
|
|
44
116
|
" --content-type <type>",
|
|
45
117
|
" --image-url <url>",
|
|
46
118
|
" --visibility <public|protected|private>",
|
|
47
|
-
"
|
|
119
|
+
...(kind === "events" ? [
|
|
120
|
+
" --world <world-id|default> Book a 3D world: the ID of the world the user named, from `hive3 worlds`;",
|
|
121
|
+
" default is the owning account's default world",
|
|
122
|
+
] : []),
|
|
123
|
+
" --file <json> JSON object merged with the flags above",
|
|
48
124
|
"",
|
|
49
|
-
"Create owner fields:",
|
|
125
|
+
"Create owner fields (managed accounts only after `hive3 capabilities` shows them):",
|
|
50
126
|
" --owner-type <person|community>",
|
|
51
127
|
" --community-id <id>",
|
|
52
128
|
" --idempotency-key <key>",
|
|
129
|
+
"",
|
|
130
|
+
"--account is not supported here; use --owner-type/--community-id to create for another account.",
|
|
53
131
|
].join("\n");
|
|
54
132
|
}
|
|
133
|
+
|
|
134
|
+
const ACCOUNT_OPTION_LINES = [
|
|
135
|
+
"Account targeting (where shown): --account <id-or-handle> acts on an account you own, administer or moderate instead of your own.",
|
|
136
|
+
" Reads need communities:read, writes communities:write, plus a live owner/admin/moderator role.",
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
/** @type {Record<string, string[]>} */
|
|
140
|
+
const commandUsageLines = {
|
|
141
|
+
skill: [
|
|
142
|
+
"Usage: hive3 skill <action> [options]",
|
|
143
|
+
"",
|
|
144
|
+
"Actions:",
|
|
145
|
+
" install [--agent claude|codex|cursor] [--project] [--dir <path>] [--force]",
|
|
146
|
+
" Install the bundled Hive3 agent skill so your coding agent knows how to use this CLI",
|
|
147
|
+
" path [--agent a] [--project] [--dir <path>]",
|
|
148
|
+
" Print where `install` would put the skill",
|
|
149
|
+
" show Print the skill (SKILL.md)",
|
|
150
|
+
"",
|
|
151
|
+
"Options:",
|
|
152
|
+
" --agent <name> claude (default), codex or cursor",
|
|
153
|
+
" --project Install for the current directory only instead of your user account",
|
|
154
|
+
" --dir <path> Install into this skills directory (as <path>/hive3); use it for any other agent",
|
|
155
|
+
" --force Replace an existing, different hive3 skill",
|
|
156
|
+
"",
|
|
157
|
+
"Skills directories:",
|
|
158
|
+
" claude ~/.claude/skills/hive3 (--project: ./.claude/skills/hive3)",
|
|
159
|
+
" codex ~/.agents/skills/hive3 (--project: ./.agents/skills/hive3)",
|
|
160
|
+
" cursor ~/.cursor/skills/hive3 (--project: ./.cursor/skills/hive3)",
|
|
161
|
+
"",
|
|
162
|
+
"Restart your agent after installing if it was already running.",
|
|
163
|
+
"Invoke the skill as /hive3 (Claude Code, Cursor) or $hive3 (Codex).",
|
|
164
|
+
],
|
|
165
|
+
logout: [
|
|
166
|
+
"Usage: hive3 logout",
|
|
167
|
+
"",
|
|
168
|
+
"Revokes this CLI key on the server (DELETE /account/keys/current) and removes the stored local credential.",
|
|
169
|
+
"If the server can't be reached, the local credential is still removed and you are told to revoke the key",
|
|
170
|
+
"under Settings → Help & feedback → Developer API keys (https://app.hive3.tech/settings/api-keys).",
|
|
171
|
+
],
|
|
172
|
+
whoami: [
|
|
173
|
+
"Usage: hive3 whoami",
|
|
174
|
+
"",
|
|
175
|
+
"Shows the signed-in account, the key's scopes and the accounts this key can act on. Needs account:read.",
|
|
176
|
+
],
|
|
177
|
+
capabilities: [
|
|
178
|
+
"Usage: hive3 capabilities",
|
|
179
|
+
"",
|
|
180
|
+
"Lists the accounts this key can act on, with your role and the actions allowed on each. Needs communities:read.",
|
|
181
|
+
],
|
|
182
|
+
search: [
|
|
183
|
+
"Usage: hive3 search <query> [--type all|accounts|events|courses|content|quests|jobs] [--limit 1-50] [--cursor c]",
|
|
184
|
+
"",
|
|
185
|
+
"Searches what your account can see. The query is 1-100 characters; quote it or pass several words.",
|
|
186
|
+
"Needs the resources:read scope.",
|
|
187
|
+
],
|
|
188
|
+
worlds: [
|
|
189
|
+
"Usage: hive3 worlds [--account <id-or-handle>]",
|
|
190
|
+
"",
|
|
191
|
+
"Lists the 3D worlds the account's events may book: { worlds: [{ id, name, kind, isDefault }], needsDedicatedSetup }.",
|
|
192
|
+
"kind is shared (a Hive3 venue such as Hive3 Dome or Night Lounge) or dedicated (the account's own world).",
|
|
193
|
+
"isDefault marks the world `--world default` books. Pass the id of the world the user named to `events create --world <id>`;",
|
|
194
|
+
"if it isn't listed, that account can't book it. An empty list means the plan includes no world; needsDedicatedSetup means",
|
|
195
|
+
"a Royal Hive account must choose its own world's design on the dashboard first.",
|
|
196
|
+
"Needs resources:read.",
|
|
197
|
+
...ACCOUNT_OPTION_LINES,
|
|
198
|
+
],
|
|
199
|
+
broadcasts: [
|
|
200
|
+
"Usage: hive3 broadcasts <action> [options]",
|
|
201
|
+
"",
|
|
202
|
+
"Actions:",
|
|
203
|
+
" list [--account a] [--limit n] [--cursor c]",
|
|
204
|
+
" audience [--account a] Recipient count and when you may next send",
|
|
205
|
+
" get <id>",
|
|
206
|
+
" create --subject <s> --body-text <t> [--body-html h] [--body-mode editor|html] [--hero-image-url u]",
|
|
207
|
+
" [--file json] [--idempotency-key k] [--account a] Creates a draft (flags override --file)",
|
|
208
|
+
" update <id> [--subject s] [--body-text t] [--body-html h] [--body-mode m] [--hero-image-url u | --remove-hero-image] [--file json] Drafts only",
|
|
209
|
+
" test <id> Email the draft to your own address only",
|
|
210
|
+
" send <id> --yes [--at <ISO-8601 date-time>] Email opted-in members now, or schedule it",
|
|
211
|
+
" cancel <id> Return a scheduled broadcast to draft",
|
|
212
|
+
"",
|
|
213
|
+
"send emails every opted-in member (up to 5,000) and can't be undone once it starts, so it requires --yes.",
|
|
214
|
+
"Sending is limited by plan: Honey Bee every 30 days, Swarm 14, Royal 7. Worker Bee can't send.",
|
|
215
|
+
"Needs broadcasts:read / broadcasts:write and an owner, admin or moderator role.",
|
|
216
|
+
...ACCOUNT_OPTION_LINES,
|
|
217
|
+
],
|
|
218
|
+
assistant: [
|
|
219
|
+
"Usage: hive3 assistant <action> [options]",
|
|
220
|
+
"",
|
|
221
|
+
"Actions:",
|
|
222
|
+
" get [--account a]",
|
|
223
|
+
" update [--name n] [--description d] [--avatar-url u] [--visibility public|protected|private] [--account a]",
|
|
224
|
+
" documents [list] [--account a]",
|
|
225
|
+
" documents add <file> [--content-type mime] [--idempotency-key k] [--account a] PDF, DOCX or plain text, up to 5 MB",
|
|
226
|
+
" documents delete <document-id> --confirm <document-id>",
|
|
227
|
+
"",
|
|
228
|
+
"The AI assistant needs a Honey Bee or higher account. Chatting with the assistant is not available from the CLI.",
|
|
229
|
+
"Needs ai:read / ai:write.",
|
|
230
|
+
...ACCOUNT_OPTION_LINES,
|
|
231
|
+
],
|
|
232
|
+
credentials: [
|
|
233
|
+
"Usage: hive3 credentials <action> [options]",
|
|
234
|
+
"",
|
|
235
|
+
"Actions:",
|
|
236
|
+
" list [--account a] [--limit n] [--cursor c] Credentials an account issues",
|
|
237
|
+
" get <id>",
|
|
238
|
+
" award <id> --handles <@a,b,...> --yes Award a custom credential to 1-50 accounts",
|
|
239
|
+
" mine Credentials you hold",
|
|
240
|
+
" claimable [--limit n] [--cursor c] Credentials awarded to you but not yet claimed",
|
|
241
|
+
"",
|
|
242
|
+
"award can't be undone through the CLI, so it requires --yes. Creating, minting, deploying and claiming credentials are not available from the CLI.",
|
|
243
|
+
"Needs credentials:read / credentials:write.",
|
|
244
|
+
...ACCOUNT_OPTION_LINES,
|
|
245
|
+
],
|
|
246
|
+
profile: [
|
|
247
|
+
"Usage: hive3 profile <action> [options]",
|
|
248
|
+
"",
|
|
249
|
+
"Actions:",
|
|
250
|
+
" get",
|
|
251
|
+
" update [--name n] [--username h] [--title t] [--experience e] [--short-description d] [--description d]",
|
|
252
|
+
" [--location l] [--image-storage-id id] [--hero-image-storage-id id] [--attachment-storage-id id]",
|
|
253
|
+
" [--show-collaborator-count true|false] [--custom-collaborator-count n] [--badges a,b] [--socials-json json]",
|
|
254
|
+
" handle <handle> Check whether a handle is available",
|
|
255
|
+
" access --type <open|private|open-subscription|private-subscription> [--subscription-id id]",
|
|
256
|
+
" overview|widgets|welcome-page get",
|
|
257
|
+
" overview|widgets|welcome-page save|import --file <json>",
|
|
258
|
+
" overview|widgets|welcome-page export --file <output-path>",
|
|
259
|
+
"",
|
|
260
|
+
"Options for every action above:",
|
|
261
|
+
ACCOUNT_FLAG_LINE,
|
|
262
|
+
" Reads need the communities:read scope, writes communities:write, plus a live owner/admin/moderator role.",
|
|
263
|
+
" Moderators can't change roles or anything involving payments.",
|
|
264
|
+
],
|
|
265
|
+
upload: [
|
|
266
|
+
"Usage: hive3 upload <file> [--purpose image|document] [--content-type mime]",
|
|
267
|
+
"",
|
|
268
|
+
"Uploads as the signed-in account (--account is not supported); attach the returned storage ID to a profile, resource or workflow payload.",
|
|
269
|
+
"Images: GIF, JPEG, PNG, WebP up to 8 MB. Documents: PDF, DOC, DOCX, Markdown, plain text up to 25 MB.",
|
|
270
|
+
],
|
|
271
|
+
account: [
|
|
272
|
+
"Usage: hive3 account <action> [options]",
|
|
273
|
+
"",
|
|
274
|
+
"Actions:",
|
|
275
|
+
" get",
|
|
276
|
+
" preferences [--theme t] [--muted-notifications a,b]",
|
|
277
|
+
" export Full account archive; requires all included domain read scopes",
|
|
278
|
+
" linked-communities [list]",
|
|
279
|
+
" linked-communities disconnect <community-id> --confirm <community-id>",
|
|
280
|
+
"",
|
|
281
|
+
"Account deletion is not exposed by the CLI, including Team Tools.",
|
|
282
|
+
"Always acts as the signed-in account (--account is not supported).",
|
|
283
|
+
],
|
|
284
|
+
wallets: [
|
|
285
|
+
"Usage: hive3 wallets <action> [options]",
|
|
286
|
+
"",
|
|
287
|
+
"Actions:",
|
|
288
|
+
" list",
|
|
289
|
+
" default <address>",
|
|
290
|
+
" visibility <address> --public true|false",
|
|
291
|
+
" remove <address> --confirm <address>",
|
|
292
|
+
],
|
|
293
|
+
nfts: ["Usage: hive3 nfts visibility --public true|false"],
|
|
294
|
+
notifications: [
|
|
295
|
+
"Usage: hive3 notifications <action> [options]",
|
|
296
|
+
"",
|
|
297
|
+
"Actions:",
|
|
298
|
+
" list [--limit n] [--offset n] [--unread-only]",
|
|
299
|
+
" unread-count",
|
|
300
|
+
" read <id>",
|
|
301
|
+
" read-all",
|
|
302
|
+
" delete <id>",
|
|
303
|
+
" mutes [list]",
|
|
304
|
+
" mutes set --scope <scope> --muted true|false [--scope-id id]",
|
|
305
|
+
],
|
|
306
|
+
comments: [
|
|
307
|
+
"Usage: hive3 comments <action> [options]",
|
|
308
|
+
"",
|
|
309
|
+
"Actions:",
|
|
310
|
+
" list --post-id <id> [--limit n] [--cursor c]",
|
|
311
|
+
" create --post-id <id> --content <text> [--image-url url]",
|
|
312
|
+
" update <id> --content <text>",
|
|
313
|
+
" delete <id>",
|
|
314
|
+
" like <id>",
|
|
315
|
+
],
|
|
316
|
+
communities: [
|
|
317
|
+
"Usage: hive3 communities <action> [options]",
|
|
318
|
+
"",
|
|
319
|
+
"Actions:",
|
|
320
|
+
" join|apply|leave <community-id> [--message text]",
|
|
321
|
+
" applications <community-id> Moderators and above",
|
|
322
|
+
" approve|deny <application-id> Moderators and above",
|
|
323
|
+
" members <community-id> Moderators and above",
|
|
324
|
+
" role <community-id> <account-id> --role <admin|moderator|member> Owners and admins",
|
|
325
|
+
" remove-member <community-id> <account-id> --confirm <account-id> Moderators and above",
|
|
326
|
+
" access <community-id> --type <type> [--subscription-id id]",
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/** @type {Record<string, () => string>} */
|
|
331
|
+
const dynamicUsage = {
|
|
332
|
+
team: teamUsage,
|
|
333
|
+
stripe: stripeUsage,
|
|
334
|
+
feedback: feedbackUsage,
|
|
335
|
+
payments: paymentsUsage,
|
|
336
|
+
conversations: conversationsUsage,
|
|
337
|
+
products: sellingUsage,
|
|
338
|
+
subscriptions: sellingUsage,
|
|
339
|
+
tickets: sellingUsage,
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
/** @param {string} command */
|
|
343
|
+
export function commandUsage(command) {
|
|
344
|
+
if (Object.hasOwn(dynamicUsage, command)) return dynamicUsage[command]();
|
|
345
|
+
const lines = Object.hasOwn(commandUsageLines, command) ? commandUsageLines[command] : undefined;
|
|
346
|
+
return lines ? lines.join("\n") : undefined;
|
|
347
|
+
}
|