@@ -16,92 +16,164 @@ pnpm install -g @ekaone/json-cli
1616yarn global add @ekaone/json-cli
1717```
1818
19- ## Usage
19+ ## Setup
2020
21- ```
21+ ``` bash
2222export ANTHROPIC_API_KEY=your_key_here
2323```
2424
25+ > Windows PowerShell: ` $env:ANTHROPIC_API_KEY="your_key_here" `
26+
27+ ---
28+
29+ ## Usage
30+
31+ ### Single intent
2532
2633``` bash
27- // Single intent
2834json-cli " please run tests"
35+ json-cli " please build"
36+ json-cli " check git status"
37+ ```
38+
39+ ### Multi-intent — the fun part 🔥
40+
41+ Chain multiple commands in plain English using ** "then"** , ** "and"** , ** "after that"** :
42+
43+ ``` bash
44+ json-cli " run tests and then build"
2945```
3046
3147``` bash
32- // Multiple intents
33- json-cli " please run tests and build "
48+ json-cli " run typecheck, test, and then check git status "
49+ ```
3450
35- OR
51+ ``` bash
52+ json-cli " please run dev with port 5000"
53+ ```
3654
3755``` bash
38- json-cli " heyy ... run typecheck, test and then check git status "
56+ json-cli " install deps, run tests, then build "
3957```
4058
41- # ## For local development
59+ ### Full release flow in one command 🚀
4260
4361``` bash
44- pnpm install
62+ json-cli " run tests, build, git add all, commit with message 'release v0.1.0', push, then publish "
4563```
4664
47- # ## Usage
65+ ```
66+ 📋 Plan (6 steps):
67+ 1. pnpm test → Run test suite
68+ 2. pnpm build → Build package
69+ 3. git add . → Stage all changes
70+ 4. git commit -m "release v0.1.0" → Commit release
71+ 5. git push → Push to remote
72+ 6. pnpm publish → Publish to npm
73+
74+ Proceed? › y
75+ ```
76+
77+ ### More crazy examples
4878
4979``` bash
50- # Using Claude (default)
51- pnpm dev " install deps and run tests"
80+ # Full dev startup
81+ json-cli " install deps and run dev on port 3000"
82+
83+ # Audit and fix
84+ json-cli " run npm audit, then update all deps"
5285
53- # Using OpenAI
54- pnpm dev " run build and publish " --provider openai
86+ # Branch and commit workflow
87+ json-cli " check git status, add all files, commit with message 'feat: add multi-intent support', then push "
5588
56- # Using Ollama (local)
57- pnpm dev " start dev server" --provider ollama
89+ # Test everything before shipping
90+ json-cli " run typecheck, run tests, build, then publish"
91+
92+ # Clone and install
93+ json-cli " clone https://github.com/ekaone/json-cli and then install deps"
94+
95+ # Check before commit
96+ json-cli " run tests, check git diff, then git add and commit with message 'fix: catalog types'"
97+
98+ # Full CI-like flow locally
99+ json-cli " install deps, run typecheck, run tests, build, git add, commit with message 'ci: local pipeline passed', push"
58100```
59101
102+ ---
103+
60104## How it works
61105
62106```
63- User Prompt
107+ User Prompt (plain English)
64108 │
65109 ▼
66110AI Provider ← Claude / OpenAI / Ollama
67- │
111+ │ extracts ALL intents, sequences them
68112 ▼
69- JSON Plan ← validated by Zod schema
113+ JSON Plan ← validated by Zod schema (max 10 steps)
70114 │
71115 ▼
72116Catalog Check ← whitelist prevents hallucinated commands
73117 │
74118 ▼
75- Confirm (y/n) ← user reviews before execution
119+ Confirm (y/n) ← review the full plan before execution
76120 │
77121 ▼
78- Runner ← executes steps, streams output live
122+ Runner ← executes step by step, streams output live
123+ stops immediately on first failure
79124```
80125
126+ ---
127+
81128## Allowed commands
82129
83- | Type | Commands |
84- |-------|----------|
85- | pnpm | install, run, build, test, publish, add, remove |
86- | npm | install, run, build, test, publish, ci |
87- | yarn | install, run, build, test, publish, add, remove |
88- | bun | install, run, build, test, publish, add, remove |
89- | git | init, add, commit, push, pull, clone, status, log |
90- | shell | any *(requires extra caution)* |
130+ | Type | Commands |
131+ | ---------| ----------|
132+ | ` pnpm ` | install, run, build, test, publish, add, remove, update, dlx, why |
133+ | ` npm ` | install, run, build, test, publish, ci, init, outdated, audit |
134+ | ` yarn ` | install, run, build, test, publish, add, remove, why, upgrade |
135+ | ` bun ` | install, run, build, test, publish, add, remove, x, update |
136+ | ` git ` | init, add, commit, push, pull, clone, status, log, branch, checkout, merge, diff, stash |
137+ | ` fs ` | mkdir, touch, cp, mv, ls ` (coming soon) ` |
138+ | ` shell ` | any * (escape hatch — always requires extra confirmation)* |
139+
140+ > ** Note:** Flags and arguments are unrestricted — ` --port 5000 ` , ` -m "message" ` , ` --force ` etc. are all passed freely. Only the command itself is whitelisted.
141+
142+ ---
143+
144+ ## AI Providers
145+
146+ ``` bash
147+ # Claude (default)
148+ json-cli " run tests and build"
149+
150+ # OpenAI
151+ json-cli " run tests and build" --provider openai
152+
153+ # Ollama (local, no API key needed)
154+ json-cli " run tests and build" --provider ollama
155+ ```
91156
92157## Environment variables
93158
94159``` bash
95- ANTHROPIC_API_KEY=sk-ant-...
96- OPENAI_API_KEY=sk-...
160+ ANTHROPIC_API_KEY=sk-ant-... # for Claude
161+ OPENAI_API_KEY=sk-... # for OpenAI
97162```
98163
99- ## Run tests
164+ ---
165+
166+ ## Local development
100167
101168``` bash
169+ pnpm install
170+ pnpm dev " please run tests"
102171pnpm test
172+ pnpm build
103173```
104174
175+ ---
176+
105177## License
106178
107179MIT © [ Eka Prasetia] ( https://prasetia.me/ )
@@ -112,4 +184,4 @@ MIT © [Eka Prasetia](https://prasetia.me/)
112184- [ GitHub Repository] ( https://github.com/ekaone/json-cli )
113185- [ Issue Tracker] ( https://github.com/ekaone/json-cli/issues )
114186
115- ⭐ If this library helps you, please consider giving it a star on GitHub!
187+ ⭐ If this library helps you, please consider giving it a star on GitHub!
0 commit comments