@zanfia/cli 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.
- package/README.md +33 -0
- package/dist/index.js +19993 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @zanfia/cli (`zanfia`)
|
|
2
|
+
|
|
3
|
+
Thin HTTP client over the Zanfia Public API.
|
|
4
|
+
|
|
5
|
+
> **Status:** scaffolded. Until the Public API service (`api-service`) is deployed, commands run against a local in-memory mock. Set `ZANFIA_API_URL` to point at a real service, or leave it unset to use the 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
|
+
## Auth resolution order
|
|
21
|
+
|
|
22
|
+
1. `--api-key` flag
|
|
23
|
+
2. `ZANFIA_API_KEY` environment variable
|
|
24
|
+
3. Stored key in `~/.config/zanfia/credentials.json`
|
|
25
|
+
4. Prompt to run `zanfia auth set-key`
|
|
26
|
+
|
|
27
|
+
## Environment
|
|
28
|
+
|
|
29
|
+
| Variable | Purpose |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `ZANFIA_API_URL` | Public API base URL. Unset → mock mode. |
|
|
32
|
+
| `ZANFIA_API_KEY` | API key (overrides stored credentials). |
|
|
33
|
+
| `ZANFIA_CLI_MOCK` | Force mock mode even if `ZANFIA_API_URL` is set. |
|