@zanfia/cli 0.21.0 → 0.25.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 +68 -68
  2. package/dist/index.js +3092 -378
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,68 +1,68 @@
1
- # @zanfia/cli (`zanfia`)
2
-
3
- Thin HTTP client over the Zanfia Public API.
4
-
5
- > **Status:** published to npm as `@zanfia/cli` (bin `zanfia`), talking to the production Workspace API by default (`ZANFIA_CLI_TARGET=prod` bakes the URLs at build time). Set `ZANFIA_API_URL` to target another environment; local `tsx` runs without baked defaults fall back to the in-memory mock.
6
-
7
- ## Local usage
8
-
9
- ```bash
10
- # from the monorepo root, after `pnpm install`
11
- pnpm --filter @zanfia/cli dev products list
12
-
13
- # or run a one-off
14
- pnpm --filter @zanfia/cli dev auth whoami
15
-
16
- # global flags (--json, --verbose, --api-key) must come BEFORE the subcommand:
17
- pnpm --filter @zanfia/cli dev --json products list
18
- ```
19
-
20
- ## System emails
21
-
22
- `zanfia emails` manages the customer-facing emails Zanfia sends in your name (Site → Emails):
23
-
24
- ```bash
25
- zanfia emails list # key, group, status, subject
26
- zanfia emails get purchase-confirmation # subject/headline EN+PL, layout blocks, variables
27
- zanfia emails set purchase-confirmation --subject-pl "Dzięki za zakup {{productName}}"
28
- zanfia emails set access-ending-reminder --disable # optional emails only
29
- zanfia emails set login-code --layout ./layout.json # full EmailBlock[] (inline JSON or file)
30
- zanfia emails set login-code --reset # back to the stock email
31
- zanfia emails branding get
32
- zanfia emails branding set --accent-color "#2563eb" --reply-to none
33
- zanfia emails test purchase-confirmation --lang en # queued to YOUR own address
34
- ```
35
-
36
- Raw HTTP: `GET|PATCH /email-templates`, `POST /email-templates/{key}/test-sends`. Full reference for every
37
- command group: `.claude/skills/zanfia-cli/SKILL.md`.
38
-
39
- ## Community member keys (read-only option)
40
-
41
- A member key acts as a creator's customer in their communities (Community API + the member MCP
42
- tools), never in a workspace. Three ways to get one:
43
-
44
- ```bash
45
- zanfia login --address https://<creator-platform-url> [--read-only] # browser consent on that platform
46
- zanfia join <handle> [--read-only] # public community, emailed code
47
- zanfia auth set-key --api-url <api-community-url> <key> # key from the platform's settings
48
- ```
49
-
50
- `--read-only` (or „Tylko odczyt” when generating a key under **Settings → AI agents** on the
51
- platform) grants `communities:read` only: the key reads and summarizes, and
52
- every write (post, comment, chat, ticket) gets a 403 / a refused MCP tool. `zanfia auth status` and
53
- `zanfia whoami` show the scope, e.g. `scope : communities:read (read-only)`.
54
-
55
- ## Auth resolution order
56
-
57
- 1. `--api-key` flag
58
- 2. `ZANFIA_API_KEY` environment variable
59
- 3. Stored key in `~/.config/zanfia/credentials.json`
60
- 4. Prompt to run `zanfia auth set-key`
61
-
62
- ## Environment
63
-
64
- | Variable | Purpose |
65
- | ----------------- | ------------------------------------------------ |
66
- | `ZANFIA_API_URL` | Public API base URL. Unset → mock mode. |
67
- | `ZANFIA_API_KEY` | API key (overrides stored credentials). |
68
- | `ZANFIA_CLI_MOCK` | Force mock mode even if `ZANFIA_API_URL` is set. |
1
+ # @zanfia/cli (`zanfia`)
2
+
3
+ Thin HTTP client over the Zanfia Public API.
4
+
5
+ > **Status:** published to npm as `@zanfia/cli` (bin `zanfia`), talking to the production Workspace API by default (`ZANFIA_CLI_TARGET=prod` bakes the URLs at build time). Set `ZANFIA_API_URL` to target another environment; local `tsx` runs without baked defaults fall back to the in-memory mock.
6
+
7
+ ## Local usage
8
+
9
+ ```bash
10
+ # from the monorepo root, after `pnpm install`
11
+ pnpm --filter @zanfia/cli dev products list
12
+
13
+ # or run a one-off
14
+ pnpm --filter @zanfia/cli dev auth whoami
15
+
16
+ # global flags (--json, --verbose, --api-key) must come BEFORE the subcommand:
17
+ pnpm --filter @zanfia/cli dev --json products list
18
+ ```
19
+
20
+ ## System emails
21
+
22
+ `zanfia emails` manages the customer-facing emails Zanfia sends in your name (Site → Emails):
23
+
24
+ ```bash
25
+ zanfia emails list # key, group, status, subject
26
+ zanfia emails get purchase-confirmation # subject/headline EN+PL, layout blocks, variables
27
+ zanfia emails set purchase-confirmation --subject-pl "Dzięki za zakup {{productName}}"
28
+ zanfia emails set access-ending-reminder --disable # optional emails only
29
+ zanfia emails set login-code --layout ./layout.json # full EmailBlock[] (inline JSON or file)
30
+ zanfia emails set login-code --reset # back to the stock email
31
+ zanfia emails branding get
32
+ zanfia emails branding set --accent-color "#2563eb" --reply-to none
33
+ zanfia emails test purchase-confirmation --lang en # queued to YOUR own address
34
+ ```
35
+
36
+ Raw HTTP: `GET|PATCH /email-templates`, `POST /email-templates/{key}/test-sends`. Full reference for every
37
+ command group: `.claude/skills/zanfia-cli/SKILL.md`.
38
+
39
+ ## Community member keys (read-only option)
40
+
41
+ A member key acts as a creator's customer in their communities (Community API + the member MCP
42
+ tools), never in a workspace. Three ways to get one:
43
+
44
+ ```bash
45
+ zanfia login --address https://<creator-platform-url> [--read-only] # browser consent on that platform
46
+ zanfia join <handle> [--read-only] # public community, emailed code
47
+ zanfia auth set-key --api-url <api-community-url> <key> # key from the platform's settings
48
+ ```
49
+
50
+ `--read-only` (or „Tylko odczyt” when generating a key under **Settings → AI agents** on the
51
+ platform) grants `communities:read` only: the key reads and summarizes, and
52
+ every write (post, comment, chat, ticket) gets a 403 / a refused MCP tool. `zanfia auth status` and
53
+ `zanfia whoami` show the scope, e.g. `scope : communities:read (read-only)`.
54
+
55
+ ## Auth resolution order
56
+
57
+ 1. `--api-key` flag
58
+ 2. `ZANFIA_API_KEY` environment variable
59
+ 3. Stored key in `~/.config/zanfia/credentials.json`
60
+ 4. Prompt to run `zanfia auth set-key`
61
+
62
+ ## Environment
63
+
64
+ | Variable | Purpose |
65
+ | ----------------- | ------------------------------------------------ |
66
+ | `ZANFIA_API_URL` | Public API base URL. Unset → mock mode. |
67
+ | `ZANFIA_API_KEY` | API key (overrides stored credentials). |
68
+ | `ZANFIA_CLI_MOCK` | Force mock mode even if `ZANFIA_API_URL` is set. |