askcii 0.3.0 → 0.4.0

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.
data/README.md CHANGED
@@ -1,92 +1,249 @@
1
1
  # Askcii
2
2
 
3
- A command-line application for interacting with multiple LLM providers in a terminal-friendly way. Supports OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter, and Ollama with multi-configuration management.
3
+ **Bring the power of Large Language Models to your command line—the Unix way.**
4
+
5
+ Askcii is a terminal-native CLI tool that connects you to multiple LLM providers (OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter, and Ollama) through a simple, composable interface. It's designed to integrate seamlessly into your existing Unix workflows, treating LLMs as just another filter in your pipeline.
6
+
7
+ ## Philosophy: Why CLI, Not TUI?
8
+
9
+ In the Unix tradition, the most powerful tools are those that **compose**. They read from standard input, write to standard output, and can be chained together with pipes to create sophisticated workflows. Askcii embraces this philosophy completely.
10
+
11
+ Unlike interactive TUI (Text User Interface) applications that take over your terminal with full-screen interfaces, Askcii is a **single-purpose filter**: it takes text in, sends it to an LLM, and streams the response back out. This simple design makes it infinitely more versatile.
12
+
13
+ **What this means in practice:**
14
+
15
+ - **Pipeable**: Chain it with `grep`, `awk`, `sed`, `jq`, and any other Unix tool
16
+ - **Scriptable**: Use it in shell scripts, cron jobs, and automation workflows
17
+ - **Composable**: Combine it with your existing toolchain without context switching
18
+ - **Redirectable**: Save outputs to files, pipe to other commands, integrate into larger systems
19
+ - **Session-aware**: Maintain conversation context across invocations when needed
20
+ - **Privacy-first**: Run in private mode or use local models via Ollama for sensitive data
21
+
22
+ Askcii doesn't try to be a chat application. It's a **Unix power tool** that puts LLM capabilities directly into your pipeline, where they belong.
4
23
 
5
24
  ## Installation
6
25
 
7
- Add this line to your application's Gemfile:
26
+ ```bash
27
+ gem install askcii
28
+ ```
29
+
30
+ Or add to your Gemfile:
8
31
 
9
32
  ```ruby
10
33
  gem 'askcii'
11
34
  ```
12
35
 
13
- And then execute:
36
+ ## Quick Start
14
37
 
15
- $ bundle install
38
+ ```bash
39
+ # Simple prompt
40
+ askcii 'Explain recursive functions in one sentence'
41
+
42
+ # Pipe input from other commands
43
+ git diff | askcii 'Review this code change'
16
44
 
17
- Or install it yourself as:
45
+ # Chain with other tools
46
+ curl -s https://api.github.com/repos/ruby/ruby | askcii 'Summarize this repo' | tee summary.txt
18
47
 
19
- $ gem install askcii
48
+ # Private session (no history)
49
+ askcii -p 'What is my IP address showing?'
50
+ ```
20
51
 
21
52
  ## Usage
22
53
 
23
- ### Basic Usage
54
+ ### Basic Patterns
24
55
 
25
56
  ```bash
26
- # Basic usage
57
+ # Direct prompt
27
58
  askcii 'Your prompt here'
28
59
 
29
- # Pipe input from other commands
30
- echo 'Your context text' | askcii 'Analyze this text'
60
+ # Standard input from pipe
61
+ echo 'Context text' | askcii 'Analyze this'
31
62
 
32
- # File input
63
+ # Read from file
33
64
  askcii 'Summarize this document' < document.txt
34
65
 
35
- # Private session (no conversation history saved)
36
- askcii -p 'Tell me a joke'
66
+ # Redirect output to file
67
+ askcii 'Write a bash script to backup /home' > backup.sh
37
68
 
38
- # Get the last response from your current session
39
- askcii -r
69
+ # Chain multiple commands
70
+ cat error.log | grep ERROR | askcii 'What are the common patterns?' | less
71
+ ```
72
+
73
+ ### Command-Line Options
40
74
 
41
- # Use a specific configuration
42
- askcii -m 2 'Hello using configuration 2'
43
75
  ```
76
+ Usage: askcii [options] 'Your prompt here'
44
77
 
45
- ### Session Management
78
+ Options:
79
+ -p, --private Private session (no conversation history saved)
80
+ -r, --last-response Retrieve and output the last assistant response
81
+ -c, --configure Launch configuration management interface
82
+ -m, --model ID Use specific configuration by ID number
83
+ -h, --help Show this help message
84
+ ```
85
+
86
+ ## Real-World Examples
87
+
88
+ ### Code Analysis & Development
46
89
 
47
90
  ```bash
48
- # Set a custom session ID to maintain conversation context
49
- ASKCII_SESSION="project-research" askcii 'What did we talk about earlier?'
91
+ # Code review with detailed feedback
92
+ git diff main..feature-branch | askcii 'Review these changes. Focus on security and performance.'
50
93
 
51
- # Generate a new session for each terminal session
52
- export ASKCII_SESSION=$(openssl rand -hex 16)
94
+ # Explain unfamiliar code
95
+ cat legacy_module.rb | askcii 'Explain what this code does and identify potential issues'
96
+
97
+ # Generate unit tests
98
+ askcii 'Write RSpec tests for a User model with email validation' > spec/user_spec.rb
99
+
100
+ # Debug assistance
101
+ tail -50 production.log | grep ERROR | askcii 'What are the root causes of these errors?'
102
+
103
+ # Refactoring suggestions
104
+ cat messy_controller.rb | askcii 'Suggest refactoring to improve this code'
105
+
106
+ # Documentation generation
107
+ ls -R lib/ | askcii 'Create a project structure overview' > STRUCTURE.md
53
108
  ```
54
109
 
55
- ### Command Line Options
110
+ ### Data Processing & Analysis
111
+
112
+ ```bash
113
+ # CSV to JSON conversion
114
+ cat users.csv | askcii 'Convert this CSV to JSON array format' > users.json
115
+
116
+ # Log analysis and summarization
117
+ tail -1000 /var/log/nginx/access.log | askcii 'Summarize traffic patterns and anomalies'
118
+
119
+ # Data extraction from unstructured text
120
+ curl -s https://example.com/article | askcii 'Extract all email addresses and URLs as a list'
121
+
122
+ # SQL query generation
123
+ askcii 'Write a PostgreSQL query to find duplicate users by email' >> queries.sql
56
124
 
125
+ # API response analysis
126
+ curl -s https://api.service.com/status | jq . | askcii 'Is this API healthy? Explain the metrics.'
57
127
  ```
58
- Usage: askcii [options] 'Your prompt here'
59
128
 
60
- Options:
61
- -p, --private Start a private session and do not record
62
- -r, --last-response Output the last response
63
- -c, --configure Manage configurations
64
- -m, --model ID Use specific configuration ID
65
- -h, --help Show help
129
+ ### System Administration
130
+
131
+ ```bash
132
+ # Server health check summary
133
+ df -h && free -h && uptime | askcii 'Assess system health and recommend actions'
134
+
135
+ # Parse and explain complex configs
136
+ cat /etc/nginx/nginx.conf | askcii 'Explain this configuration and suggest optimizations'
137
+
138
+ # Security audit
139
+ find . -name "*.sh" -exec cat {} \; | askcii 'Review these shell scripts for security issues'
140
+
141
+ # Quick command help
142
+ askcii 'Show me tar command examples for incremental backups'
143
+
144
+ # Incident analysis
145
+ journalctl --since "1 hour ago" | askcii 'Identify any critical system events'
146
+ ```
147
+
148
+ ### Documentation & Writing
149
+
150
+ ```bash
151
+ # Generate README sections
152
+ askcii 'Write installation instructions for a Ruby gem' >> README.md
153
+
154
+ # Meeting notes to action items
155
+ cat meeting_transcript.txt | askcii 'Extract action items with owners as markdown checklist'
156
+
157
+ # Explain technical concepts
158
+ askcii 'Explain OAuth2 flow in simple terms' > oauth_explainer.md
159
+
160
+ # Create Git commit messages
161
+ git diff --staged | askcii 'Write a conventional commit message' | pbcopy
162
+ ```
163
+
164
+ ### Session-Based Conversations
165
+
166
+ ```bash
167
+ # Named session for ongoing work
168
+ export ASKCII_SESSION="database-migration"
169
+ askcii 'I need to migrate from MySQL to PostgreSQL'
170
+ askcii 'What about handling JSON columns?' # Remembers context
171
+ askcii 'Show migration script for users table' > migrate_users.sql
172
+
173
+ # Project-specific session
174
+ ASKCII_SESSION="feature-auth" askcii 'How should I implement 2FA?'
175
+ ASKCII_SESSION="feature-auth" askcii 'Show me the code for TOTP generation'
176
+
177
+ # Retrieve last response (useful when output scrolled away)
178
+ askcii -r | less
179
+ ```
180
+
181
+ ### Multi-Provider Workflows
182
+
183
+ ```bash
184
+ # Use Claude for creative content
185
+ askcii -m 1 'Write a technical blog post intro about WebAssembly' > blog_draft.md
186
+
187
+ # Use GPT-4 for code generation
188
+ askcii -m 2 'Create a Python class for rate limiting' > rate_limiter.py
189
+
190
+ # Use local Ollama for private/sensitive data
191
+ cat proprietary_data.txt | askcii -m 3 -p 'Analyze this confidential report'
192
+
193
+ # Use DeepSeek for cost-effective tasks
194
+ find . -name "*.rb" | xargs wc -l | askcii -m 4 'Summarize codebase statistics'
195
+ ```
196
+
197
+ ### Advanced Compositions
198
+
199
+ ```bash
200
+ # Multi-stage pipeline
201
+ cat research_papers.txt | \
202
+ askcii 'Extract key findings' | \
203
+ askcii 'Group by topic' | \
204
+ askcii 'Create a bibliography' > bibliography.md
205
+
206
+ # Watch and analyze in real-time
207
+ tail -f app.log | grep --line-buffered ERROR | while read line; do
208
+ echo "$line" | askcii -p 'Explain this error briefly'
209
+ done
210
+
211
+ # Batch processing with parallel
212
+ find . -name "*.java" | parallel -j4 "cat {} | askcii 'Rate code quality 1-10' | echo {}: "
213
+
214
+ # Interactive script integration
215
+ #!/bin/bash
216
+ context=$(cat context.txt)
217
+ while true; do
218
+ read -p "Question: " question
219
+ echo "$context" | askcii "$question"
220
+ done
66
221
  ```
67
222
 
68
223
  ## Configuration Management
69
224
 
70
- Askcii supports multi-configuration management, allowing you to easily switch between different LLM providers and models.
225
+ Askcii supports multiple provider configurations, allowing you to switch between different LLMs based on your needs—cost, privacy, capability, or speed.
71
226
 
72
- ### Interactive Configuration
227
+ ### Interactive Configuration Setup
73
228
 
74
- Use the `-c` flag to access the configuration management interface:
229
+ Launch the configuration manager:
75
230
 
76
231
  ```bash
77
232
  askcii -c
78
233
  ```
79
234
 
80
- This will show you a menu like:
235
+ You'll see an interface like:
81
236
 
82
237
  ```
83
238
  Configuration Management
84
239
  =======================
85
240
  Current configurations:
86
- 1. GPT-4 [openai] (default)
87
- 2. Claude Sonnet [anthropic]
88
- 3. Gemini Pro [gemini]
89
- 4. Local Llama [ollama]
241
+ 1. GPT-4 Turbo [openai] (default)
242
+ 2. Claude 3.5 Sonnet [anthropic]
243
+ 3. Gemini 2.0 Flash [gemini]
244
+ 4. DeepSeek V3 [deepseek]
245
+ 5. Mixtral [openrouter]
246
+ 6. Llama 3.2 [ollama]
90
247
 
91
248
  Options:
92
249
  1. Add new configuration
@@ -97,127 +254,209 @@ Options:
97
254
 
98
255
  ### Supported Providers
99
256
 
100
- 1. **OpenAI** - GPT models (gpt-4, gpt-3.5-turbo, etc.)
101
- 2. **Anthropic** - Claude models (claude-3-sonnet, claude-3-haiku, etc.)
102
- 3. **Gemini** - Google's Gemini models
103
- 4. **DeepSeek** - DeepSeek models
104
- 5. **OpenRouter** - Access to multiple models through OpenRouter
105
- 6. **Ollama** - Local models (no API key required)
257
+ | Provider | Use Case | API Key Required |
258
+ |----------|----------|------------------|
259
+ | **OpenAI** | GPT models (GPT-4, GPT-4 Turbo, GPT-3.5) | Yes |
260
+ | **Anthropic** | Claude models (Opus, Sonnet, Haiku) | Yes |
261
+ | **Gemini** | Google's Gemini models | Yes |
262
+ | **DeepSeek** | Cost-effective DeepSeek models | Yes |
263
+ | **OpenRouter** | Access 100+ models through one API | Yes |
264
+ | **Ollama** | Local models (Llama, Mistral, etc.) | No |
106
265
 
107
- ### Adding a New Configuration
266
+ ### Adding Configurations
108
267
 
109
- When adding a configuration, you'll be prompted for:
268
+ When you add a new configuration, you provide:
110
269
 
111
- 1. **Configuration name** - A friendly name for this configuration
112
- 2. **Provider** - Choose from the supported providers
113
- 3. **API key** - Your API key for the provider (not needed for Ollama)
114
- 4. **API endpoint** - The API endpoint (defaults provided for each provider)
115
- 5. **Model ID** - The specific model to use
270
+ 1. **Name**: Friendly identifier (e.g., "GPT-4 for Code")
271
+ 2. **Provider**: Choose from the supported list
272
+ 3. **API Key**: Your provider API key (except Ollama)
273
+ 4. **Endpoint**: API endpoint (defaults provided)
274
+ 5. **Model ID**: Specific model identifier
116
275
 
117
- Example for OpenAI:
276
+ **Example: Adding OpenAI**
118
277
  ```
119
- Enter configuration name: GPT-4 Turbo
120
- Provider (1-6): 1
121
- Enter OpenAI API key: sk-your-api-key-here
122
- Enter API endpoint (default: https://api.openai.com/v1): [press enter for default]
123
- Enter model ID: gpt-4-turbo-preview
278
+ Name: GPT-4 Turbo
279
+ Provider: 1 (OpenAI)
280
+ API Key: sk-proj-xxxxxxxxxxxxx
281
+ Endpoint: [leave blank for default]
282
+ Model ID: gpt-4-turbo-preview
124
283
  ```
125
284
 
126
- Example for Ollama (local):
285
+ **Example: Adding Ollama (Local)**
127
286
  ```
128
- Enter configuration name: Local Llama
129
- Provider (1-6): 6
130
- Enter API endpoint (default: http://localhost:11434/v1): [press enter for default]
131
- Enter model ID: llama3:8b
287
+ Name: Local Llama
288
+ Provider: 6 (Ollama)
289
+ Endpoint: http://localhost:11434/v1
290
+ Model ID: llama3.2:latest
132
291
  ```
133
292
 
134
293
  ### Using Configurations
135
294
 
136
295
  ```bash
137
- # Use the default configuration
296
+ # Use default configuration
138
297
  askcii 'Hello world'
139
298
 
140
- # Use a specific configuration by ID
141
- askcii -m 2 'Hello using configuration 2'
299
+ # Use specific configuration by ID
300
+ askcii -m 2 'Use Claude for this'
142
301
 
143
- # List all configurations
144
- askcii -c
302
+ # Switch default in config manager
303
+ askcii -c # Then select "Set default configuration"
145
304
  ```
146
305
 
147
- ### Configuration Storage
148
-
149
- Configuration settings are stored in a SQLite database located at `~/.local/share/askcii/askcii.db`.
150
-
151
306
  ### Environment Variable Fallback
152
307
 
153
- You can still use environment variables as a fallback when no configurations are set up:
308
+ For quick one-offs or CI/CD environments, use environment variables:
154
309
 
155
310
  ```bash
156
- ASKCII_API_KEY="your_api_key" askcii 'Hello!'
157
- ASKCII_API_ENDPOINT="https://api.example.com/v1" askcii 'Hello!'
158
- ASKCII_MODEL_ID="gpt-4" askcii 'Hello!'
311
+ # Quick override
312
+ ASKCII_API_KEY="sk-xxx" ASKCII_MODEL_ID="gpt-4" askcii 'Quick question'
313
+
314
+ # In scripts
315
+ export ASKCII_API_KEY="your_key"
316
+ export ASKCII_API_ENDPOINT="https://api.openai.com/v1"
317
+ export ASKCII_MODEL_ID="gpt-3.5-turbo"
318
+ askcii 'Automated query'
159
319
  ```
160
320
 
161
- ## Examples
321
+ ## Session Management
322
+
323
+ Askcii maintains conversation context across invocations, but you control when and how.
162
324
 
163
- ### Daily Workflow Examples
325
+ ### Session Contexts
326
+
327
+ Sessions are identified by the `ASKCII_SESSION` environment variable:
164
328
 
165
329
  ```bash
166
- # Code review
167
- git diff | askcii 'Review this code change and suggest improvements'
330
+ # Random session per terminal session (recommended)
331
+ export ASKCII_SESSION=$(openssl rand -hex 16)
168
332
 
169
- # Log analysis
170
- tail -100 /var/log/app.log | askcii 'Summarize any errors or issues'
333
+ # Named session for a specific project
334
+ export ASKCII_SESSION="refactoring-auth-module"
335
+ askcii 'What patterns should I use for the auth module?'
336
+ askcii 'Show code for the JWT validator' # Remembers previous context
171
337
 
172
- # Documentation
173
- askcii 'Explain how to set up a Redis cluster' > redis-setup.md
338
+ # One-off session (no context retention)
339
+ askcii 'Standalone question' # Creates random session ID
174
340
 
175
- # Quick calculations
176
- askcii 'Calculate compound interest: $1000 at 5% for 10 years'
341
+ # Private mode (no database storage at all)
342
+ askcii -p 'What is 2+2?' # No session, no history
343
+ ```
177
344
 
178
- # Text processing
179
- cat customers.csv | askcii 'Convert this CSV to JSON format'
345
+ ### Retrieving Responses
346
+
347
+ ```bash
348
+ # Get last response from current session
349
+ askcii -r
350
+
351
+ # Useful in scripts
352
+ last_response=$(askcii -r)
353
+ echo "$last_response" | process_further.sh
354
+
355
+ # Copy to clipboard
356
+ askcii -r | pbcopy # macOS
357
+ askcii -r | xclip -selection clipboard # Linux
180
358
  ```
181
359
 
182
- ### Multi-Provider Usage
360
+ ### Privacy Considerations
183
361
 
184
362
  ```bash
185
- # Use Claude for creative writing
186
- askcii -m 1 'Write a short story about AI'
363
+ # Private mode: no storage, no history
364
+ askcii -p 'Analyze this sensitive data' < confidential.txt
187
365
 
188
- # Use GPT-4 for code analysis
189
- askcii -m 2 'Explain this Python function' < function.py
366
+ # Use local Ollama for complete privacy
367
+ askcii -m 6 'Process private information' < private.txt
190
368
 
191
- # Use local Ollama for private data
192
- askcii -m 3 -p 'Analyze this sensitive document' < confidential.txt
369
+ # Session isolation
370
+ ASKCII_SESSION="temp-$(date +%s)" askcii 'Temporary context'
193
371
  ```
194
372
 
195
- ## Session Management
373
+ ## Data Storage
196
374
 
197
- Askcii maintains conversation history unless you use the private mode (`-p`). Sessions are identified by:
375
+ - **Database**: `~/.local/share/askcii/askcii.db` (SQLite)
376
+ - **Stored**: Conversations, messages, configurations
377
+ - **Not stored**: Private mode sessions (`-p` flag)
198
378
 
199
- 1. The `ASKCII_SESSION` environment variable
200
- 2. A randomly generated session ID if not specified
379
+ ## Integration Examples
380
+
381
+ ### Git Hooks
201
382
 
202
383
  ```bash
203
- # Start a named session for a project
204
- export ASKCII_SESSION="project-alpha"
205
- askcii 'What is the project timeline?'
206
- askcii 'What are the main risks?' # This will have context from previous question
384
+ # .git/hooks/pre-commit
385
+ #!/bin/bash
386
+ git diff --cached | askcii -p 'Any obvious issues with this commit?' | tee /dev/tty
387
+ read -p "Proceed with commit? [y/N] " -n 1 -r
388
+ echo
389
+ [[ $REPLY =~ ^[Yy]$ ]] || exit 1
390
+ ```
207
391
 
208
- # Use private mode for one-off questions
209
- askcii -p 'What is the weather like?'
392
+ ### Vim Integration
210
393
 
211
- # Get the last response from current session
212
- askcii -r
394
+ ```vim
395
+ " In ~/.vimrc - send selection to askcii
396
+ vnoremap <leader>a :w !askcii 'Improve this code'<CR>
397
+ ```
398
+
399
+ ### Shell Aliases
400
+
401
+ ```bash
402
+ # ~/.bashrc or ~/.zshrc
403
+ alias explain='askcii "Explain this command:"'
404
+ alias review='git diff | askcii "Review this code:"'
405
+ alias commit-msg='git diff --staged | askcii -p "Write a commit message:" | head -1'
406
+ alias tldr='askcii "Summarize in 3 bullets:"'
407
+ ```
408
+
409
+ ### Makefiles
410
+
411
+ ```makefile
412
+ .PHONY: analyze
413
+ analyze:
414
+ @find src/ -name "*.rb" -exec cat {} \; | askcii 'Code quality report' > analysis.txt
415
+ @echo "Analysis saved to analysis.txt"
213
416
  ```
214
417
 
215
418
  ## Development
216
419
 
217
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
420
+ ```bash
421
+ # Setup
422
+ git clone https://github.com/yourusername/askcii.git
423
+ cd askcii
424
+ bin/setup
425
+
426
+ # Run locally
427
+ bin/askcii 'Test prompt'
428
+
429
+ # Run tests
430
+ rake test
218
431
 
219
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
432
+ # Interactive console
433
+ bin/console
434
+
435
+ # Build and install locally
436
+ bundle exec rake build
437
+ bundle exec rake install
438
+ ```
439
+
440
+ ## Why Askcii?
441
+
442
+ **Unix Philosophy**: Do one thing well. Askcii is a filter, not an application.
443
+
444
+ **Provider Agnostic**: Switch between OpenAI, Anthropic, local models—same interface.
445
+
446
+ **Session Awareness**: Maintain context when needed, forget when you don't.
447
+
448
+ **Privacy First**: Private mode and local model support for sensitive workflows.
449
+
450
+ **Scriptable**: Integrates into automation, cron jobs, CI/CD pipelines.
451
+
452
+ **Composable**: Works with every other Unix tool you already know.
453
+
454
+ **Terminal Native**: No context switching, no browser tabs, no GUI overhead.
220
455
 
221
456
  ## License
222
457
 
223
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
458
+ MIT License - See [LICENSE](https://opensource.org/licenses/MIT)
459
+
460
+ ---
461
+
462
+ **Askcii**: Because the best interface is the one you're already using.
@@ -0,0 +1,64 @@
1
+ # Shell Completions
2
+
3
+ This directory contains shell completion scripts for askcii.
4
+
5
+ ## Installation
6
+
7
+ ### Bash
8
+
9
+ Add the following to your `~/.bashrc` or `~/.bash_profile`:
10
+
11
+ ```bash
12
+ source /path/to/askcii/completions/askcii.bash
13
+ ```
14
+
15
+ Or copy the completion file to your bash completions directory:
16
+
17
+ ```bash
18
+ # On macOS with Homebrew:
19
+ cp completions/askcii.bash $(brew --prefix)/etc/bash_completion.d/askcii
20
+
21
+ # On Linux:
22
+ sudo cp completions/askcii.bash /etc/bash_completion.d/askcii
23
+ ```
24
+
25
+ ### Zsh
26
+
27
+ Add the following to your `~/.zshrc`:
28
+
29
+ ```zsh
30
+ fpath=(~/path/to/askcii/completions $fpath)
31
+ autoload -Uz compinit && compinit
32
+ ```
33
+
34
+ Or copy the completion file to your zsh completions directory:
35
+
36
+ ```bash
37
+ # Create completions directory if it doesn't exist
38
+ mkdir -p ~/.zsh/completions
39
+
40
+ # Copy the completion file
41
+ cp completions/askcii.zsh ~/.zsh/completions/_askcii
42
+
43
+ # Add to ~/.zshrc if not already present:
44
+ # fpath=(~/.zsh/completions $fpath)
45
+ # autoload -Uz compinit && compinit
46
+ ```
47
+
48
+ ## Features
49
+
50
+ - Completes all command-line flags
51
+ - Suggests configuration IDs after `-m` or `--model` flags (bash only)
52
+ - Provides contextual help for each flag
53
+
54
+ ## Reload Shell
55
+
56
+ After installation, reload your shell or source your configuration file:
57
+
58
+ ```bash
59
+ # For bash
60
+ source ~/.bashrc
61
+
62
+ # For zsh
63
+ source ~/.zshrc
64
+ ```
@@ -0,0 +1,29 @@
1
+ # bash completion for askcii
2
+
3
+ _askcii() {
4
+ local cur prev opts
5
+ COMPREPLY=()
6
+ cur="${COMP_WORDS[COMP_CWORD]}"
7
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
8
+ opts="-p --private -r --last-response -c --configure -m --model -v --verbose --session --list-sessions --history --clear-history -h --help"
9
+
10
+ # Complete configuration IDs after -m/--model
11
+ if [[ ${prev} == "-m" || ${prev} == "--model" ]]; then
12
+ # Try to get configuration IDs from askcii
13
+ local configs=$(askcii -c 2>/dev/null | grep -oP '^\s+\d+\.' | tr -d ' .')
14
+ COMPREPLY=( $(compgen -W "${configs}" -- ${cur}) )
15
+ return 0
16
+ fi
17
+
18
+ # Complete session names after --session
19
+ if [[ ${prev} == "--session" ]]; then
20
+ # Could list available sessions here
21
+ return 0
22
+ fi
23
+
24
+ # Complete flags
25
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
26
+ return 0
27
+ }
28
+
29
+ complete -F _askcii askcii