@openbsp/cli 0.0.0-stage → 0.1.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 +55 -2
  2. package/openbsp.mjs +339 -0
  3. package/package.json +30 -4
package/README.md CHANGED
@@ -1,3 +1,56 @@
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> "Sí, nos queda uno."
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 api [method] <path> [-d json] [-H ..]` | Call the API: `/rest/v1/…` (PostgREST) or `/functions/v1/…` |
35
+ | `openbsp docs` | The API reference |
36
+
37
+ `--since` reads from a time or an age without moving the inbox's place, so the
38
+ next plain `openbsp inbox` still has everything new. `--reply-to <message>`
39
+ answers a given message: a thread on Slack, a quote elsewhere, a public answer
40
+ to an Instagram or TikTok comment.
41
+
42
+ `api` prints the response as JSON and exits 1 on an error status, with the error
43
+ on stderr. `-d` takes JSON, `@file` or `-` (stdin):
44
+
45
+ ```bash
46
+ openbsp api "/rest/v1/conversations?select=id,name,service&limit=5"
47
+ openbsp api post /rest/v1/rpc/text_limit -d '{"service":"instagram","type":"text"}'
48
+ ```
49
+
50
+ Nothing asks before sending: whoever runs the command approves it. To have
51
+ Claude ask you before each answer goes out, use the
52
+ [Claude Code plugin](https://github.com/matiasbattocchia/open-bsp-api/tree/main/plugin)
53
+ instead.
54
+
55
+ `SUPABASE_URL` and `SUPABASE_ANON_KEY` point it at another OpenBSP backend, such
56
+ as a local one.