aia 0.9.11 → 0.9.12

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/CHANGELOG.md +66 -2
  4. data/README.md +133 -4
  5. data/docs/advanced-prompting.md +721 -0
  6. data/docs/cli-reference.md +582 -0
  7. data/docs/configuration.md +347 -0
  8. data/docs/contributing.md +332 -0
  9. data/docs/directives-reference.md +490 -0
  10. data/docs/examples/index.md +277 -0
  11. data/docs/examples/mcp/index.md +479 -0
  12. data/docs/examples/prompts/analysis/index.md +78 -0
  13. data/docs/examples/prompts/automation/index.md +108 -0
  14. data/docs/examples/prompts/development/index.md +125 -0
  15. data/docs/examples/prompts/index.md +333 -0
  16. data/docs/examples/prompts/learning/index.md +127 -0
  17. data/docs/examples/prompts/writing/index.md +62 -0
  18. data/docs/examples/tools/index.md +292 -0
  19. data/docs/faq.md +414 -0
  20. data/docs/guides/available-models.md +366 -0
  21. data/docs/guides/basic-usage.md +477 -0
  22. data/docs/guides/chat.md +474 -0
  23. data/docs/guides/executable-prompts.md +417 -0
  24. data/docs/guides/first-prompt.md +454 -0
  25. data/docs/guides/getting-started.md +455 -0
  26. data/docs/guides/image-generation.md +507 -0
  27. data/docs/guides/index.md +46 -0
  28. data/docs/guides/models.md +507 -0
  29. data/docs/guides/tools.md +856 -0
  30. data/docs/index.md +173 -0
  31. data/docs/installation.md +238 -0
  32. data/docs/mcp-integration.md +612 -0
  33. data/docs/prompt_management.md +579 -0
  34. data/docs/security.md +629 -0
  35. data/docs/tools-and-mcp-examples.md +1186 -0
  36. data/docs/workflows-and-pipelines.md +563 -0
  37. data/examples/tools/mcp/github_mcp_server.json +11 -0
  38. data/examples/tools/mcp/imcp.json +7 -0
  39. data/lib/aia/chat_processor_service.rb +19 -3
  40. data/lib/aia/config/base.rb +224 -0
  41. data/lib/aia/config/cli_parser.rb +409 -0
  42. data/lib/aia/config/defaults.rb +88 -0
  43. data/lib/aia/config/file_loader.rb +131 -0
  44. data/lib/aia/config/validator.rb +184 -0
  45. data/lib/aia/config.rb +10 -860
  46. data/lib/aia/directive_processor.rb +27 -372
  47. data/lib/aia/directives/configuration.rb +114 -0
  48. data/lib/aia/directives/execution.rb +37 -0
  49. data/lib/aia/directives/models.rb +178 -0
  50. data/lib/aia/directives/registry.rb +120 -0
  51. data/lib/aia/directives/utility.rb +70 -0
  52. data/lib/aia/directives/web_and_file.rb +71 -0
  53. data/lib/aia/prompt_handler.rb +23 -3
  54. data/lib/aia/ruby_llm_adapter.rb +307 -128
  55. data/lib/aia/session.rb +27 -14
  56. data/lib/aia/utility.rb +12 -8
  57. data/lib/aia.rb +11 -2
  58. data/lib/extensions/ruby_llm/.irbrc +56 -0
  59. data/mkdocs.yml +165 -0
  60. metadata +77 -20
  61. /data/{images → docs/assets/images}/aia.png +0 -0
@@ -0,0 +1,455 @@
1
+ # Getting Started with AIA
2
+
3
+ This guide will walk you through your first steps with AIA, from basic usage to creating your first prompts and workflows.
4
+
5
+ ## Prerequisites
6
+
7
+ Before starting, make sure you have:
8
+
9
+ - [Installed AIA](../installation.md)
10
+ - Set up your API keys (see [Installation](../installation.md#4-set-up-api-keys))
11
+ - Created your prompts directory (`~/.prompts`)
12
+
13
+ ## Your First AIA Command
14
+
15
+ Let's start with the simplest possible usage:
16
+
17
+ ```bash
18
+ aia --chat
19
+ ```
20
+
21
+ This opens an interactive chat session. Type your question and press Enter:
22
+
23
+ ```
24
+ You: Hello, what can you help me with?
25
+ AI: Hello! I'm an AI assistant that can help you with a wide variety of tasks...
26
+ ```
27
+
28
+ Type `exit` or press Ctrl+C to end the chat.
29
+
30
+ ## Basic Usage Patterns
31
+
32
+ ### 1. Direct Questions
33
+
34
+ Ask questions directly without creating prompt files:
35
+
36
+ ```bash
37
+ # Simple question
38
+ aia --chat "What's the capital of France?"
39
+
40
+ # Technical question
41
+ aia --chat "Explain how HTTP works"
42
+ ```
43
+
44
+ ### 2. Using Different Models
45
+
46
+ Specify which AI model to use:
47
+
48
+ ```bash
49
+ # Use GPT-4
50
+ aia --model gpt-4 --chat
51
+
52
+ # Use Claude
53
+ aia --model claude-3-sonnet --chat
54
+
55
+ # See all available models
56
+ aia --available_models
57
+ ```
58
+
59
+ ### 3. Adjusting AI Behavior
60
+
61
+ Control the AI's response style:
62
+
63
+ ```bash
64
+ # More creative responses
65
+ aia --temperature 1.2 --chat
66
+
67
+ # More focused responses
68
+ aia --temperature 0.3 --chat
69
+
70
+ # Shorter responses
71
+ aia --terse --chat
72
+
73
+ # Limit response length
74
+ aia --max_tokens 100 --chat
75
+ ```
76
+
77
+ ## Creating Your First Prompt
78
+
79
+ Instead of typing questions each time, you can create reusable prompt files.
80
+
81
+ ### 1. Create a Simple Prompt
82
+
83
+ ```bash
84
+ # Create your first prompt file
85
+ echo "Explain this code and suggest improvements:" > ~/.prompts/code_review.txt
86
+ ```
87
+
88
+ ### 2. Use the Prompt
89
+
90
+ ```bash
91
+ # Run the prompt (you'll be asked for the code to review)
92
+ aia code_review
93
+
94
+ # Or provide a context file
95
+ aia code_review my_script.py
96
+ ```
97
+
98
+ ### 3. Create a More Complex Prompt
99
+
100
+ ```bash
101
+ cat > ~/.prompts/blog_writer.txt << 'EOF'
102
+ Write a professional blog post about the following topic:
103
+
104
+ Topic: <%= topic %>
105
+ Target audience: <%= audience %>
106
+ Word count: <%= word_count %>
107
+
108
+ Please include:
109
+ - An engaging introduction
110
+ - Well-structured main points
111
+ - A compelling conclusion
112
+ - SEO-friendly headings
113
+ EOF
114
+ ```
115
+
116
+ Use it with parameters:
117
+
118
+ ```bash
119
+ aia blog_writer --topic "AI productivity tools" --audience "developers" --word_count 800
120
+ ```
121
+
122
+ ## Understanding Prompts with Context
123
+
124
+ AIA can include context from files:
125
+
126
+ ### 1. Review Code Files
127
+
128
+ ```bash
129
+ # Review a specific file
130
+ aia code_review src/main.rb
131
+
132
+ # Review multiple files
133
+ aia code_review src/*.rb
134
+ ```
135
+
136
+ ### 2. Analyze Documents
137
+
138
+ ```bash
139
+ # Analyze a document
140
+ echo "Summarize this document and extract key points:" > ~/.prompts/summarize.txt
141
+ aia summarize report.pdf
142
+ ```
143
+
144
+ ### 3. Process Data Files
145
+
146
+ ```bash
147
+ # Create a data analysis prompt
148
+ echo "Analyze this data and provide insights:" > ~/.prompts/analyze_data.txt
149
+ aia analyze_data data.csv
150
+ ```
151
+
152
+ ## Using Directives
153
+
154
+ Prompts can include special directives for dynamic behavior:
155
+
156
+ ### 1. Configuration Directives
157
+
158
+ ```bash
159
+ cat > ~/.prompts/creative_writing.txt << 'EOF'
160
+ //config temperature 1.3
161
+ //config max_tokens 2000
162
+ //config model gpt-4
163
+
164
+ Write a creative short story about:
165
+ <%= topic %>
166
+
167
+ Make it engaging and unique!
168
+ EOF
169
+ ```
170
+
171
+ ### 2. File Inclusion Directives
172
+
173
+ ```bash
174
+ cat > ~/.prompts/project_analysis.txt << 'EOF'
175
+ Analyze this project structure and provide recommendations:
176
+
177
+ //include README.md
178
+ //include package.json
179
+ //include src/
180
+
181
+ Focus on architecture, dependencies, and best practices.
182
+ EOF
183
+ ```
184
+
185
+ ### 3. Shell Command Directives
186
+
187
+ ```bash
188
+ cat > ~/.prompts/system_status.txt << 'EOF'
189
+ Here's my current system status:
190
+
191
+ CPU Usage:
192
+ //shell top -l 1 -n 10 | head -20
193
+
194
+ Disk Usage:
195
+ //shell df -h
196
+
197
+ Memory Usage:
198
+ //shell free -h
199
+
200
+ Please analyze this and suggest optimizations.
201
+ EOF
202
+ ```
203
+
204
+ ## Working with Roles
205
+
206
+ Roles help set context for the AI:
207
+
208
+ ### 1. Create a Role File
209
+
210
+ ```bash
211
+ mkdir -p ~/.prompts/roles
212
+ cat > ~/.prompts/roles/code_expert.txt << 'EOF'
213
+ You are an expert software developer with 15+ years of experience.
214
+ You specialize in clean code, best practices, and modern development patterns.
215
+ Always provide specific, actionable advice with code examples.
216
+ EOF
217
+ ```
218
+
219
+ ### 2. Use the Role
220
+
221
+ ```bash
222
+ aia --role code_expert code_review my_app.rb
223
+ ```
224
+
225
+ ## Fuzzy Search (with fzf)
226
+
227
+ If you have `fzf` installed, you can use fuzzy search:
228
+
229
+ ```bash
230
+ # Search for prompts interactively
231
+ aia --fuzzy
232
+
233
+ # This opens a searchable list of all your prompts
234
+ ```
235
+
236
+ ## Saving Output
237
+
238
+ Save AI responses to files:
239
+
240
+ ```bash
241
+ # Save to a file
242
+ aia --out_file response.md my_prompt
243
+
244
+ # Append to an existing file
245
+ aia --out_file response.md --append my_prompt
246
+
247
+ # Format with Markdown
248
+ aia --out_file response.md --markdown my_prompt
249
+ ```
250
+
251
+ ## Chat Mode Features
252
+
253
+ ### 1. Persistent Chat
254
+
255
+ ```bash
256
+ # Start a chat that remembers context
257
+ aia --chat
258
+ ```
259
+
260
+ Within chat:
261
+ - Your conversation history is maintained
262
+ - You can reference previous messages
263
+ - Type `/help` for chat commands
264
+ - Type `/save filename.md` to save the conversation
265
+
266
+ ### 2. Chat with Initial Prompt
267
+
268
+ ```bash
269
+ # Start chat with a specific role/prompt
270
+ aia --chat --role code_expert
271
+ aia --chat system_architect
272
+ ```
273
+
274
+ ### 3. Multi-turn Conversations
275
+
276
+ ```bash
277
+ You: Explain REST APIs
278
+ AI: [Detailed explanation of REST APIs...]
279
+
280
+ You: Now give me a Python example
281
+ AI: [Python code example using the previous REST context...]
282
+
283
+ You: How would you test this?
284
+ AI: [Testing strategies specific to the Python example...]
285
+ ```
286
+
287
+ ## Common Workflows
288
+
289
+ ### 1. Code Review Workflow
290
+
291
+ ```bash
292
+ # Set up the workflow
293
+ echo "Review this code for bugs, style, and improvements:" > ~/.prompts/code_review.txt
294
+
295
+ # Use it regularly
296
+ aia code_review src/new_feature.py
297
+ aia --model claude-3-sonnet code_review complex_algorithm.rb
298
+ ```
299
+
300
+ ### 2. Documentation Workflow
301
+
302
+ ```bash
303
+ # Create documentation prompt
304
+ cat > ~/.prompts/document_code.txt << 'EOF'
305
+ Generate comprehensive documentation for this code:
306
+
307
+ //include <%= file %>
308
+
309
+ Include:
310
+ - Purpose and functionality
311
+ - Parameters and return values
312
+ - Usage examples
313
+ - Edge cases and considerations
314
+ EOF
315
+
316
+ # Use it
317
+ aia document_code --file src/api.py
318
+ ```
319
+
320
+ ### 3. Learning Workflow
321
+
322
+ ```bash
323
+ # Create learning prompt
324
+ cat > ~/.prompts/explain_concept.txt << 'EOF'
325
+ //config temperature 0.7
326
+ //role teacher
327
+
328
+ Explain the concept of "<%= concept %>" in simple terms.
329
+
330
+ Include:
331
+ - Definition and core principles
332
+ - Real-world examples
333
+ - Common use cases
334
+ - Key benefits and drawbacks
335
+ - Related concepts
336
+
337
+ Adjust the explanation for a <%= level %> level understanding.
338
+ EOF
339
+
340
+ # Use it for learning
341
+ aia explain_concept --concept "microservices" --level "beginner"
342
+ aia explain_concept --concept "machine learning" --level "intermediate"
343
+ ```
344
+
345
+ ## Best Practices
346
+
347
+ ### 1. Organize Your Prompts
348
+
349
+ ```bash
350
+ # Create a logical directory structure
351
+ mkdir -p ~/.prompts/{development,writing,analysis,personal}
352
+
353
+ # Categorize prompts
354
+ mv ~/.prompts/code_review.txt ~/.prompts/development/
355
+ mv ~/.prompts/blog_writer.txt ~/.prompts/writing/
356
+ ```
357
+
358
+ ### 2. Use Descriptive Names
359
+
360
+ ```bash
361
+ # Good prompt names
362
+ ~/.prompts/development/code_review_security.txt
363
+ ~/.prompts/writing/blog_post_technical.txt
364
+ ~/.prompts/analysis/data_insights.txt
365
+
366
+ # Avoid generic names
367
+ ~/.prompts/prompt1.txt
368
+ ~/.prompts/test.txt
369
+ ```
370
+
371
+ ### 3. Version Control Your Prompts
372
+
373
+ ```bash
374
+ cd ~/.prompts
375
+ git init
376
+ git add .
377
+ git commit -m "Initial prompt collection"
378
+
379
+ # Keep your prompts under version control
380
+ git add new_prompt.txt
381
+ git commit -m "Add prompt for API documentation"
382
+ ```
383
+
384
+ ### 4. Test Different Models
385
+
386
+ ```bash
387
+ # Test with different models to find the best fit
388
+ aia --model gpt-3.5-turbo code_review app.py
389
+ aia --model gpt-4 code_review app.py
390
+ aia --model claude-3-sonnet code_review app.py
391
+
392
+ # Compare outputs and choose the best model for each task
393
+ ```
394
+
395
+ ## Next Steps
396
+
397
+ Now that you understand the basics:
398
+
399
+ 1. **Explore Advanced Features**:
400
+ - [Chat Mode Guide](chat.md)
401
+ - [Working with Models](models.md)
402
+ - [Tools Integration](tools.md)
403
+
404
+ 2. **Learn Advanced Techniques**:
405
+ - [Advanced Prompting](../advanced-prompting.md)
406
+ - [Workflows & Pipelines](../workflows-and-pipelines.md)
407
+ - [Prompt Management](../prompt_management.md)
408
+
409
+ 3. **Browse Examples**:
410
+ - [Examples Directory](../examples/index.md)
411
+ - [Tools & MCP Examples](../tools-and-mcp-examples.md)
412
+
413
+ 4. **Reference Documentation**:
414
+ - [CLI Reference](../cli-reference.md)
415
+ - [Directives Reference](../directives-reference.md)
416
+ - [Configuration Guide](../configuration.md)
417
+
418
+ ## Troubleshooting
419
+
420
+ ### Common Issues
421
+
422
+ #### "No prompt found"
423
+ - Check that the prompt file exists: `ls ~/.prompts/`
424
+ - Verify the filename matches what you're typing
425
+ - Try fuzzy search: `aia --fuzzy`
426
+
427
+ #### "Model not available"
428
+ - Check your API keys: `echo $OPENAI_API_KEY`
429
+ - List available models: `aia --available_models`
430
+ - Check your internet connection
431
+
432
+ #### "Permission denied"
433
+ - Check file permissions: `ls -la ~/.prompts/`
434
+ - Ensure the prompts directory is readable
435
+
436
+ ### Getting Help
437
+
438
+ - Use `aia --help` for command help
439
+ - Use `--verbose` flag to see what AIA is doing
440
+ - Use `--debug` flag for detailed debugging information
441
+ - Check the [FAQ](../faq.md) for common questions
442
+ - Report issues on [GitHub](https://github.com/MadBomber/aia/issues)
443
+
444
+ ## Summary
445
+
446
+ You've learned:
447
+
448
+ - ✅ How to run basic AIA commands
449
+ - ✅ How to create and use prompts
450
+ - ✅ How to work with different AI models
451
+ - ✅ How to use roles and context files
452
+ - ✅ How to organize your workflow
453
+ - ✅ Basic troubleshooting
454
+
455
+ You're now ready to explore AIA's more advanced features and create your own AI-powered workflows!