askii-cli 0.2.3 → 0.2.5

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 CHANGED
@@ -1,238 +1,280 @@
1
- # ASKII CLI ( •\_•)>⌐■-■ (⌐■_■)
2
-
3
- AI code assistant for your terminal. Powered by Ollama or LM Studio.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g askii-cli
9
- ```
10
-
11
- Or run without installing:
12
-
13
- ```bash
14
- npx askii-cli <command>
15
- ```
16
-
17
- ## Commands
18
-
19
- ### `ask` — Ask a question about code
20
-
21
- Pipe code via stdin or use `--code`:
22
-
23
- **bash**
24
-
25
- ```bash
26
- cat myfile.ts | askii ask "what does this do?"
27
- askii ask --code "const x = 1 + 1" "is this correct?"
28
- ```
29
-
30
- **PowerShell**
31
-
32
- ```powershell
33
- Get-Content myfile.ts | askii ask "what does this do?"
34
- askii ask --code "const x = 1 + 1" "is this correct?"
35
- ```
36
-
37
- ---
38
-
39
- ### `edit` — Edit code
40
-
41
- Returns the modified code to stdout (pipe-friendly):
42
-
43
- **bash**
44
-
45
- ```bash
46
- cat myfile.ts | askii edit "add error handling" > myfile-edited.ts
47
- cat myfile.ts | askii edit "convert to async/await"
48
- ```
49
-
50
- **PowerShell**
51
-
52
- ```powershell
53
- Get-Content myfile.ts | askii edit "add error handling" | Set-Content myfile-edited.ts
54
- Get-Content myfile.ts | askii edit "convert to async/await"
55
- ```
56
-
57
- ---
58
-
59
- ### `explain` — Explain a line of code
60
-
61
- **bash**
62
-
63
- ```bash
64
- askii explain "arr.reduce((a, b) => a + b, 0)"
65
- cat myfile.ts | askii explain
66
- ```
67
-
68
- **PowerShell**
69
-
70
- ```powershell
71
- askii explain "arr.reduce((a, b) => a + b, 0)"
72
- Get-Content myfile.ts | askii explain
73
- ```
74
-
75
- ---
76
-
77
- ### `do` — Agentic task runner
78
-
79
- Prints the working directory's top-level file listing, then runs an agent loop that creates, modifies, renames, deletes, views, and lists files until the task is done or `--max-rounds` is reached.
80
-
81
- **bash**
82
-
83
- ```bash
84
- askii do "create a Jest test file for src/utils.ts"
85
- askii do "rename all .js files to .ts in the src folder"
86
- askii do "add a .gitignore for a Node.js project"
87
- askii do --yes "scaffold a README for this project" # auto-confirm all
88
- askii do --dir ./my-project "refactor index.ts"
89
- ```
90
-
91
- **PowerShell**
92
-
93
- ```powershell
94
- askii do "create a Jest test file for src/utils.ts"
95
- askii do "rename all .js files to .ts in the src folder"
96
- askii do "add a .gitignore for a Node.js project"
97
- askii do --yes "scaffold a README for this project" # auto-confirm all
98
- askii do --dir .\my-project "refactor index.ts"
99
- ```
100
-
101
- The agent can use the following actions each round:
102
-
103
- | Action | Description | Requires confirmation |
104
- | -------- | -------------------------------------------------------- | --------------------- |
105
- | `list` | List files in a folder (`[file]` / `[folder]` labels) | No |
106
- | `view` | Read a file's contents | No |
107
- | `create` | Create a new file | Yes |
108
- | `modify` | Replace text in an existing file | Yes |
109
- | `rename` | Rename or move a file | Yes |
110
- | `delete` | Delete a file | Yes |
111
-
112
- The loop continues after every round — not only after reads — until the AI returns `[]` or the round limit is hit.
113
-
114
- ---
115
-
116
- ### `control` — Screen control agent
117
-
118
- Takes a screenshot, sends it to the AI, and executes the returned mouse/keyboard action. Repeats until the AI returns `DONE` or `--max-rounds` is reached. Requires a **vision-capable model** (e.g. `llava`, `moondream2`).
119
-
120
- > **Linux**: requires `xdotool` for mouse/keyboard control (`sudo apt install xdotool` or equivalent).
121
-
122
- **bash**
123
-
124
- ```bash
125
- askii control --ollama-model llava "open Notepad and type hello world"
126
- askii control --yes --ollama-model llava "click the search bar and search for cats"
127
- askii control --max-rounds 10 --ollama-model llava "fill in the login form"
128
- askii control -p lmstudio --lmstudio-model llava-1.5 "open the browser"
129
- ```
130
-
131
- **PowerShell**
132
-
133
- ```powershell
134
- askii control --ollama-model llava "open Notepad and type hello world"
135
- askii control --yes --ollama-model llava "click the search bar and search for cats"
136
- askii control --max-rounds 10 --ollama-model llava "fill in the login form"
137
- askii control -p lmstudio --lmstudio-model llava-1.5 "open the browser"
138
- ```
139
-
140
- Each round the AI can return one of:
141
- - **mouse_move** — move the cursor to `(x, y)`
142
- - **mouse_left_click** — left-click at `(x, y)`
143
- - **mouse_right_click** — right-click at `(x, y)`
144
- - **keyboard_input** — type a string
145
- - **DONE** — task complete, stop the loop
146
-
147
- Without `--yes`, each proposed action is shown with its reasoning and requires `y` confirmation before executing.
148
-
149
- ---
150
-
151
- ## Options
152
-
153
- | Flag | Short | Description | Default |
154
- | --------------------- | ----- | ----------------------------------------------- | -------------------------- |
155
- | `--platform` | `-p` | LLM platform: `ollama`, `lmstudio` | `ollama` |
156
- | `--ollama-url` | | Ollama server URL | `http://localhost:11434` |
157
- | `--lmstudio-url` | | LM Studio server URL | `ws://localhost:1234` |
158
- | `--ollama-model` | | Ollama model | `gemma3:270m` |
159
- | `--lmstudio-model` | | LM Studio model | `qwen/qwen3-coder-30b` |
160
- | `--mode` | | Response style: `helpful`, `funny` | `funny` |
161
- | `--max-rounds` | | Max agent rounds for `do` / `control` | `5` |
162
- | `--dir` | | Working directory for `do` | cwd |
163
- | `--code` | `-c` | Code input (alternative to stdin) | |
164
- | `--yes` | `-y` | Auto-confirm all actions | |
165
-
166
- ## Environment Variables
167
-
168
- **bash**
169
-
170
- ```bash
171
- export ASKII_PLATFORM=ollama
172
-
173
- # Ollama
174
- export ASKII_OLLAMA_URL=http://localhost:11434
175
- export ASKII_OLLAMA_MODEL=gemma3:270m
176
-
177
- # LM Studio
178
- export ASKII_LMSTUDIO_URL=ws://localhost:1234
179
- export ASKII_LMSTUDIO_MODEL=qwen/qwen3-coder-30b
180
-
181
- # Shared
182
- export ASKII_MODE=funny
183
- export ASKII_MAX_ROUNDS=5
184
- ```
185
-
186
- **PowerShell**
187
-
188
- ```powershell
189
- $env:ASKII_PLATFORM = "ollama"
190
-
191
- # Ollama
192
- $env:ASKII_OLLAMA_URL = "http://localhost:11434"
193
- $env:ASKII_OLLAMA_MODEL = "gemma3:270m"
194
-
195
- # LM Studio
196
- $env:ASKII_LMSTUDIO_URL = "ws://localhost:1234"
197
- $env:ASKII_LMSTUDIO_MODEL = "qwen/qwen3-coder-30b"
198
-
199
- # Shared
200
- $env:ASKII_MODE = "funny"
201
- $env:ASKII_MAX_ROUNDS = "5"
202
- ```
203
-
204
- ## Platforms
205
-
206
- ### Ollama (default)
207
-
208
- **bash**
209
-
210
- ```bash
211
- ollama pull gemma3:270m
212
- askii ask "what is a closure?"
213
- ```
214
-
215
- **PowerShell**
216
-
217
- ```powershell
218
- ollama pull gemma3:270m
219
- askii ask "what is a closure?"
220
- ```
221
-
222
- ### LM Studio
223
-
224
- **bash**
225
-
226
- ```bash
227
- # Start LM Studio with local server enabled
228
- askii -p lmstudio ask "explain this function"
229
- askii -p lmstudio --lmstudio-model "my-model" ask "explain this function"
230
- ```
231
-
232
- **PowerShell**
233
-
234
- ```powershell
235
- # Start LM Studio with local server enabled
236
- askii -p lmstudio ask "explain this function"
237
- askii -p lmstudio --lmstudio-model "my-model" ask "explain this function"
238
- ```
1
+ # ASKII CLI ( •\_•)>⌐■-■ (⌐■_■)
2
+
3
+ AI code assistant for your terminal. Powered by Ollama or LM Studio.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g askii-cli
9
+ ```
10
+
11
+ Or run without installing:
12
+
13
+ ```bash
14
+ npx askii-cli <command>
15
+ ```
16
+
17
+ ## Commands
18
+
19
+ ### `ask` — Ask a question about code
20
+
21
+ Pipe code via stdin or use `--code`:
22
+
23
+ **bash**
24
+
25
+ ```bash
26
+ cat myfile.ts | askii ask "what does this do?"
27
+ askii ask --code "const x = 1 + 1" "is this correct?"
28
+ ```
29
+
30
+ **PowerShell**
31
+
32
+ ```powershell
33
+ Get-Content myfile.ts | askii ask "what does this do?"
34
+ askii ask --code "const x = 1 + 1" "is this correct?"
35
+ ```
36
+
37
+ ---
38
+
39
+ ### `edit` — Edit code
40
+
41
+ Returns the modified code to stdout (pipe-friendly):
42
+
43
+ **bash**
44
+
45
+ ```bash
46
+ cat myfile.ts | askii edit "add error handling" > myfile-edited.ts
47
+ cat myfile.ts | askii edit "convert to async/await"
48
+ ```
49
+
50
+ **PowerShell**
51
+
52
+ ```powershell
53
+ Get-Content myfile.ts | askii edit "add error handling" | Set-Content myfile-edited.ts
54
+ Get-Content myfile.ts | askii edit "convert to async/await"
55
+ ```
56
+
57
+ ---
58
+
59
+ ### `explain` — Explain a line of code
60
+
61
+ **bash**
62
+
63
+ ```bash
64
+ askii explain "arr.reduce((a, b) => a + b, 0)"
65
+ cat myfile.ts | askii explain
66
+ ```
67
+
68
+ **PowerShell**
69
+
70
+ ```powershell
71
+ askii explain "arr.reduce((a, b) => a + b, 0)"
72
+ Get-Content myfile.ts | askii explain
73
+ ```
74
+
75
+ ---
76
+
77
+ ### `do` — Agentic task runner
78
+
79
+ Prints the working directory's top-level file listing, then runs an agent loop that creates, modifies, renames, deletes, views, and lists files until the task is done or `--max-rounds` is reached.
80
+
81
+ **bash**
82
+
83
+ ```bash
84
+ askii do "create a Jest test file for src/utils.ts"
85
+ askii do "rename all .js files to .ts in the src folder"
86
+ askii do "add a .gitignore for a Node.js project"
87
+ askii do --yes "scaffold a README for this project" # auto-confirm all
88
+ askii do --dir ./my-project "refactor index.ts"
89
+ ```
90
+
91
+ **PowerShell**
92
+
93
+ ```powershell
94
+ askii do "create a Jest test file for src/utils.ts"
95
+ askii do "rename all .js files to .ts in the src folder"
96
+ askii do "add a .gitignore for a Node.js project"
97
+ askii do --yes "scaffold a README for this project" # auto-confirm all
98
+ askii do --dir .\my-project "refactor index.ts"
99
+ ```
100
+
101
+ The agent can use the following actions each round:
102
+
103
+ | Action | Description | Requires confirmation |
104
+ | -------- | ----------------------------------------------------- | --------------------- |
105
+ | `list` | List files in a folder (`[file]` / `[folder]` labels) | No |
106
+ | `view` | Read a file's contents | No |
107
+ | `create` | Create a new file | Yes |
108
+ | `modify` | Replace text in an existing file | Yes |
109
+ | `rename` | Rename or move a file | Yes |
110
+ | `delete` | Delete a file | Yes |
111
+
112
+ The loop continues after every round — not only after reads — until the AI returns `[]` or the round limit is hit.
113
+
114
+ ---
115
+
116
+ ### `control` — Screen control agent
117
+
118
+ Takes a screenshot, sends it to the AI, and executes the returned mouse/keyboard action. Repeats until the AI returns `DONE` or `--max-rounds` is reached. Requires a **vision-capable model** (e.g. `llava`, `moondream2`).
119
+
120
+ > **Linux**: requires `xdotool` for mouse/keyboard control (`sudo apt install xdotool` or equivalent).
121
+
122
+ **bash**
123
+
124
+ ```bash
125
+ askii control --ollama-model llava "open Notepad and type hello world"
126
+ askii control --yes --ollama-model llava "click the search bar and search for cats"
127
+ askii control --max-rounds 10 --ollama-model llava "fill in the login form"
128
+ askii control -p lmstudio --lmstudio-model llava-1.5 "open the browser"
129
+ ```
130
+
131
+ **PowerShell**
132
+
133
+ ```powershell
134
+ askii control --ollama-model llava "open Notepad and type hello world"
135
+ askii control --yes --ollama-model llava "click the search bar and search for cats"
136
+ askii control --max-rounds 10 --ollama-model llava "fill in the login form"
137
+ askii control -p lmstudio --lmstudio-model llava-1.5 "open the browser"
138
+ ```
139
+
140
+ Each round the AI can return one of:
141
+
142
+ - **mouse_move** — move the cursor to `(x, y)`
143
+ - **mouse_left_click** — left-click at `(x, y)`
144
+ - **mouse_right_click** — right-click at `(x, y)`
145
+ - **keyboard_input** — type a string
146
+ - **DONE** — task complete, stop the loop
147
+
148
+ Without `--yes`, each proposed action is shown with its reasoning and requires `y` confirmation before executing.
149
+
150
+ ---
151
+
152
+ ### `browse` — Browser agent
153
+
154
+ Launches a Puppeteer browser, takes a screenshot of the current page and its URL, sends both to the AI, and executes the returned action. Repeats until the AI returns `DONE` or `--max-rounds` is reached. Requires a **vision-capable model** (e.g. `llava`, `moondream2`).
155
+
156
+ By default the browser window is **visible**. Pass `--headless` to run in the background.
157
+
158
+ **bash**
159
+
160
+ ```bash
161
+ askii browse --ollama-model llava "go to https://example.com and click Learn more"
162
+ askii browse --yes --ollama-model llava "search Google for Node.js and open the first result"
163
+ askii browse --headless --yes --ollama-model llava "check the title of https://github.com"
164
+ askii browse --max-rounds 10 --ollama-model llava "fill in the login form on example.com"
165
+ askii browse -p lmstudio --lmstudio-model llava-1.5 "go to news.ycombinator.com"
166
+ ```
167
+
168
+ **PowerShell**
169
+
170
+ ```powershell
171
+ askii browse --ollama-model llava "go to https://example.com and click Learn more"
172
+ askii browse --yes --ollama-model llava "search Google for Node.js and open the first result"
173
+ askii browse --headless --yes --ollama-model llava "check the title of https://github.com"
174
+ askii browse --max-rounds 10 --ollama-model llava "fill in the login form on example.com"
175
+ askii browse -p lmstudio --lmstudio-model llava-1.5 "go to news.ycombinator.com"
176
+ ```
177
+
178
+ Each round the AI can return one of:
179
+
180
+ - **goto** — navigate to a URL
181
+ - **click** — click an element by CSS selector
182
+ - **type** — type text into an element by CSS selector (clears existing value first)
183
+ - **wait_for** — wait until a CSS selector appears in the DOM
184
+ - **back** — navigate back in browser history
185
+ - **forward** — navigate forward in browser history
186
+ - **DONE** — task complete, stop the loop
187
+
188
+ Without `--yes`, each proposed action is shown with its reasoning and requires `y` confirmation before executing.
189
+
190
+ ---
191
+
192
+ ## Options
193
+
194
+ | Flag | Short | Description | Default |
195
+ | ------------------ | ----- | ------------------------------------------------ | ------------------------ |
196
+ | `--platform` | `-p` | LLM platform: `ollama`, `lmstudio` | `ollama` |
197
+ | `--ollama-url` | | Ollama server URL | `http://localhost:11434` |
198
+ | `--lmstudio-url` | | LM Studio server URL | `ws://localhost:1234` |
199
+ | `--ollama-model` | | Ollama model | `gemma3:270m` |
200
+ | `--lmstudio-model` | | LM Studio model | `qwen/qwen3-coder-30b` |
201
+ | `--mode` | | Response style: `helpful`, `funny` | `funny` |
202
+ | `--max-rounds` | | Max agent rounds for `do` / `control` / `browse` | `5` |
203
+ | `--dir` | | Working directory for `do` | cwd |
204
+ | `--code` | `-c` | Code input (alternative to stdin) | |
205
+ | `--yes` | `-y` | Auto-confirm all actions | |
206
+ | `--headless` | | Run Puppeteer headlessly for `browse` | `false` (visible) |
207
+
208
+ ## Environment Variables
209
+
210
+ **bash**
211
+
212
+ ```bash
213
+ export ASKII_PLATFORM=ollama
214
+
215
+ # Ollama
216
+ export ASKII_OLLAMA_URL=http://localhost:11434
217
+ export ASKII_OLLAMA_MODEL=gemma3:270m
218
+
219
+ # LM Studio
220
+ export ASKII_LMSTUDIO_URL=ws://localhost:1234
221
+ export ASKII_LMSTUDIO_MODEL=qwen/qwen3-coder-30b
222
+
223
+ # Shared
224
+ export ASKII_MODE=funny
225
+ export ASKII_MAX_ROUNDS=5
226
+ ```
227
+
228
+ **PowerShell**
229
+
230
+ ```powershell
231
+ $env:ASKII_PLATFORM = "ollama"
232
+
233
+ # Ollama
234
+ $env:ASKII_OLLAMA_URL = "http://localhost:11434"
235
+ $env:ASKII_OLLAMA_MODEL = "gemma3:270m"
236
+
237
+ # LM Studio
238
+ $env:ASKII_LMSTUDIO_URL = "ws://localhost:1234"
239
+ $env:ASKII_LMSTUDIO_MODEL = "qwen/qwen3-coder-30b"
240
+
241
+ # Shared
242
+ $env:ASKII_MODE = "funny"
243
+ $env:ASKII_MAX_ROUNDS = "5"
244
+ ```
245
+
246
+ ## Platforms
247
+
248
+ ### Ollama (default)
249
+
250
+ **bash**
251
+
252
+ ```bash
253
+ ollama pull gemma3:270m
254
+ askii ask "what is a closure?"
255
+ ```
256
+
257
+ **PowerShell**
258
+
259
+ ```powershell
260
+ ollama pull gemma3:270m
261
+ askii ask "what is a closure?"
262
+ ```
263
+
264
+ ### LM Studio
265
+
266
+ **bash**
267
+
268
+ ```bash
269
+ # Start LM Studio with local server enabled
270
+ askii -p lmstudio ask "explain this function"
271
+ askii -p lmstudio --lmstudio-model "my-model" ask "explain this function"
272
+ ```
273
+
274
+ **PowerShell**
275
+
276
+ ```powershell
277
+ # Start LM Studio with local server enabled
278
+ askii -p lmstudio ask "explain this function"
279
+ askii -p lmstudio --lmstudio-model "my-model" ask "explain this function"
280
+ ```