aia 0.10.2 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07ebe0842c8ba2a8d1a24a072066564fe83954157b272b3c02ba07f86ce6e8c9
4
- data.tar.gz: 8e0e9f0b7963bed6db571e0670cedc38e4c540efca48c2b0d8ffe69545c4ba48
3
+ metadata.gz: b583dae0c86c40fc70dc5d71e39cc6781283e93af38a5773bfcfe92fbbdb9c65
4
+ data.tar.gz: ed7b710bee9a484c1f25bf450a2bcfb7ed1db701a5962a9829bc7f9404c0b370
5
5
  SHA512:
6
- metadata.gz: e248f19290dc0f2b0cb132c952e1d6a3e50cc3bf8435a2cfad5a8f7e342790a0bb23a958eee2c50bb993a0943f273b30df1e72be03ca29b929789f3885c27e17
7
- data.tar.gz: 18985b3f3348e6ed359bd5920ef44b675976ca09c40aa6e9abb17950b9260f682df0fb16a15f673e958b0cc6f2300669e92ba90b925ec73fc0620a7577863baa
6
+ metadata.gz: c00641d58b7feda9cb3930561857fd203fa7f623137e4758e87193e3528106a173a0faf1e12a57fe2dd326d6506ba4e26d4d7c33c1eda90e58ee6bd3fca4d947
7
+ data.tar.gz: b9707f94782fc48566da722b1144a7e60d90f6a8b1507e4ccb5148cd84cccbe088b066e176893500caf052cf295cfe3c20a1c80415eb2623d42180b270ae7e52
data/.envrc CHANGED
@@ -2,3 +2,10 @@ source_up
2
2
 
3
3
  export RR=`pwd`
4
4
  # PATH_add $RR/bin
5
+
6
+ # see aia --help for --model option
7
+ # The format of a "model" is [provider/]model_name[=roll_id]
8
+ # where provider and roll_id are optional
9
+ # Use a comma to seperate the models in a multi-model setup
10
+ #
11
+ # export AIA_MODEL=claude-haiku-4-5,gpt-4o-mini
data/.version CHANGED
@@ -1 +1 @@
1
- 0.10.2
1
+ 0.11.0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,53 @@
1
1
  # Changelog
2
+ ## [0.11.0] - 2026-02-02
3
+
4
+ ### New Features
5
+ - **`--list-tools` CLI Option**: List all available tools and exit
6
+ - Shows tools loaded via `--require` and `--tools` options
7
+ - Dual-mode output: plain text (word-wrapped, 3-sentence summaries) for terminal, full markdown with nested headings when STDOUT is redirected to a file or pipe
8
+ - Combine with `--mcp-list` to also initialize and list tools from MCP servers, grouped by source
9
+ - Example: `aia --require shared_tools --list-tools > tools.md`
10
+
11
+ - **`--mcp-list` Filtering**: `--mcp-list` now respects `--mcp-use` and `--mcp-skip` filters
12
+ - When filters are active, header changes from "Configured MCP Servers" to "Active MCP Servers"
13
+ - Shows only the servers that would actually be connected during a session
14
+
15
+ - **`--mcp-use` and `--mcp-skip` Server Selection**: Select or exclude specific MCP servers by name
16
+ - `--mcp-use server1,server2` - whitelist specific servers (takes precedence)
17
+ - `--mcp-skip server3` - blacklist specific servers
18
+
19
+ - **Multi-Model Environment Variable Support**: `AIA_MODEL` now supports inline role syntax
20
+ - Example: `export AIA_MODEL="gpt-4o=architect,claude=security"`
21
+
22
+ ### Breaking Changes
23
+ - **Removed `--adapter` CLI Option**: The LLM adapter configuration has been removed
24
+ - AIA now exclusively uses `ruby_llm` as its AI interface layer
25
+ - The `ai_client` adapter option is no longer available
26
+
27
+ ### Improvements
28
+ - **CLI Refactoring**: Streamlined CLI option names and improved help text
29
+ - Cleaner option grouping and descriptions in `--help` output
30
+
31
+ ### Documentation
32
+ - **`--list-tools` and `--mcp-list`**: Added comprehensive documentation to `docs/cli-reference.md` with examples, output format tables, and usage patterns
33
+ - **README.md**: Added `--mcp-list` and `--list-tools` to Key Command-Line Options table
34
+ - **MCP Integration Guide**: Updated `docs/mcp-integration.md` with current CLI syntax and examples
35
+ - **Shared Tools Guide**: Created dedicated `docs/guides/shared-tools.md` with all 17 tools organized by category (Data & Analysis, Database, File & System Operations, Web & Network, Code Execution, Documents, Scheduling & Time, Workflow & Weather, Development & Reference)
36
+ - **MkDocs Navigation**: Added Shared Tools guide to site navigation
37
+
38
+ ### Technical Changes
39
+ - Added `list_tools` attribute to `AIA::Config` for runtime flag storage
40
+ - Added `--list-tools` option to CLI parser in `setup_tool_options`
41
+ - Added `handle_list_tools` to `ConfigValidator` with dual-mode output (terminal vs redirected)
42
+ - Added `load_local_tools` with gem activation and Zeitwerk lazy-loading support for `--require` libraries
43
+ - Added `load_mcp_tools_grouped` returning tools organized by server name
44
+ - Added `quiet_mcp_logger` to suppress MCP connection noise during tool listing
45
+ - Added `filter_mcp_servers` and `mcp_filter_active?` to `ConfigValidator` for `--mcp-use`/`--mcp-skip` support
46
+ - Added `nest_markdown_headings` to properly nest markdown headings in tool descriptions under parent heading level
47
+ - Added `first_sentences` helper for terminal-mode description truncation
48
+ - Uses `word_wrapper` gem for terminal word wrapping
49
+ - Removed adapter selection logic and `--adapter` CLI option
50
+
2
51
  ## [0.10.2] - 2025-12-25
3
52
 
4
53
  **Merry Christmas!**
data/README.md CHANGED
@@ -7,15 +7,17 @@
7
7
 
8
8
  ---
9
9
 
10
- > ## ⚠️ BREAKING CHANGES IN v0.10.0 ⚠️
10
+ > ## ⚠️ BREAKING CHANGES IN v0.10.* ⚠️
11
11
  >
12
- > **Version 0.10.0 will introduce breaking changes affecting:**
12
+ > **Version 0.10.0 introduces breaking changes affecting:**
13
13
  >
14
- > - **Environment Variables** — Naming conventions for system environment variables will change
15
- > - **Configuration Files** — Both the content format and structure of configuration files will be updated
16
- > - **File Locations** — Expected locations for configuration files will change
14
+ > - **Environment Variables** — Naming conventions now use double underscore (`__`) for nested config sections (e.g., `AIA_LLM__TEMPERATURE`, `AIA_FLAGS__DEBUG`). See [Environment Variables](https://madbomber.github.io/aia/configuration/#environment-variables) for the complete list.
17
15
  >
18
- > **Please review the migration guide (coming soon) before upgrading to v0.10.0.**
16
+ > - **Configuration Files** Configuration now uses a nested YAML structure with sections like `llm:`, `prompts:`, `output:`, `flags:`, etc. The [defaults.yml](lib/aia/config/defaults.yml) file is the single source of truth for all configuration options. See [Configuration Guide](https://madbomber.github.io/aia/configuration/) for details.
17
+ >
18
+ > - **File Locations** — Configuration files now follow the XDG Base Directory Specification. The default config file location is `~/.config/aia/aia.yml`. See [Installation Guide](https://madbomber.github.io/aia/installation/) for setup instructions.
19
+ >
20
+ > **Review the [Configuration Guide](https://madbomber.github.io/aia/configuration/) before upgrading to v0.10.0.**
19
21
 
20
22
  ---
21
23
 
@@ -268,6 +270,8 @@ aia --fuzzy
268
270
  | `--fuzzy` | Use fuzzy search for prompts | `aia --fuzzy` |
269
271
  | `--tokens` | Display token usage in chat mode | `aia --chat --tokens` |
270
272
  | `--cost` | Include cost calculations with token usage | `aia --chat --cost` |
273
+ | `--mcp-list` | List configured MCP servers and exit | `aia --mcp-list` |
274
+ | `--list-tools` | List available tools and exit | `aia --require shared_tools --list-tools` |
271
275
  | `--help` | Show complete help | `aia --help` |
272
276
 
273
277
  ### Directory Structure
@@ -380,6 +384,8 @@ Your prompt content here...
380
384
  | tool_paths | --tools | [] | AIA_TOOLS__PATHS |
381
385
  | allowed_tools | --at, --allowed-tools | nil | AIA_TOOLS__ALLOWED |
382
386
  | rejected_tools | --rt, --rejected-tools | nil | AIA_TOOLS__REJECTED |
387
+ | mcp_use | --mu, --mcp-use | ~ | AIA_MCP_USE |
388
+ | mcp_skip | --ms, --mcp-skip | ~ | AIA_MCP_SKIP |
383
389
  | top_p | --top-p | 1.0 | AIA_LLM__TOP_P |
384
390
  | transcription_model | --tm, --transcription-model | whisper-1 | AIA_TRANSCRIPTION__MODEL |
385
391
  | verbose | -v, --verbose | false | AIA_FLAGS__VERBOSE |
@@ -66,6 +66,102 @@ aia --chat --cost --model gpt-4,claude-3-sonnet
66
66
 
67
67
  **Note**: `--cost` implies `--tokens`, so you don't need to specify both.
68
68
 
69
+ ### `--mcp FILE`
70
+ Load an MCP (Model Context Protocol) server from a JSON configuration file. MCP servers provide additional tools and context to AI models. Multiple `--mcp` options can be used to load multiple servers.
71
+
72
+ ```bash
73
+ # Load a single MCP server
74
+ aia --mcp ~/.config/aia/mcp/github.json my_prompt
75
+
76
+ # Load multiple MCP servers
77
+ aia --mcp github.json --mcp filesystem.json my_prompt
78
+
79
+ # Combine with chat mode
80
+ aia --chat --mcp ~/mcp-servers/memory.json
81
+ ```
82
+
83
+ **JSON file format**:
84
+ ```json
85
+ {
86
+ "name": "github",
87
+ "command": "github-mcp-server",
88
+ "args": ["stdio"],
89
+ "env": {
90
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token"
91
+ },
92
+ "timeout": 8000
93
+ }
94
+ ```
95
+
96
+ ### `--no-mcp`
97
+ Disable all MCP server processing, including servers defined in the configuration file.
98
+
99
+ ```bash
100
+ # Disable MCP server processing
101
+ aia --no-mcp my_prompt
102
+ ```
103
+
104
+ **Use cases**:
105
+ - Use `--no-mcp` when you want faster responses without MCP tool overhead
106
+ - Use `--no-mcp` to temporarily bypass MCP servers configured in your config file
107
+
108
+ ### `--mcp-list`
109
+ List configured MCP servers and exit. Shows the server name and command for each server. Useful for verifying which servers are loaded from config files and `--mcp` options.
110
+
111
+ When combined with `--mcp-use` or `--mcp-skip`, only the servers that pass the filter are shown. The header changes from "Configured" to "Active" to reflect this.
112
+
113
+ When combined with `--list-tools`, MCP servers are started and their tools are included in the tool listing (see `--list-tools`).
114
+
115
+ ```bash
116
+ # List all servers from config file
117
+ aia --mcp-list
118
+
119
+ # List servers loaded from specific MCP JSON files
120
+ aia --mcp github.json --mcp filesystem.json --mcp-list
121
+
122
+ # List only the servers that would be active after filtering
123
+ aia --mcp-list --mcp-use github,filesystem
124
+
125
+ # List all configured servers except those skipped
126
+ aia --mcp-list --mcp-skip playwright
127
+
128
+ # Combine with --list-tools to show MCP tools grouped by server
129
+ aia --mcp-list --list-tools
130
+ aia --mcp-list --list-tools --mcp-use redis
131
+ ```
132
+
133
+ ### `--mu`, `--mcp-use NAMES`
134
+ Only connect to the named MCP servers (whitelist). Server names are comma-separated and must match the `name` field in the server configuration.
135
+
136
+ ```bash
137
+ # Only use the github server
138
+ aia --mcp-use github --chat
139
+
140
+ # Only use github and filesystem servers
141
+ aia --mcp-use github,filesystem --chat
142
+
143
+ # Can be specified multiple times
144
+ aia --mu github --mu filesystem --chat
145
+ ```
146
+
147
+ **Precedence**: `--no-mcp` overrides `--mcp-use`. If both `--mcp-use` and `--mcp-skip` are specified, `--mcp-use` takes precedence.
148
+
149
+ ### `--ms`, `--mcp-skip NAMES`
150
+ Skip the named MCP servers (blacklist). All other configured servers will still be connected.
151
+
152
+ ```bash
153
+ # Skip the playwright server
154
+ aia --mcp-skip playwright --chat
155
+
156
+ # Skip multiple servers
157
+ aia --mcp-skip playwright,filesystem --chat
158
+
159
+ # Can be specified multiple times
160
+ aia --ms playwright --ms filesystem --chat
161
+ ```
162
+
163
+ **Precedence**: `--no-mcp` overrides `--mcp-skip`. If `--mcp-use` is also specified, `--mcp-skip` is ignored.
164
+
69
165
  ## Adapter Options
70
166
 
71
167
  ### `--adapter ADAPTER`
@@ -483,6 +579,80 @@ aia --rejected-tools "file_writer,system_command" my_prompt
483
579
  aia --rt "network_access" secure_prompt
484
580
  ```
485
581
 
582
+ ### `--list-tools`
583
+ List available tools and exit. Loads tools from `--require` and `--tools` options, then displays each tool's name and description.
584
+
585
+ When combined with `--mcp-list`, MCP servers are also started and their tools are included in the output, grouped by server.
586
+
587
+ **Output format depends on where stdout is directed:**
588
+
589
+ | Output | Format | Descriptions |
590
+ |--------|--------|-------------|
591
+ | Terminal | Plain text, word-wrapped | First 3 sentences |
592
+ | File/pipe | Markdown with headings | Full description |
593
+
594
+ The markdown output uses `#` for the title, `##` for source sections (Local Tools, MCP server groups), and `###` for individual tool names. Any markdown headings within a tool's description are automatically adjusted to nest under the tool's heading level.
595
+
596
+ ```bash
597
+ # List local tools loaded via --require
598
+ aia --require shared_tools --list-tools
599
+
600
+ # List local tools loaded from a file path
601
+ aia --tools ./my_tools/ --list-tools
602
+
603
+ # Combine --require and --tools
604
+ aia --require shared_tools --tools ./extras/ --list-tools
605
+
606
+ # Include MCP server tools (requires --mcp-list)
607
+ aia --require shared_tools --mcp-list --list-tools
608
+
609
+ # Include only specific MCP servers
610
+ aia --require shared_tools --mcp-list --mcp-use redis --list-tools
611
+
612
+ # Redirect to a markdown file
613
+ aia --require shared_tools --mcp-list --list-tools > tools.md
614
+
615
+ # Pipe to a markdown renderer
616
+ aia --require shared_tools --list-tools | glow -
617
+ ```
618
+
619
+ **Example terminal output:**
620
+ ```
621
+ Local Tools:
622
+
623
+ calculator
624
+ Perform advanced mathematical calculations with comprehensive
625
+ error handling and validation. This tool supports basic arithmetic
626
+ operations, parentheses, and common mathematical functions.
627
+
628
+ weather_tool
629
+ Retrieve comprehensive current weather information for any city
630
+ worldwide using the OpenWeatherMap API. This tool provides real-time
631
+ weather data including temperature, atmospheric conditions, humidity,
632
+ and wind information.
633
+ ```
634
+
635
+ **Example markdown output (when redirected):**
636
+ ```markdown
637
+ # Available Tools
638
+
639
+ > 20 tools from 2 sources
640
+
641
+ ## Local Tools (15)
642
+
643
+ ### `calculator`
644
+
645
+ Perform advanced mathematical calculations with comprehensive error
646
+ handling and validation. This tool supports basic arithmetic operations,
647
+ parentheses, and common mathematical functions. ...full description...
648
+
649
+ ## MCP: redis (5)
650
+
651
+ ### `set`
652
+
653
+ Set a Redis string value with an optional expiration time. ...full description...
654
+ ```
655
+
486
656
  ## Utility Options
487
657
 
488
658
  ### Log Level Options
@@ -675,28 +845,48 @@ Many CLI options have corresponding environment variables with the `AIA_` prefix
675
845
  Use double underscore (`__`) for nested configuration sections:
676
846
 
677
847
  ```bash
678
- # Model configuration (top-level)
848
+ # Model configuration (top-level, supports MODEL=ROLE syntax)
679
849
  export AIA_MODEL="gpt-4"
680
-
681
- # Model with inline role syntax
682
850
  export AIA_MODEL="gpt-4o=architect"
683
-
684
- # Multiple models with roles
685
851
  export AIA_MODEL="gpt-4o=architect,claude=security,gemini=performance"
686
852
 
687
853
  # LLM settings (nested under llm:)
854
+ export AIA_LLM__ADAPTER="ruby_llm"
688
855
  export AIA_LLM__TEMPERATURE="0.8"
856
+ export AIA_LLM__MAX_TOKENS="2048"
689
857
 
690
858
  # Prompts settings (nested under prompts:)
691
859
  export AIA_PROMPTS__DIR="/custom/prompts"
860
+ export AIA_PROMPTS__ROLES_PREFIX="roles"
861
+
862
+ # Output settings (nested under output:)
863
+ export AIA_OUTPUT__FILE="./output.md"
864
+ export AIA_OUTPUT__APPEND="true"
865
+ export AIA_OUTPUT__HISTORY_FILE="~/.prompts/_prompts.log"
866
+
867
+ # Audio settings (nested under audio:)
868
+ export AIA_AUDIO__VOICE="alloy"
869
+ export AIA_AUDIO__SPEECH_MODEL="tts-1"
870
+
871
+ # Image settings (nested under image:)
872
+ export AIA_IMAGE__SIZE="1024x1024"
873
+ export AIA_IMAGE__QUALITY="hd"
692
874
 
693
875
  # Flags (nested under flags:)
876
+ export AIA_FLAGS__CHAT="true"
694
877
  export AIA_FLAGS__VERBOSE="true"
695
878
  export AIA_FLAGS__DEBUG="false"
696
- export AIA_FLAGS__CHAT="true"
879
+ export AIA_FLAGS__TOKENS="true"
880
+ export AIA_FLAGS__COST="true"
881
+ export AIA_FLAGS__NO_MCP="false"
882
+ export AIA_FLAGS__CONSENSUS="true"
697
883
 
698
- # Output settings (nested under output:)
699
- export AIA_OUTPUT__FILE="./output.md"
884
+ # Registry settings (nested under registry:)
885
+ export AIA_REGISTRY__REFRESH="7"
886
+
887
+ # Paths settings (nested under paths:)
888
+ export AIA_PATHS__AIA_DIR="~/.config/aia"
889
+ export AIA_PATHS__CONFIG_FILE="~/.config/aia/aia.yml"
700
890
  ```
701
891
 
702
892
  **Note**: The `AIA_MODEL` environment variable supports the same inline `MODEL=ROLE` syntax as the `--model` CLI option.