@feastalytics/cli 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.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # @feastalytics/cli
2
+
3
+ Command-line client for the Feastalytics platform. It exposes the same tool surface the in-app AI agent uses — campaigns, automations, offers, funnels, members-program rewards — as plain commands that hit the production API as the logged-in user.
4
+
5
+ Ships with an [agent skill](#agent-skill) so Claude Code, Codex, and other agents can drive it.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @feastalytics/cli
11
+ ```
12
+
13
+ Or run without installing:
14
+
15
+ ```bash
16
+ npx @feastalytics/cli <command>
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```bash
22
+ feast login <username> # authenticate once; tokens cached in ~/.config/feast-cli
23
+ feast whoami # your user + every organization (with names) you can act on
24
+ feast tools # list every available tool
25
+ feast describe <tool> # a tool's description + input JSON schema
26
+ feast call <tool> --org <organizationId> --input '<json>'
27
+ feast logout
28
+ ```
29
+
30
+ ### The core loop
31
+
32
+ The CLI is the source of truth for which tools exist and what they accept — discover it at runtime rather than assuming:
33
+
34
+ ```bash
35
+ feast tools
36
+ feast describe updateCampaign
37
+ feast call listCampaigns --org <organizationId>
38
+ ```
39
+
40
+ `--input` is validated locally against the tool's JSON schema before anything is sent, so a bad payload fails fast with a clear message.
41
+
42
+ ### Organizations
43
+
44
+ Most tools act on one organization, and you may belong to several. Pass `--org <organizationId>`:
45
+
46
+ - Belong to exactly one org → it's used automatically.
47
+ - Belong to several and omit `--org` → the CLI **errors and lists your orgs** rather than silently picking one. Acting on the wrong org is worse than stopping to ask.
48
+ - A typo'd org id is rejected client-side (it never falls through to a default).
49
+
50
+ Mutations additionally require `--org`, verify the server-resolved org, and prompt for confirmation (`--yes` to skip in scripts).
51
+
52
+ ## Agent skill
53
+
54
+ The `feast/` directory is an [agent skill](https://www.skills.sh) that teaches an agent to operate the CLI. Install it into your agent(s):
55
+
56
+ ```bash
57
+ npx skills add feastalytics/cli
58
+ ```
59
+
60
+ It works across Claude Code, Codex, Cursor, and the other agents the `skills` tool supports.
61
+
62
+ ### Updating the installed skill
63
+
64
+ The skill is **copied** into a global store (`~/.agents/skills/feast`) and symlinked into each agent's skills directory, so it does **not** auto-update when this repo changes. After the skill is updated (or if your agents are showing a stale version), re-run the add to refresh every agent at once:
65
+
66
+ ```bash
67
+ npx skills add feastalytics/cli -g -a '*' -y
68
+ ```
69
+
70
+ - `-g` installs globally (user-level), matching where the skill lives.
71
+ - `-a '*'` re-links **all** agents (Claude Code, Codex, …) so each picks up the new version.
72
+ - `-y` skips the confirmation prompts.
73
+
74
+ To refresh from a local checkout instead of GitHub, run `npx skills add ./feast -g -a '*' -y` from the repo root.
75
+
76
+ ## Environment
77
+
78
+ - `FEAST_API_URL` — override the API base URL (e.g. a local dev server)
79
+ - `FEAST_API_KEY` — override the static API key
80
+
81
+ ## Development
82
+
83
+ ```bash
84
+ npm install
85
+ npm run dev -- tools # run from source via tsx
86
+ pnpm feast tools # same thing via pnpm (no `--` needed)
87
+ npm run build # bundle to dist/cli.js
88
+ npm run typecheck
89
+ ```
90
+
91
+ ### Install the `feast` command locally
92
+
93
+ To get a global `feast` command backed by your local checkout:
94
+
95
+ ```bash
96
+ npm run build # build dist/cli.js first
97
+ npm link # symlink global `feast` -> this repo
98
+ feast tools
99
+ ```
100
+
101
+ `npm link` points the global command at the **built** `dist/cli.js`, so re-run `npm run build` after source changes. To remove it: `npm unlink -g @feastalytics/cli`.
102
+
103
+ The tool manifest (`src/generated/manifest.ts`) is generated from the Feastalytics API in the main monorepo and published here — do not edit it by hand.