Filter model selector by API keys and add user-facing documentation

- Model selector now only shows models with configured API keys
- Added yellow hint in model selector UI explaining the filtering
- Updated README.md to document the filtering behavior in both API Keys and /model sections
- Bumped version to 0.7.11
This commit is contained in:
Mario Zechner 2025-11-16 21:01:31 +01:00
parent 977dfec5c9
commit 9b08f92dd9
11 changed files with 37 additions and 21 deletions

View file

@ -2,6 +2,12 @@
## [Unreleased]
## [0.7.11] - 2025-11-16
### Changed
- The `/model` selector now filters models based on available API keys. Only models for which API keys are configured in environment variables are shown. This prevents selecting models that would fail due to missing credentials. A yellow hint is displayed at the top of the selector explaining this behavior. ([#19](https://github.com/badlogic/pi-mono/pull/19))
## [0.7.10] - 2025-11-14
### Added

View file

@ -62,6 +62,8 @@ export ZAI_API_KEY=...
If no API key is set, the CLI will prompt you to configure one on first run.
**Note:** The `/model` command only shows models for which API keys are configured in your environment. If you don't see a model you expect, check that you've set the corresponding environment variable.
## Slash Commands
The CLI supports several commands to control its behavior:
@ -70,6 +72,8 @@ The CLI supports several commands to control its behavior:
Switch models mid-session. Opens an interactive selector where you can type to search (by provider or model name), use arrow keys to navigate, Enter to select, or Escape to cancel.
The selector only displays models for which API keys are configured in your environment (see API Keys section).
### /thinking
Adjust thinking/reasoning level for supported models (Claude Sonnet 4, GPT-5, Gemini 2.5). Opens an interactive selector where you can use arrow keys to navigate, Enter to select, or Escape to cancel.

View file

@ -1,6 +1,6 @@
{
"name": "@mariozechner/pi-coding-agent",
"version": "0.7.10",
"version": "0.7.11",
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
"type": "module",
"bin": {
@ -21,8 +21,8 @@
"prepublishOnly": "npm run clean && npm run build"
},
"dependencies": {
"@mariozechner/pi-agent": "^0.7.10",
"@mariozechner/pi-ai": "^0.7.10",
"@mariozechner/pi-agent": "^0.7.11",
"@mariozechner/pi-ai": "^0.7.11",
"chalk": "^5.5.0",
"diff": "^8.0.2",
"glob": "^11.0.3"

View file

@ -35,6 +35,12 @@ export class ModelSelectorComponent extends Container {
this.addChild(new Text(chalk.blue("─".repeat(80)), 0, 0));
this.addChild(new Spacer(1));
// Add hint about API key filtering
this.addChild(
new Text(chalk.yellow("Only showing models with configured API keys (see README for details)"), 0, 0),
);
this.addChild(new Spacer(1));
// Create search input
this.searchInput = new Input();
this.searchInput.onSubmit = () => {