|
| 1 | +# json-cli |
| 2 | + |
| 3 | +> Under active development - not released yet |
| 4 | +
|
| 5 | +AI-powered CLI task runner. Describe your goal in plain English — AI generates a validated JSON command plan — runner executes it step by step. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +npm install @ekaone/json-cli |
| 11 | +``` |
| 12 | + |
| 13 | +```bash |
| 14 | +pnpm install @ekaone/json-cli |
| 15 | +``` |
| 16 | + |
| 17 | +```bash |
| 18 | +yarn install @ekaone/json-cli |
| 19 | +``` |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +``` |
| 24 | +export ANTHROPIC_API_KEY=your_key_here |
| 25 | +``` |
| 26 | + |
| 27 | +```bash |
| 28 | +json-cli "please run tests" |
| 29 | +``` |
| 30 | + |
| 31 | +### For local development |
| 32 | + |
| 33 | +```bash |
| 34 | +pnpm install |
| 35 | +``` |
| 36 | + |
| 37 | +### Usage |
| 38 | + |
| 39 | +```bash |
| 40 | +# Using Claude (default) |
| 41 | +pnpm dev "install deps and run tests" |
| 42 | + |
| 43 | +# Using OpenAI |
| 44 | +pnpm dev "run build and publish" --provider openai |
| 45 | + |
| 46 | +# Using Ollama (local) |
| 47 | +pnpm dev "start dev server" --provider ollama |
| 48 | +``` |
| 49 | + |
| 50 | +## How it works |
| 51 | + |
| 52 | +``` |
| 53 | +User Prompt |
| 54 | + │ |
| 55 | + ▼ |
| 56 | +AI Provider ← Claude / OpenAI / Ollama |
| 57 | + │ |
| 58 | + ▼ |
| 59 | +JSON Plan ← validated by Zod schema |
| 60 | + │ |
| 61 | + ▼ |
| 62 | +Catalog Check ← whitelist prevents hallucinated commands |
| 63 | + │ |
| 64 | + ▼ |
| 65 | +Confirm (y/n) ← user reviews before execution |
| 66 | + │ |
| 67 | + ▼ |
| 68 | +Runner ← executes steps, streams output live |
| 69 | +``` |
| 70 | + |
| 71 | +## Allowed commands |
| 72 | + |
| 73 | +| Type | Commands | |
| 74 | +|-------|----------| |
| 75 | +| pnpm | install, run, build, test, publish, add, remove | |
| 76 | +| npm | install, run, build, test, publish, ci | |
| 77 | +| yarn | install, run, build, test, publish, add, remove | |
| 78 | +| bun | install, run, build, test, publish, add, remove | |
| 79 | +| git | init, add, commit, push, pull, clone, status, log | |
| 80 | +| shell | any *(requires extra caution)* | |
| 81 | + |
| 82 | +## Environment variables |
| 83 | + |
| 84 | +```bash |
| 85 | +ANTHROPIC_API_KEY=sk-ant-... |
| 86 | +OPENAI_API_KEY=sk-... |
| 87 | +``` |
| 88 | + |
| 89 | +## Run tests |
| 90 | + |
| 91 | +```bash |
| 92 | +pnpm test |
| 93 | +``` |
| 94 | + |
| 95 | +## License |
| 96 | + |
| 97 | +MIT © [Eka Prasetia](https://prasetia.me/) |
| 98 | + |
| 99 | +## Links |
| 100 | + |
| 101 | +- [npm Package](https://www.npmjs.com/package/@ekaone/json-cli) |
| 102 | +- [GitHub Repository](https://github.com/ekaone/json-cli) |
| 103 | +- [Issue Tracker](https://github.com/ekaone/json-cli/issues) |
| 104 | + |
| 105 | +⭐ If this library helps you, please consider giving it a star on GitHub! |
0 commit comments