Commit graph

170 commits

Author SHA1 Message Date
Carlos Gutierrez
49acd8e648 Add /models command for enabling/disabling Ctrl+P model cycling
- New /models command with toggle UI for each available model
- Changes persist to enabledModels in settings.json
- Updates take effect immediately for Ctrl+P cycling
2026-01-11 19:36:36 +01:00
Aos Dabbagh
23a4fd1159 fix: load keybindings before --resume session picker
The problem: I wanted to be able to select my session (either from
`/resume` or `--resume`) with different keybindings.

The issue: when running `pi --resume`, custom keybindings from
`~/.pi/agent/keybindings.json` were not being applied to the session
picker. This happened because `KeybindingsManager.create()` was only
called when `InteractiveMode` initialized, but the session picker runs
before that in `main.ts`.

The session picker uses `getEditorKeybindings()` for navigation
(selectUp/selectDown etc.), which returns the global default keybindings
if `setEditorKeybindings()` hasn't been called yet.

Fix: Call `KeybindingsManager.create()` inside the `--resume` block
before showing the session picker. This loads user keybindings and sets
them globally.

The current fix results in double-init of keybindings when entering
interactive mode which _should_ be harmless, since it's the same same
config loaded twice, but is minimal and only affects the `--resume`
path.

I considered passing keybindings from `main()` to `InteractiveMode` -
it's cleaner but requires API changes.

Also documented the `select*` keybindings in README.md.
2026-01-11 19:22:52 +01:00
Mario Zechner
9655907624 feat: Add skill slash commands and fuzzy matching for all commands
- Skills registered as /skill:name commands for quick access
- Toggle via /settings or skills.enableSkillCommands in settings.json
- Fuzzy matching for all slash command autocomplete (type /skbra for /skill:brave-search)
- Moved fuzzy module from coding-agent to tui package for reuse

Closes #630 by @Dwsy (reimplemented with fixes)
2026-01-11 17:56:11 +01:00
Kao Félix
6d60302646 fix(coding-agent): remove -- from registerFlag calls
This was causing the agent sometimes to pick up on the incorrect syntax when
asked to write extensions with flags
2026-01-11 02:21:15 +01:00
Mario Zechner
d82df76222 docs: add supportsUsageInStreaming to compat table 2026-01-10 01:16:52 +01:00
Mario Zechner
c39250d0df Fix Google Cloud Code Assist OAuth for paid subscriptions
- Properly handle long-running operations for project provisioning
- Support GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_PROJECT_ID env vars for paid tiers
- Handle VPC-SC affected users
- Update docs for paid subscription requirements

Closes #582
2026-01-09 23:32:46 +01:00
Mario Zechner
e8eb4c254a feat: add search parameter and auto-select to /model command
- /model <search> pre-filters selector or auto-selects on exact match
- Support provider/model syntax for disambiguation (e.g., /model openai/gpt-4)
- Auto-select logic moved to InteractiveMode to avoid selector UI flicker

Closes #587
2026-01-09 22:39:26 +01:00
Mario Zechner
19b5663340 Revert "Remove Anthropic OAuth support"
This reverts commit f5e6bcac1b.
2026-01-09 06:00:20 +01:00
Mario Zechner
f5e6bcac1b Remove Anthropic OAuth support 2026-01-09 05:10:33 +01:00
Mario Zechner
66cbcee347 docs(coding-agent): simplify --no-tools description 2026-01-08 18:52:33 +01:00
Mario Zechner
e3dd4f21d1 feat(coding-agent): add tool override support via extensions
- Add setActiveTools() to ExtensionAPI for dynamic tool management
- Extensions can now override, wrap, or disable built-in tools
- Add tool-override.ts example demonstrating the pattern
- Update documentation for tool override capabilities
2026-01-08 18:52:33 +01:00
Mario Zechner
7f3fa417c4 feat(coding-agent): add --no-extensions flag to disable extension discovery
Adds --no-extensions CLI flag that skips automatic extension discovery
while still allowing explicit -e paths. Three modes now available:

1. Default: auto-discover + any -e additions
2. --no-extensions: no extensions at all
3. --no-extensions -e foo.js: only load explicit extensions

Useful for debugging or running subagent instances without auto-discovered
extensions.

closes #524
2026-01-08 03:22:38 +01:00
Mario Zechner
6f726a2178 feat(coding-agent): add PI_SKIP_VERSION_CHECK env variable
Skip new version check at startup when set. Useful for Nix or other
package manager installs where npm install is not used.

Also documents PI_CODING_AGENT_DIR and other environment variables
in the README.

closes #549

Co-authored-by: Aos Dabbagh <25783780+aos@users.noreply.github.com>
2026-01-08 02:29:51 +01:00
Mario Zechner
512ae4b4c0 fix: OAuth token refresh failure returns undefined instead of throwing
When OAuth refresh fails during model discovery, getApiKey() now returns
undefined instead of throwing. This allows the app to start and fall back
to other providers, so the user can /login to re-authenticate.

fixes #498

feat(coding-agent): support searching/resuming sessions by ID

- Session picker (pi -r) now searches session IDs in addition to message content
- --session flag accepts UUID prefix (e.g., pi --session a8ec1c2a)
- Documented in README.md

fixes #495
2026-01-06 21:09:11 +01:00
Mario Zechner
f023af0dab Add ctx.ui.setFooter() for extensions to replace footer component
Extensions can now replace the built-in footer with a custom component:
- setFooter(factory) replaces with custom component
- setFooter(undefined) restores built-in footer

Includes example extension demonstrating context usage display.

Closes #481
2026-01-06 12:39:45 +01:00
Mario Zechner
df5ad091b3 docs: add blockImages setting to README 2026-01-06 12:01:16 +01:00
badlogic
1349f02cdd docs: document Windows Terminal Shift+Enter limitation
Windows Terminal does not support the Kitty keyboard protocol, so
Shift+Enter cannot be distinguished from Enter. Document that users
should use Ctrl+Enter for multi-line input instead.

- Add Windows Terminal note in Terminal Setup section
- Update Keyboard Shortcuts table with Windows note
- Show Windows-specific hint in /hotkeys command
2026-01-05 23:17:58 +01:00
Mario Zechner
4d87196801 fix(tui): remove alt+enter from newLine default keybinding
alt+enter is used by coding-agent for follow-up messages.
Having it also mapped to newLine caused a conflict.
2026-01-05 23:17:34 +01:00
Mario Zechner
c5d54a8413 feat(tui): query Kitty keyboard protocol support before enabling
- Query terminal with CSI ? u before enabling Kitty protocol
- Only enable protocol if terminal responds (100ms timeout)
- Mode-aware key parsing: when Kitty active, interpret legacy
  sequences as custom terminal mappings (e.g. \x1b\r = shift+enter)
- Add Terminal Setup section to README with Ghostty/wezterm config

fixes #439
2026-01-05 22:52:13 +01:00
Mario Zechner
9a147559c0 Merge branch 'openai-codex' 2026-01-05 05:33:48 +01:00
Mario Zechner
91cca23d23 Add migration for commands->prompts, warn about deprecated hooks/tools dirs
- Auto-migrate commands/ to prompts/ on startup
- Warn if hooks/ or tools/ directories contain custom extensions
- Show deprecation warnings in interactive mode with keypress to continue
- Update CHANGELOG and docs with full migration guide
2026-01-05 02:41:08 +01:00
Mario Zechner
c6fc084534 Merge hooks and custom-tools into unified extensions system (#454)
Breaking changes:
- Settings: 'hooks' and 'customTools' arrays replaced with 'extensions'
- CLI: '--hook' and '--tool' flags replaced with '--extension' / '-e'
- API: HookMessage renamed to CustomMessage, role 'hookMessage' to 'custom'
- API: FileSlashCommand renamed to PromptTemplate
- API: discoverSlashCommands() renamed to discoverPromptTemplates()
- Directories: commands/ renamed to prompts/ for prompt templates

Migration:
- Session version bumped to 3 (auto-migrates v2 sessions)
- Old 'hookMessage' role entries converted to 'custom'

Structural changes:
- src/core/hooks/ and src/core/custom-tools/ merged into src/core/extensions/
- src/core/slash-commands.ts renamed to src/core/prompt-templates.ts
- examples/hooks/ and examples/custom-tools/ merged into examples/extensions/
- docs/hooks.md and docs/custom-tools.md merged into docs/extensions.md

New test coverage:
- test/extensions-runner.test.ts (10 tests)
- test/extensions-discovery.test.ts (26 tests)
- test/prompt-templates.test.ts
2026-01-05 01:43:35 +01:00
Mario Zechner
affa618b43 docs: add note about macOS Finder image copy behavior 2026-01-04 20:52:51 +01:00
Kao Félix
b836a9d2ee
feat(tui): add symbol key support to keybinding system (#450)
- Added SymbolKey type with 32 symbol keys
- Added symbol key constants to Key helper (Key.backtick, Key.comma, Key.period, etc.)
- Updated matchesKey() and parseKey() to handle symbol key input
- Added documentation in coding-agent README with examples
2026-01-04 20:37:08 +01:00
Mario Zechner
00fa8b71c8 revert: remove unnecessary themeOverride params from theme functions
The optional theme parameter was added as a workaround for tsx dev mode,
but that's a dev-only issue. Users running the built package don't need it.
2026-01-04 20:27:46 +01:00
Ahmed Kamal
1650041a63 feat(ai): add OpenAI Codex OAuth + responses provider 2026-01-04 21:11:19 +02:00
Mario Zechner
2849623afc fix(tools): tool registry now contains ALL built-in tools
- createAllTools() populates registry with all 7 built-in tools
- --tools flag only sets initially active tools (default: read/bash/edit/write)
- Hooks can enable any tool from registry via setActiveTools()
- System prompt rebuilds with correct tool guidelines when tools change
- Document tsx module resolution workaround in README
2026-01-04 18:44:41 +01:00
Armin Ronacher
5b95ccf830
Add consistent, configurable image placeholders (#442)
* Add consistent, configurable image placeholders

* Kill the placeholders
2026-01-04 18:12:55 +01:00
Mario Zechner
5c5084481b feat(coding-agent): clipboard image paste support via Ctrl+V (fixes #419) 2026-01-04 01:05:22 +01:00
Mario Zechner
97bb411988 Add Vim-style keybindings example to README 2026-01-03 23:44:40 +01:00
Mario Zechner
9549ac4695 Remove DEVELOPMENT.md reference from README 2026-01-03 22:53:33 +01:00
Mario Zechner
f2b89d5ec5 Merge branch 'feat/ctrl-n-external-editor' - configurable keybindings (#405) 2026-01-03 22:51:12 +01:00
Mario Zechner
b8814372af Add changelog and README docs for keybindings feature (#405) 2026-01-03 22:49:58 +01:00
Mario Zechner
d39769192a Remove redundant pi header and Discord note from coding-agent README 2026-01-03 16:38:39 +01:00
Mario Zechner
1ce1f91f26 Add centered logo and badges to READMEs 2026-01-03 16:37:44 +01:00
Mario Zechner
a8ff115184 Add Discord and build badges to READMEs 2026-01-03 16:31:11 +01:00
Evgeniy Skuridin
8917a1f853
feat(coding-agent): add $ARGUMENTS syntax for slash commands (#418)
* feat(coding-agent): add $ARGUMENTS syntax for slash commands

* test(coding-agent): add tests for slash command argument substitution
2026-01-03 14:08:39 +01:00
Mario Zechner
8df22faedf fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models
Claude requires max_tokens > thinking.budget_tokens. When caller specifies
a small maxTokens (e.g. compaction with ~13k tokens) and reasoning is enabled
with high budget (16k tokens), the constraint was violated.

Fix: In mapOptionsForApi, add thinkingBudget on top of caller's maxTokens
(capped at model.maxTokens). If still not enough room, reduce thinkingBudget
to leave space for output.

Applied to both anthropic-messages and google-gemini-cli APIs.

Also adds test utilities for OAuth credential resolution and tests for
compaction with thinking models.

fixes #413
2026-01-03 02:45:30 +01:00
Mario Zechner
42b1e06ad1 feat(coding-agent): configurable double-escape action (tree vs branch)
Add doubleEscapeAction setting to choose whether double-escape with an
empty editor opens /tree (default) or /branch.

- Add setting to Settings interface and SettingsManager
- Add to /settings UI for easy toggling
- Update interactive-mode to respect the setting
- Document in README.md settings table

fixes #404
2026-01-03 01:59:08 +01:00
Mario Zechner
d747ec6e23 Enhance provider override to support baseUrl-only mode
Builds on #406 to support simpler proxy use case:
- Override just baseUrl to route built-in provider through proxy
- All built-in models preserved, no need to redefine them
- Full replacement still works when models array is provided
2026-01-03 01:06:08 +01:00
Mario Zechner
e82af9da47
Merge pull request #402 from mitsuhiko/image-resize
Added automatic image resizing
2026-01-03 00:39:26 +01:00
Mario Zechner
9f2e6ac5eb docs: update README.md, hooks.md, and CHANGELOG for steer()/followUp() API
- Fix settings-selector descriptions to explain one-at-a-time vs all
- Update README.md message queuing section, settings example, and table
- Update hooks.md: hasPendingMessages, sendMessage options, triggerTurn example
- Add Theme/ThemeColor export and hasPendingMessages rename to CHANGELOG
2026-01-03 00:19:07 +01:00
Armin Ronacher
4a32af2532 Added automatic image resizing 2026-01-02 12:01:56 +01:00
Mario Zechner
0addbfec4e Add /share command to README 2026-01-01 21:28:22 +01:00
Mario Zechner
46bb5dcde8 fix: enabledModels now supports glob patterns for OAuth providers
Added glob pattern support (e.g., github-copilot/*, *sonnet*) to --models
and enabledModels. Patterns are matched against both provider/modelId and
just modelId, so *sonnet* works without requiring anthropic/*sonnet*.

The existing fuzzy substring matching for non-glob patterns is preserved.

fixes #337
2026-01-01 02:04:04 +01:00
Mario Zechner
0fa558154c Update README.md compaction and branching sections
- Simplify compaction section, link to docs/compaction.md for details
- Clarify that branch summaries are optional (user is prompted)
- Change /branch to /tree in compaction note
2025-12-31 14:44:51 +01:00
Mario Zechner
dc5466becc Restructure README.md
- Add session tree intro to Sessions section
- Move Themes, Custom Slash Commands, Skills, Hooks, Custom Tools to new Extensions top-level section
- Keep Settings File under Configuration
2025-12-31 14:39:51 +01:00
Mario Zechner
b0d68c23d9 Update README.md for new APIs
- Add /tree to slash commands table
- Expand Branching section with /tree in-place navigation
- Update hooks example: pi.send() -> pi.sendMessage(), session -> session_start
- Remove hookTimeout from settings (no longer exists)
2025-12-31 14:13:30 +01:00
Mario Zechner
19c4182c21 Reorder execute params: (toolCallId, params, onUpdate, ctx, signal?)
Optional signal now at the end for cleaner API
2025-12-31 12:14:28 +01:00
Mario Zechner
4c9c453646 Update CHANGELOG, README, and custom-tools.md for new CustomTool API
- Add custom tools API rework to CHANGELOG breaking changes
- Update docs/custom-tools.md with new types and signatures
- Update README quick example with correct execute signature
2025-12-31 12:10:37 +01:00