iubcli 4.2.15 → 4.2.16
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 +372 -372
- package/dist/index.js +91 -74
- package/dist/index.js.map +1 -1
- package/package.json +71 -71
package/README.md
CHANGED
|
@@ -1,372 +1,372 @@
|
|
|
1
|
-
# IUB CLI
|
|
2
|
-
|
|
3
|
-
> Autonomous BYOK terminal coding agent for English workflows, with BUILD and PLAN modes, local-first configuration, and resilient free-model failover.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/iubcli)
|
|
6
|
-
[](https://nodejs.org/)
|
|
7
|
-
[](license)
|
|
8
|
-
[](#bring-your-own-key-byok)
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
██╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
|
|
12
|
-
██║ ██║ ██║ ██╔══██╗ ██╔════╝ ██║ ██║
|
|
13
|
-
██║ ██║ ██║ ██████╔╝ ██║ ██║ ██║
|
|
14
|
-
██║ ██║ ██║ ██╔══██╗ ██║ ██║ ██║
|
|
15
|
-
██║ ╚██████╔╝ ██████╔╝ ╚██████╗ ███████╗ ██║
|
|
16
|
-
╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
|
|
23
|
-
**IUB CLI** (`iubcli`) is an open-source, serverless terminal coding assistant designed for developers
|
|
24
|
-
|
|
25
|
-
It combines a local terminal UI with provider-backed model calls, giving you an agent that can inspect a workspace, plan changes, edit files, run commands, fetch documentation, and coordinate with other local CLI instances.
|
|
26
|
-
|
|
27
|
-
Core design points:
|
|
28
|
-
|
|
29
|
-
- **BUILD Mode:** autonomous coding with file reads/writes, edits, shell commands, web search, image input, and project inspection.
|
|
30
|
-
- **PLAN Mode:** read-only architecture and planning mode for senior-engineer style analysis.
|
|
31
|
-
- **BYOK:** bring your own Gemini, OpenRouter, DeepSeek, Groq, Cerebras, Ollama, or custom OpenAI-compatible endpoint.
|
|
32
|
-
- **Auto-cascade:** rotates through available free models when quotas or rate limits are hit.
|
|
33
|
-
- **Local-first:** configuration is stored on your machine through `conf`; there is no hosted middleman.
|
|
34
|
-
- **Zero-key fallback:** if no provider is configured in a non-interactive run, IUB CLI can start with a built-in free starter endpoint or detect local Ollama.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Features
|
|
39
|
-
|
|
40
|
-
### Agent Modes
|
|
41
|
-
|
|
42
|
-
- `BUILD Mode` is the default. It can use workspace tools, modify files, install dependencies, run tests, and execute shell commands.
|
|
43
|
-
- `PLAN Mode` is read-only. It analyzes the codebase and produces structured implementation plans without changing files.
|
|
44
|
-
- Switch modes inside chat with `/mode`, `/plan`, `/build`, or at launch with `-M plan` / `-M build`.
|
|
45
|
-
|
|
46
|
-
### Providers and Models
|
|
47
|
-
|
|
48
|
-
Supported provider paths:
|
|
49
|
-
|
|
50
|
-
- **Google Gemini:** `gemini`, configured through Google AI Studio.
|
|
51
|
-
- **OpenRouter:** `openrouter`, including free `:free` model routes.
|
|
52
|
-
- **Custom OpenAI-compatible:** DeepSeek, Groq, Cerebras, Ollama, local servers, and other compatible APIs.
|
|
53
|
-
- **Zero-key starter:** built-in Pollinations-backed fallback for quick non-interactive use.
|
|
54
|
-
|
|
55
|
-
Useful commands:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
iubcli config # interactive provider/key/model setup
|
|
59
|
-
iubcli guide # free API key and model guide
|
|
60
|
-
iubcli limits # token, context, and rate-limit reference
|
|
61
|
-
iubcli agent # model selector
|
|
62
|
-
iubcli doctor # environment diagnostics
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Resilience
|
|
66
|
-
|
|
67
|
-
- Automatic model cascade on rate limits, quota exhaustion, provider errors, or unavailable models.
|
|
68
|
-
- Model explorer can scan candidates for active free tokens.
|
|
69
|
-
- Rolling cooldown keeps long-running tasks alive instead of dropping immediately.
|
|
70
|
-
- Escape key aborts generation and cleans up terminal state.
|
|
71
|
-
|
|
72
|
-
### Workspace Intelligence
|
|
73
|
-
|
|
74
|
-
The agent has 12 built-in tools:
|
|
75
|
-
|
|
76
|
-
- `list_files`
|
|
77
|
-
- `read_file`
|
|
78
|
-
- `write_file`
|
|
79
|
-
- `edit_file`
|
|
80
|
-
- `run_command`
|
|
81
|
-
- `grep_search`
|
|
82
|
-
- `find_files`
|
|
83
|
-
- `fetch_url`
|
|
84
|
-
- `web_search`
|
|
85
|
-
- `list_peers`
|
|
86
|
-
- `peer_call_tool`
|
|
87
|
-
- `peer_send_message`
|
|
88
|
-
|
|
89
|
-
It also includes project detection for framework, package manager, TypeScript/Tailwind usage, scripts, and workspace structure.
|
|
90
|
-
|
|
91
|
-
### Terminal UX
|
|
92
|
-
|
|
93
|
-
- Sticky terminal header with provider, model, mode, mesh role, and workspace path.
|
|
94
|
-
- Markdown rendering for model output.
|
|
95
|
-
- Interactive selects, masked inputs, bracketed-paste protection, `@file` mentions, image paste, and URL ingestion.
|
|
96
|
-
- Status commands for session stats, git state, directory tree, diffs, undo, and token renewal countdown.
|
|
97
|
-
|
|
98
|
-
### Cross-Instance Mesh
|
|
99
|
-
|
|
100
|
-
Multiple IUB CLI instances can discover each other on localhost and exchange structured messages or remote tool calls. This is useful for separate frontend/backend workspaces.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Quick Start
|
|
105
|
-
|
|
106
|
-
### Installation
|
|
107
|
-
|
|
108
|
-
Install globally:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npm install -g iubcli
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Or run without installing:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npx iubcli
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### First Run
|
|
121
|
-
|
|
122
|
-
Start the interactive CLI:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
iubcli
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
On first use, the setup wizard walks you through provider selection, API key entry, model choice, and endpoint configuration.
|
|
129
|
-
|
|
130
|
-
Recommended free providers:
|
|
131
|
-
|
|
132
|
-
1. **Google Gemini** - [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
133
|
-
2. **OpenRouter** - [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
134
|
-
3. **Groq** - [console.groq.com/keys](https://console.groq.com/keys)
|
|
135
|
-
4. **DeepSeek** - [platform.deepseek.com](https://platform.deepseek.com)
|
|
136
|
-
5. **Ollama local** - [ollama.com](https://ollama.com), then use `http://localhost:11434/v1`
|
|
137
|
-
|
|
138
|
-
For non-interactive or single-prompt runs, IUB CLI can auto-detect local Ollama or fall back to the built-in zero-key starter model.
|
|
139
|
-
|
|
140
|
-
### Common Launches
|
|
141
|
-
|
|
142
|
-
Interactive mode:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
iubcli
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Start in PLAN mode:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
iubcli -M plan
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Auto-approve file writes and shell commands:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
iubcli -y
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Run one prompt and exit:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
iubcli -p "Build a small Express REST API with JWT auth" -y
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Start a mesh peer:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
iubcli --role frontend
|
|
170
|
-
iubcli --role backend
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## CLI Usage
|
|
176
|
-
|
|
177
|
-
```text
|
|
178
|
-
Usage: iubcli [options] [command]
|
|
179
|
-
|
|
180
|
-
Options:
|
|
181
|
-
-v, --version Output current version
|
|
182
|
-
-m, --model <model> Override model for this session
|
|
183
|
-
-M, --mode <mode> Execution mode: "build" (default) or "plan"
|
|
184
|
-
-p, --prompt <prompt> Run a single prompt and exit
|
|
185
|
-
-y, --yes Auto-approve all file writes and shell commands
|
|
186
|
-
-r, --role <role> Instance role for cross-instance mesh
|
|
187
|
-
--mesh-port <port> Local port for mesh broker (default: 49152)
|
|
188
|
-
--mesh-token <token> Shared authentication token for mesh
|
|
189
|
-
--no-mesh Disable cross-instance mesh networking
|
|
190
|
-
-h, --help Display help for command
|
|
191
|
-
|
|
192
|
-
Commands:
|
|
193
|
-
config Run interactive setup wizard
|
|
194
|
-
guide, keys Display free API keys and models guide
|
|
195
|
-
limits, limit, tokens, quota, quotas
|
|
196
|
-
Display token limits and rate-limit reference
|
|
197
|
-
agent, model OpenCode-style agent and model selector
|
|
198
|
-
mode Display BUILD and PLAN mode guide
|
|
199
|
-
about, developer Display creator, GitHub, and project details
|
|
200
|
-
renewal, countdown Display token renewal countdown and schedules
|
|
201
|
-
doctor, check Run environment diagnostics
|
|
202
|
-
stats, cost Display session stats view
|
|
203
|
-
peers, mesh Discover connected mesh peers
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Slash Commands
|
|
209
|
-
|
|
210
|
-
Inside interactive chat:
|
|
211
|
-
|
|
212
|
-
| Command | Description |
|
|
213
|
-
| --- | --- |
|
|
214
|
-
| `/mode` | Toggle or select BUILD/PLAN mode |
|
|
215
|
-
| `/plan` | Switch to PLAN mode |
|
|
216
|
-
| `/build` | Switch to BUILD mode |
|
|
217
|
-
| `/agent`, `/model`, `/models`, `/m` | Open model/agent selector or switch model |
|
|
218
|
-
| `/provider` | Change provider configuration |
|
|
219
|
-
| `/config` | Run the full setup wizard |
|
|
220
|
-
| `/explore`, `/find-model`, `/scan`, `/free` | Scan models for active free tokens |
|
|
221
|
-
| `/image`, `/screenshot`, `/pic`, `/paste-image` | Stage clipboard or file image input |
|
|
222
|
-
| `/task`, `/urgent`, `/priority` | Dispatch a priority task |
|
|
223
|
-
| `/limits`, `/limit`, `/tokens`, `/quota` | Show token limits and quotas |
|
|
224
|
-
| `/guide`, `/keys` | Show free API key guide |
|
|
225
|
-
| `/renewal`, `/countdown`, `/renew` | Show quota renewal countdown |
|
|
226
|
-
| `/doctor`, `/check` | Run diagnostics |
|
|
227
|
-
| `/stats`, `/cost` | Show live session stats |
|
|
228
|
-
| `/diff`, `/changes` | Show session file changes |
|
|
229
|
-
| `/undo` | Revert the latest agent file change |
|
|
230
|
-
| `/git` | Show git branch, changes, and recent commits |
|
|
231
|
-
| `/tree` | Show workspace directory tree |
|
|
232
|
-
| `/detect`, `/stack` | Show detected project stack |
|
|
233
|
-
| `/compact` | Compact conversation history |
|
|
234
|
-
| `/session`, `/status` | Show active session status |
|
|
235
|
-
| `/peers`, `/mesh` | Show connected mesh peers |
|
|
236
|
-
| `/role` | View or change mesh role |
|
|
237
|
-
| `/send`, `/msg` | Send a message to a mesh peer |
|
|
238
|
-
| `/about`, `/developer`, `/creator` | Show project and developer info |
|
|
239
|
-
| `/clear`, `/cls`, `/reset` | Clear conversation history |
|
|
240
|
-
| `/exit`, `/quit` | Exit IUB CLI |
|
|
241
|
-
| `/help` | Show slash-command help |
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Bring Your Own Key (BYOK)
|
|
246
|
-
|
|
247
|
-
IUB CLI does not require a subscription. You can connect free or paid provider keys depending on your needs.
|
|
248
|
-
|
|
249
|
-
### Google Gemini
|
|
250
|
-
|
|
251
|
-
- Key URL: [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
252
|
-
- Good for: fast general coding, large context, tool calling.
|
|
253
|
-
- Setup: choose Google Gemini in `iubcli config` or `/config`.
|
|
254
|
-
|
|
255
|
-
### OpenRouter
|
|
256
|
-
|
|
257
|
-
- Key URL: [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
258
|
-
- Good for: many free `:free` models and easy provider switching.
|
|
259
|
-
- Examples: `openrouter/free`, `particle-ai/particle-1:free`, `nvidia/nemotron-3-ultra-550b-a55b:free`, `google/gemma-4-31b-it:free`.
|
|
260
|
-
|
|
261
|
-
### DeepSeek
|
|
262
|
-
|
|
263
|
-
- Key URL: [platform.deepseek.com](https://platform.deepseek.com)
|
|
264
|
-
- Setup: choose Custom OpenAI-Compatible and use `https://api.deepseek.com/v1`.
|
|
265
|
-
- Models: `deepseek-chat`, `deepseek-reasoner`, and related DeepSeek endpoints.
|
|
266
|
-
|
|
267
|
-
### Groq
|
|
268
|
-
|
|
269
|
-
- Key URL: [console.groq.com/keys](https://console.groq.com/keys)
|
|
270
|
-
- Setup: choose Custom OpenAI-Compatible and use `https://api.groq.com/openai/v1`.
|
|
271
|
-
- Good for: very fast inference on supported open models.
|
|
272
|
-
|
|
273
|
-
### Cerebras
|
|
274
|
-
|
|
275
|
-
- Key URL: [cloud.cerebras.ai](https://cloud.cerebras.ai)
|
|
276
|
-
- Setup: choose Custom OpenAI-Compatible and use `https://api.cerebras.ai/v1`.
|
|
277
|
-
- Good for: low-latency inference on supported models.
|
|
278
|
-
|
|
279
|
-
### Ollama / Local Models
|
|
280
|
-
|
|
281
|
-
- Download: [ollama.com](https://ollama.com)
|
|
282
|
-
- Example:
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
ollama run qwen2.5-coder
|
|
286
|
-
ollama run deepseek-r1
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
- IUB CLI setup: Custom OpenAI-Compatible, base URL `http://localhost:11434/v1`, API key can be any string such as `ollama`.
|
|
290
|
-
- Benefit: local, private, and not dependent on hosted rate limits.
|
|
291
|
-
|
|
292
|
-
### Zero-Key Fallback
|
|
293
|
-
|
|
294
|
-
For quick non-interactive use, IUB CLI can start with a built-in free starter endpoint when no key is configured. For serious coding work, configure Gemini, OpenRouter, DeepSeek, Groq, Cerebras, or Ollama for better tool calling and quotas.
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
## Safety Model
|
|
299
|
-
|
|
300
|
-
In BUILD mode, file writes, edits, and shell commands can require confirmation before execution. Use `-y` or the auto-approve option only in trusted directories.
|
|
301
|
-
|
|
302
|
-
PLAN mode blocks mutation tools entirely, making it safer for architecture review and planning.
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## Project Architecture
|
|
307
|
-
|
|
308
|
-
```text
|
|
309
|
-
iubcli/
|
|
310
|
-
├── src/
|
|
311
|
-
│ ├── index.ts # CLI entry point, commander commands, interactive loop
|
|
312
|
-
│ ├── agent.ts # model orchestration, cascade, retries, tool loop
|
|
313
|
-
│ ├── tools.ts # workspace tools and safety confirmations
|
|
314
|
-
│ ├── prompt.ts # terminal input, sticky UI, selects, paste handling
|
|
315
|
-
│ ├── ui.ts # banner, markdown rendering, reports, help
|
|
316
|
-
│ ├── config.ts # local config, provider defaults, verification
|
|
317
|
-
│ ├── models.ts # model presets and interactive selector
|
|
318
|
-
│ ├── explorer.ts # free-model discovery
|
|
319
|
-
│ ├── detector.ts # project stack detection
|
|
320
|
-
│ ├── image.ts # clipboard/file image payload loading
|
|
321
|
-
│ └── mesh.ts # cross-instance peer networking
|
|
322
|
-
├── scripts/
|
|
323
|
-
│ ├── test-tools.ts
|
|
324
|
-
│ ├── test-image.ts
|
|
325
|
-
│ ├── test-box.ts
|
|
326
|
-
│ └── test-gemini-tools.ts
|
|
327
|
-
├── package.json
|
|
328
|
-
├── tsconfig.json
|
|
329
|
-
└── tsup.config.ts
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## Development
|
|
335
|
-
|
|
336
|
-
Clone the repository:
|
|
337
|
-
|
|
338
|
-
```bash
|
|
339
|
-
git clone https://github.com/Ifaz2611/iubcli.git
|
|
340
|
-
cd iubcli
|
|
341
|
-
npm install
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
Run checks:
|
|
345
|
-
|
|
346
|
-
```bash
|
|
347
|
-
npm run typecheck
|
|
348
|
-
npm test
|
|
349
|
-
npm run build
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
Link locally for manual testing:
|
|
353
|
-
|
|
354
|
-
```bash
|
|
355
|
-
npm link
|
|
356
|
-
iubcli --help
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
Package scripts:
|
|
360
|
-
|
|
361
|
-
- `npm run build` - bundle with `tsup`
|
|
362
|
-
- `npm run dev` - watch-mode bundling
|
|
363
|
-
- `npm run typecheck` - TypeScript check
|
|
364
|
-
- `npm test` - run local tool/image/box test scripts
|
|
365
|
-
- `npm start` - run the built CLI
|
|
366
|
-
- `npm run prepublishOnly` - typecheck, test, and build before publish
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## License
|
|
371
|
-
|
|
372
|
-
[MIT](license)
|
|
1
|
+
# IUB CLI
|
|
2
|
+
|
|
3
|
+
> Autonomous BYOK terminal coding agent for English workflows, with BUILD and PLAN modes, local-first configuration, and resilient free-model failover.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/iubcli)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](license)
|
|
8
|
+
[](#bring-your-own-key-byok)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
██╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
|
|
12
|
+
██║ ██║ ██║ ██╔══██╗ ██╔════╝ ██║ ██║
|
|
13
|
+
██║ ██║ ██║ ██████╔╝ ██║ ██║ ██║
|
|
14
|
+
██║ ██║ ██║ ██╔══██╗ ██║ ██║ ██║
|
|
15
|
+
██║ ╚██████╔╝ ██████╔╝ ╚██████╗ ███████╗ ██║
|
|
16
|
+
╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
**IUB CLI** (`iubcli`) is an open-source, serverless terminal coding assistant designed for developers
|
|
24
|
+
|
|
25
|
+
It combines a local terminal UI with provider-backed model calls, giving you an agent that can inspect a workspace, plan changes, edit files, run commands, fetch documentation, and coordinate with other local CLI instances.
|
|
26
|
+
|
|
27
|
+
Core design points:
|
|
28
|
+
|
|
29
|
+
- **BUILD Mode:** autonomous coding with file reads/writes, edits, shell commands, web search, image input, and project inspection.
|
|
30
|
+
- **PLAN Mode:** read-only architecture and planning mode for senior-engineer style analysis.
|
|
31
|
+
- **BYOK:** bring your own Gemini, OpenRouter, DeepSeek, Groq, Cerebras, Ollama, or custom OpenAI-compatible endpoint.
|
|
32
|
+
- **Auto-cascade:** rotates through available free models when quotas or rate limits are hit.
|
|
33
|
+
- **Local-first:** configuration is stored on your machine through `conf`; there is no hosted middleman.
|
|
34
|
+
- **Zero-key fallback:** if no provider is configured in a non-interactive run, IUB CLI can start with a built-in free starter endpoint or detect local Ollama.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
### Agent Modes
|
|
41
|
+
|
|
42
|
+
- `BUILD Mode` is the default. It can use workspace tools, modify files, install dependencies, run tests, and execute shell commands.
|
|
43
|
+
- `PLAN Mode` is read-only. It analyzes the codebase and produces structured implementation plans without changing files.
|
|
44
|
+
- Switch modes inside chat with `/mode`, `/plan`, `/build`, or at launch with `-M plan` / `-M build`.
|
|
45
|
+
|
|
46
|
+
### Providers and Models
|
|
47
|
+
|
|
48
|
+
Supported provider paths:
|
|
49
|
+
|
|
50
|
+
- **Google Gemini:** `gemini`, configured through Google AI Studio.
|
|
51
|
+
- **OpenRouter:** `openrouter`, including free `:free` model routes.
|
|
52
|
+
- **Custom OpenAI-compatible:** DeepSeek, Groq, Cerebras, Ollama, local servers, and other compatible APIs.
|
|
53
|
+
- **Zero-key starter:** built-in Pollinations-backed fallback for quick non-interactive use.
|
|
54
|
+
|
|
55
|
+
Useful commands:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
iubcli config # interactive provider/key/model setup
|
|
59
|
+
iubcli guide # free API key and model guide
|
|
60
|
+
iubcli limits # token, context, and rate-limit reference
|
|
61
|
+
iubcli agent # model selector
|
|
62
|
+
iubcli doctor # environment diagnostics
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Resilience
|
|
66
|
+
|
|
67
|
+
- Automatic model cascade on rate limits, quota exhaustion, provider errors, or unavailable models.
|
|
68
|
+
- Model explorer can scan candidates for active free tokens.
|
|
69
|
+
- Rolling cooldown keeps long-running tasks alive instead of dropping immediately.
|
|
70
|
+
- Escape key aborts generation and cleans up terminal state.
|
|
71
|
+
|
|
72
|
+
### Workspace Intelligence
|
|
73
|
+
|
|
74
|
+
The agent has 12 built-in tools:
|
|
75
|
+
|
|
76
|
+
- `list_files`
|
|
77
|
+
- `read_file`
|
|
78
|
+
- `write_file`
|
|
79
|
+
- `edit_file`
|
|
80
|
+
- `run_command`
|
|
81
|
+
- `grep_search`
|
|
82
|
+
- `find_files`
|
|
83
|
+
- `fetch_url`
|
|
84
|
+
- `web_search`
|
|
85
|
+
- `list_peers`
|
|
86
|
+
- `peer_call_tool`
|
|
87
|
+
- `peer_send_message`
|
|
88
|
+
|
|
89
|
+
It also includes project detection for framework, package manager, TypeScript/Tailwind usage, scripts, and workspace structure.
|
|
90
|
+
|
|
91
|
+
### Terminal UX
|
|
92
|
+
|
|
93
|
+
- Sticky terminal header with provider, model, mode, mesh role, and workspace path.
|
|
94
|
+
- Markdown rendering for model output.
|
|
95
|
+
- Interactive selects, masked inputs, bracketed-paste protection, `@file` mentions, image paste, and URL ingestion.
|
|
96
|
+
- Status commands for session stats, git state, directory tree, diffs, undo, and token renewal countdown.
|
|
97
|
+
|
|
98
|
+
### Cross-Instance Mesh
|
|
99
|
+
|
|
100
|
+
Multiple IUB CLI instances can discover each other on localhost and exchange structured messages or remote tool calls. This is useful for separate frontend/backend workspaces.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
### Installation
|
|
107
|
+
|
|
108
|
+
Install globally:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install -g iubcli
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or run without installing:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx iubcli
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### First Run
|
|
121
|
+
|
|
122
|
+
Start the interactive CLI:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
iubcli
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
On first use, the setup wizard walks you through provider selection, API key entry, model choice, and endpoint configuration.
|
|
129
|
+
|
|
130
|
+
Recommended free providers:
|
|
131
|
+
|
|
132
|
+
1. **Google Gemini** - [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
133
|
+
2. **OpenRouter** - [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
134
|
+
3. **Groq** - [console.groq.com/keys](https://console.groq.com/keys)
|
|
135
|
+
4. **DeepSeek** - [platform.deepseek.com](https://platform.deepseek.com)
|
|
136
|
+
5. **Ollama local** - [ollama.com](https://ollama.com), then use `http://localhost:11434/v1`
|
|
137
|
+
|
|
138
|
+
For non-interactive or single-prompt runs, IUB CLI can auto-detect local Ollama or fall back to the built-in zero-key starter model.
|
|
139
|
+
|
|
140
|
+
### Common Launches
|
|
141
|
+
|
|
142
|
+
Interactive mode:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
iubcli
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Start in PLAN mode:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
iubcli -M plan
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Auto-approve file writes and shell commands:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
iubcli -y
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Run one prompt and exit:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
iubcli -p "Build a small Express REST API with JWT auth" -y
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Start a mesh peer:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
iubcli --role frontend
|
|
170
|
+
iubcli --role backend
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## CLI Usage
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
Usage: iubcli [options] [command]
|
|
179
|
+
|
|
180
|
+
Options:
|
|
181
|
+
-v, --version Output current version
|
|
182
|
+
-m, --model <model> Override model for this session
|
|
183
|
+
-M, --mode <mode> Execution mode: "build" (default) or "plan"
|
|
184
|
+
-p, --prompt <prompt> Run a single prompt and exit
|
|
185
|
+
-y, --yes Auto-approve all file writes and shell commands
|
|
186
|
+
-r, --role <role> Instance role for cross-instance mesh
|
|
187
|
+
--mesh-port <port> Local port for mesh broker (default: 49152)
|
|
188
|
+
--mesh-token <token> Shared authentication token for mesh
|
|
189
|
+
--no-mesh Disable cross-instance mesh networking
|
|
190
|
+
-h, --help Display help for command
|
|
191
|
+
|
|
192
|
+
Commands:
|
|
193
|
+
config Run interactive setup wizard
|
|
194
|
+
guide, keys Display free API keys and models guide
|
|
195
|
+
limits, limit, tokens, quota, quotas
|
|
196
|
+
Display token limits and rate-limit reference
|
|
197
|
+
agent, model OpenCode-style agent and model selector
|
|
198
|
+
mode Display BUILD and PLAN mode guide
|
|
199
|
+
about, developer Display creator, GitHub, and project details
|
|
200
|
+
renewal, countdown Display token renewal countdown and schedules
|
|
201
|
+
doctor, check Run environment diagnostics
|
|
202
|
+
stats, cost Display session stats view
|
|
203
|
+
peers, mesh Discover connected mesh peers
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Slash Commands
|
|
209
|
+
|
|
210
|
+
Inside interactive chat:
|
|
211
|
+
|
|
212
|
+
| Command | Description |
|
|
213
|
+
| --- | --- |
|
|
214
|
+
| `/mode` | Toggle or select BUILD/PLAN mode |
|
|
215
|
+
| `/plan` | Switch to PLAN mode |
|
|
216
|
+
| `/build` | Switch to BUILD mode |
|
|
217
|
+
| `/agent`, `/model`, `/models`, `/m` | Open model/agent selector or switch model |
|
|
218
|
+
| `/provider` | Change provider configuration |
|
|
219
|
+
| `/config` | Run the full setup wizard |
|
|
220
|
+
| `/explore`, `/find-model`, `/scan`, `/free` | Scan models for active free tokens |
|
|
221
|
+
| `/image`, `/screenshot`, `/pic`, `/paste-image` | Stage clipboard or file image input |
|
|
222
|
+
| `/task`, `/urgent`, `/priority` | Dispatch a priority task |
|
|
223
|
+
| `/limits`, `/limit`, `/tokens`, `/quota` | Show token limits and quotas |
|
|
224
|
+
| `/guide`, `/keys` | Show free API key guide |
|
|
225
|
+
| `/renewal`, `/countdown`, `/renew` | Show quota renewal countdown |
|
|
226
|
+
| `/doctor`, `/check` | Run diagnostics |
|
|
227
|
+
| `/stats`, `/cost` | Show live session stats |
|
|
228
|
+
| `/diff`, `/changes` | Show session file changes |
|
|
229
|
+
| `/undo` | Revert the latest agent file change |
|
|
230
|
+
| `/git` | Show git branch, changes, and recent commits |
|
|
231
|
+
| `/tree` | Show workspace directory tree |
|
|
232
|
+
| `/detect`, `/stack` | Show detected project stack |
|
|
233
|
+
| `/compact` | Compact conversation history |
|
|
234
|
+
| `/session`, `/status` | Show active session status |
|
|
235
|
+
| `/peers`, `/mesh` | Show connected mesh peers |
|
|
236
|
+
| `/role` | View or change mesh role |
|
|
237
|
+
| `/send`, `/msg` | Send a message to a mesh peer |
|
|
238
|
+
| `/about`, `/developer`, `/creator` | Show project and developer info |
|
|
239
|
+
| `/clear`, `/cls`, `/reset` | Clear conversation history |
|
|
240
|
+
| `/exit`, `/quit` | Exit IUB CLI |
|
|
241
|
+
| `/help` | Show slash-command help |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Bring Your Own Key (BYOK)
|
|
246
|
+
|
|
247
|
+
IUB CLI does not require a subscription. You can connect free or paid provider keys depending on your needs.
|
|
248
|
+
|
|
249
|
+
### Google Gemini
|
|
250
|
+
|
|
251
|
+
- Key URL: [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
252
|
+
- Good for: fast general coding, large context, tool calling.
|
|
253
|
+
- Setup: choose Google Gemini in `iubcli config` or `/config`.
|
|
254
|
+
|
|
255
|
+
### OpenRouter
|
|
256
|
+
|
|
257
|
+
- Key URL: [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
258
|
+
- Good for: many free `:free` models and easy provider switching.
|
|
259
|
+
- Examples: `openrouter/free`, `particle-ai/particle-1:free`, `nvidia/nemotron-3-ultra-550b-a55b:free`, `google/gemma-4-31b-it:free`.
|
|
260
|
+
|
|
261
|
+
### DeepSeek
|
|
262
|
+
|
|
263
|
+
- Key URL: [platform.deepseek.com](https://platform.deepseek.com)
|
|
264
|
+
- Setup: choose Custom OpenAI-Compatible and use `https://api.deepseek.com/v1`.
|
|
265
|
+
- Models: `deepseek-chat`, `deepseek-reasoner`, and related DeepSeek endpoints.
|
|
266
|
+
|
|
267
|
+
### Groq
|
|
268
|
+
|
|
269
|
+
- Key URL: [console.groq.com/keys](https://console.groq.com/keys)
|
|
270
|
+
- Setup: choose Custom OpenAI-Compatible and use `https://api.groq.com/openai/v1`.
|
|
271
|
+
- Good for: very fast inference on supported open models.
|
|
272
|
+
|
|
273
|
+
### Cerebras
|
|
274
|
+
|
|
275
|
+
- Key URL: [cloud.cerebras.ai](https://cloud.cerebras.ai)
|
|
276
|
+
- Setup: choose Custom OpenAI-Compatible and use `https://api.cerebras.ai/v1`.
|
|
277
|
+
- Good for: low-latency inference on supported models.
|
|
278
|
+
|
|
279
|
+
### Ollama / Local Models
|
|
280
|
+
|
|
281
|
+
- Download: [ollama.com](https://ollama.com)
|
|
282
|
+
- Example:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
ollama run qwen2.5-coder
|
|
286
|
+
ollama run deepseek-r1
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
- IUB CLI setup: Custom OpenAI-Compatible, base URL `http://localhost:11434/v1`, API key can be any string such as `ollama`.
|
|
290
|
+
- Benefit: local, private, and not dependent on hosted rate limits.
|
|
291
|
+
|
|
292
|
+
### Zero-Key Fallback
|
|
293
|
+
|
|
294
|
+
For quick non-interactive use, IUB CLI can start with a built-in free starter endpoint when no key is configured. For serious coding work, configure Gemini, OpenRouter, DeepSeek, Groq, Cerebras, or Ollama for better tool calling and quotas.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Safety Model
|
|
299
|
+
|
|
300
|
+
In BUILD mode, file writes, edits, and shell commands can require confirmation before execution. Use `-y` or the auto-approve option only in trusted directories.
|
|
301
|
+
|
|
302
|
+
PLAN mode blocks mutation tools entirely, making it safer for architecture review and planning.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Project Architecture
|
|
307
|
+
|
|
308
|
+
```text
|
|
309
|
+
iubcli/
|
|
310
|
+
├── src/
|
|
311
|
+
│ ├── index.ts # CLI entry point, commander commands, interactive loop
|
|
312
|
+
│ ├── agent.ts # model orchestration, cascade, retries, tool loop
|
|
313
|
+
│ ├── tools.ts # workspace tools and safety confirmations
|
|
314
|
+
│ ├── prompt.ts # terminal input, sticky UI, selects, paste handling
|
|
315
|
+
│ ├── ui.ts # banner, markdown rendering, reports, help
|
|
316
|
+
│ ├── config.ts # local config, provider defaults, verification
|
|
317
|
+
│ ├── models.ts # model presets and interactive selector
|
|
318
|
+
│ ├── explorer.ts # free-model discovery
|
|
319
|
+
│ ├── detector.ts # project stack detection
|
|
320
|
+
│ ├── image.ts # clipboard/file image payload loading
|
|
321
|
+
│ └── mesh.ts # cross-instance peer networking
|
|
322
|
+
├── scripts/
|
|
323
|
+
│ ├── test-tools.ts
|
|
324
|
+
│ ├── test-image.ts
|
|
325
|
+
│ ├── test-box.ts
|
|
326
|
+
│ └── test-gemini-tools.ts
|
|
327
|
+
├── package.json
|
|
328
|
+
├── tsconfig.json
|
|
329
|
+
└── tsup.config.ts
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Development
|
|
335
|
+
|
|
336
|
+
Clone the repository:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
git clone https://github.com/Ifaz2611/iubcli.git
|
|
340
|
+
cd iubcli
|
|
341
|
+
npm install
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Run checks:
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npm run typecheck
|
|
348
|
+
npm test
|
|
349
|
+
npm run build
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Link locally for manual testing:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npm link
|
|
356
|
+
iubcli --help
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Package scripts:
|
|
360
|
+
|
|
361
|
+
- `npm run build` - bundle with `tsup`
|
|
362
|
+
- `npm run dev` - watch-mode bundling
|
|
363
|
+
- `npm run typecheck` - TypeScript check
|
|
364
|
+
- `npm test` - run local tool/image/box test scripts
|
|
365
|
+
- `npm start` - run the built CLI
|
|
366
|
+
- `npm run prepublishOnly` - typecheck, test, and build before publish
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## License
|
|
371
|
+
|
|
372
|
+
[MIT](license)
|