@openbsp/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.
Files changed (3) hide show
  1. package/README.md +63 -2
  2. package/openbsp.mjs +385 -0
  3. package/package.json +30 -4
package/README.md CHANGED
@@ -1,3 +1,64 @@
1
- # Temporary Holding Version
1
+ # @openbsp/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
+ Read and answer your WhatsApp, Instagram, TikTok and Slack messages, and reach
4
+ the whole [OpenBSP](https://openbsp.dev) API, from the terminal: for you, your
5
+ scripts, and any agent with a shell.
6
+
7
+ ```bash
8
+ npx @openbsp/cli login # or: npm install -g @openbsp/cli
9
+ openbsp inbox # what people wrote since the last check
10
+ openbsp reply <conversation> "Yes, we have one left."
11
+ ```
12
+
13
+ ## Signing in
14
+
15
+ `openbsp login` signs in with Google in your browser (`--github` for GitHub); a
16
+ first sign-in creates your account. The session stays in `~/.openbsp`.
17
+
18
+ On a server or in CI, set `OPENBSP_API_KEY` to an organization's API key
19
+ (OpenBSP > Settings > API Keys) instead. A reply sent with a key goes out as the
20
+ organization rather than as a member.
21
+
22
+ ## Commands
23
+
24
+ | Command | What it does |
25
+ | ----------------------------------------------- | ----------------------------------------------------------- |
26
+ | `openbsp status [--json]` | Who is signed in, the organization, its connected accounts |
27
+ | `openbsp orgs [--json]` | Your organizations and the invitations waiting for you |
28
+ | `openbsp orgs use <id\|name>` | Work in another organization |
29
+ | `openbsp orgs create <name>` | Create one |
30
+ | `openbsp orgs join [invitation]` | Accept an invitation |
31
+ | `openbsp inbox [--since 2h]` | What people wrote since the last check |
32
+ | `openbsp inbox <conversation>` | One conversation, opened |
33
+ | `openbsp reply <conversation> [text]` | Send a text; without one, it reads stdin |
34
+ | `openbsp publish <account> <media> [caption]` | Publish a post on Instagram or TikTok: a file or a URL |
35
+ | `openbsp api [method] <path> [-d json] [-H ..]` | Call the API: `/rest/v1/…` (PostgREST) or `/functions/v1/…` |
36
+ | `openbsp docs` | The API reference |
37
+
38
+ `--since` reads from a time or an age without moving the inbox's place, so the
39
+ next plain `openbsp inbox` still has everything new. `--reply-to <message>`
40
+ answers a given message: a thread on Slack, a quote elsewhere, a public answer
41
+ to an Instagram or TikTok comment.
42
+
43
+ `publish` posts an image (JPEG) as a feed post or a video as a reel on
44
+ Instagram, where `--story` makes either a story, and a video or a JPEG or WebP
45
+ photo on TikTok; and `--at 2026-12-01T15:00:00Z` schedules it. It prints the
46
+ publication's id: deleting that conversation
47
+ (`openbsp api DELETE "/rest/v1/conversations?id=eq.<id>"`) cancels a post not
48
+ published yet.
49
+
50
+ `api` prints the response as JSON and exits 1 on an error status, with the error
51
+ on stderr. `-d` takes JSON, `@file` or `-` (stdin):
52
+
53
+ ```bash
54
+ openbsp api "/rest/v1/conversations?select=id,name,service&limit=5"
55
+ openbsp api post /rest/v1/rpc/text_limit -d '{"service":"instagram","type":"text"}'
56
+ ```
57
+
58
+ Nothing asks before sending: whoever runs the command approves it. To have
59
+ Claude ask you before each answer goes out, use the
60
+ [Claude Code plugin](https://github.com/matiasbattocchia/open-bsp-api/tree/main/plugin)
61
+ instead.
62
+
63
+ `SUPABASE_URL` and `SUPABASE_ANON_KEY` point it at another OpenBSP backend, such
64
+ as a local one.