You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI-powered CLI task runner. Just write in plain English, AI generates a validated JSON command plan, and the runner executes it step by step.
3
+
AI-powered CLI task runner. Write plain English goals, get a validated JSON plan, then execute step-by-step.
4
4
5
5
## Think safety first
6
-
> For safety, `json-cli` will generate the plan and ask for confirmation before running the steps. You can also use the `--dry-run` flag to preview the plan without executing it.
7
6
7
+
For safety, `json-cli`:
8
+
- generates a plan first
9
+
- validates schema + catalog rules + guardrails
10
+
- asks for confirmation before execution
11
+
12
+
Use `--dry-run` to preview the plan without executing commands.
8
13
9
14
## Installation
10
15
@@ -22,215 +27,140 @@ yarn global add @ekaone/json-cli
22
27
23
28
## Setup
24
29
30
+
Default provider is Claude when `--provider` is not set.
31
+
25
32
```bash
33
+
# Claude
26
34
export ANTHROPIC_API_KEY=your_key_here
35
+
36
+
# OpenAI
37
+
export OPENAI_API_KEY=your_key_here
38
+
39
+
# Ollama
40
+
export OLLAMA_BASE_URL=http://localhost:11434
27
41
```
28
42
29
-
> Windows PowerShell:`$env:ANTHROPIC_API_KEY="your_key_here"`
43
+
Windows PowerShell:
30
44
31
-
---
45
+
```powershell
46
+
$env:ANTHROPIC_API_KEY="your_key_here"
47
+
```
32
48
33
49
## Usage
34
50
35
-
### Single intent
51
+
### Basic
36
52
37
53
```bash
38
54
json-cli "please run tests"
39
55
json-cli "please build"
40
56
json-cli "check git status"
41
57
```
42
58
43
-
### Multi-intent — the fun part 🔥
44
-
45
-
Chain multiple commands in plain English using **"then"**, **"and"**, **"after that"**:
59
+
### Multi-intent
46
60
47
61
```bash
48
62
json-cli "run tests and then build"
49
-
```
50
-
51
-
```bash
52
63
json-cli "run typecheck, test, and then check git status"
64
+
json-cli "run tests, check git diff, then git add and commit with message 'fix: catalog types'"
53
65
```
54
66
55
-
```bash
56
-
json-cli "please run dev with port 5000"
57
-
```
58
-
59
-
```bash
60
-
json-cli "install deps, run tests, then build"
61
-
```
62
-
63
-
### Full release flow in one command 🚀
64
-
65
-
```bash
66
-
json-cli "run tests, build, git add all, commit with message 'release v0.1.0', push, then publish"
|`shell`| any *(escape hatch — always requires extra confirmation)*|
143
+
## Allowed command sets
228
144
229
-
> **Note:** Flags and arguments are unrestricted, `--port 5000`, `-m "message"`, `--force` etc. are all passed freely. Only the command itself is whitelisted.
- Some catalogs enforce required/conflicting/forbidden flags.
161
+
- Guardrails block obvious secret leakage and malformed flags.
232
162
233
-
## AI Providers
163
+
## AI providers
234
164
235
165
```bash
236
166
# Claude (default)
@@ -239,48 +169,36 @@ json-cli "run tests and build"
239
169
# OpenAI
240
170
json-cli "run tests and build" --provider openai
241
171
242
-
# Ollama (local, no API key needed)
172
+
# Ollama
243
173
json-cli "run tests and build" --provider ollama
244
174
```
245
175
246
-
## Environment variables
247
-
248
-
```bash
249
-
ANTHROPIC_API_KEY=sk-ant-... # for Claude
250
-
OPENAI_API_KEY=sk-... # for OpenAI
251
-
```
252
-
253
-
---
254
-
255
176
## Local development
256
177
257
178
```bash
258
179
pnpm install
259
180
pnpm dev "please run tests"
181
+
pnpm typecheck
260
182
pnpm test
261
183
pnpm build
262
184
```
263
185
264
186
## Pricing
265
187
266
-
> **Note:**[Pricing](./src/providers/pricing.ts) is based on the lastest rates from each provider. Write an [issue](https://github.com/ekaone/json-cli/issues) if you find any outdated pricing.
0 commit comments