Commit graph

71 commits

Author SHA1 Message Date
Mario Zechner
30dd31d787 Merge feat/scroll-previous-prompts with history load on resume 2025-12-05 22:02:16 +01:00
Nico Bailon
c550ed2bca feat(tui): add prompt history navigation with Up/Down arrows
Browse previously submitted prompts using Up/Down arrow keys, similar to
shell history and Claude Code's prompt history feature.

- Up arrow when editor is empty: browse to older prompts
- Down arrow when browsing: return to newer prompts or clear editor
- Cursor movement within multi-line history entries supported
- History is session-scoped, stores up to 100 entries
- Consecutive duplicates are not added to history

Includes 15 new tests for history navigation behavior.
2025-12-05 07:57:42 -08:00
Mario Zechner
ed2c182501 Document authHeader option in README 2025-12-05 11:32:59 +01:00
Mario Zechner
4c6d3b0bf6 Merge hide-thinking branch (PR #113) 2025-12-05 10:48:53 +01:00
Markus Ylisiurunen
a29cd80acf add ctrl+t shortcut to toggle llm thinking block visibility 2025-12-05 09:48:35 +02:00
Markus Ylisiurunen
342af285c4 document the new --append-system-prompt flag 2025-12-05 09:30:05 +02:00
Mario Zechner
9e5aaf1932 Add /copy command docs and changelog entry, closes #105 2025-12-04 13:22:17 +01:00
Mario Zechner
700baca113 docs(coding-agent): clean up compaction note 2025-12-04 03:05:01 +01:00
Mario Zechner
be2d90819a docs(coding-agent): add note about iterating on manual summary 2025-12-04 03:01:07 +01:00
Mario Zechner
3d66d2561d docs(coding-agent): expand compaction note with manual summary alternative 2025-12-04 02:59:55 +01:00
Mario Zechner
18e9c17ae5 docs(coding-agent): add note that compaction should generally be avoided 2025-12-04 02:58:45 +01:00
Mario Zechner
0c460fcfe8 docs(coding-agent): fix context compaction documentation
- Correctly describe cut point mechanism that keeps recent messages verbatim
- Document keepRecentTokens setting (default 20k)
- Fix reserveTokens default (16k not 20k)
- Explain summary chaining for multiple compactions
2025-12-04 02:57:45 +01:00
Mario Zechner
a57768b91b docs(coding-agent): add /compact, /autocompact commands and Context Compaction section
- Add /compact and /autocompact slash command documentation
- Add Context Compaction section explaining how it works, manual/auto modes, configuration
- Update /autocompact output to match thinking level toggle style (dimmed text)
- Remove Planned Features section (auto-compaction now implemented)
2025-12-04 02:56:03 +01:00
Mario Zechner
e82fb0fc83 feat(coding-agent): configurable app name and config dir for forks (#95)
- Add piConfig to package.json for app name and config directory
- Consolidate paths.ts into config.ts with clearer naming
- Fix Bun binary detection (changed from %7EBUN to $bunfs)
- Update all hardcoded paths to use config.ts exports
- getThemesDir() for built-in themes, getCustomThemesDir() for user themes
2025-12-03 16:18:59 +01:00
Mario Zechner
eb5cd9d4be Add CTRL+ENTER note for WSL 2025-12-02 22:18:12 +01:00
badlogic
7b1f975ca1 Fix Windows terminal background rendering and add /debug command
- Strip carriage return characters from bash tool output to fix background padding on Windows
- Add hidden /debug command to write rendered lines to debug log for TUI debugging
- Document /debug command in README.md development section
2025-12-02 13:22:54 +01:00
Mario Zechner
468acdf0d6 docs: use xattr -c to clear all extended attributes 2025-12-02 12:36:46 +01:00
Mario Zechner
062edb4707 docs: add macOS quarantine fix for unsigned binaries 2025-12-02 12:36:02 +01:00
Mario Zechner
c4a65ad8b9 feat: standalone binary support with Bun
- Add build:binary script for Bun compilation
- Add paths.ts for cross-platform asset resolution (npm/bun/tsx)
- Add GitHub Actions workflow for automated binary releases
- Update README with installation options

Based on #89 by @steipete
2025-12-02 12:18:42 +01:00
Mario Zechner
7a1884f85c Release v0.11.5 2025-12-01 20:22:14 +01:00
Mario Zechner
8900897840 feat(coding-agent): add --export CLI flag to convert session files to HTML
Closes #80
2025-11-29 23:05:07 +01:00
Mario Zechner
186169a820 feat(coding-agent): add read-only exploration tools (grep, find, ls) and --tools flag
Add grep, find, and ls tools for safe code exploration without modification risk.
These tools are available via the new --tools CLI flag.

- grep: Uses ripgrep (auto-downloaded) for fast regex searching. Respects .gitignore,
  supports glob filtering, context lines, and hidden files.
- find: Uses fd (auto-downloaded) for fast file finding. Respects .gitignore, supports
  glob patterns, and hidden files.
- ls: Lists directory contents with proper sorting and directory indicators.
- --tools flag: Specify available tools (e.g., --tools read,grep,find,ls for read-only mode)
- Dynamic system prompt adapts to selected tools with relevant guidelines

Closes #74
2025-11-29 00:59:23 +01:00
Mario Zechner
f95f41b1c4 Add CLI file arguments support via @file prefix
Implements ability to include files directly in the initial message using @ prefix.

Features:
- All @file arguments are coalesced into the first user message
- Text files wrapped in <file name="path">content</file> tags
- Images (.jpg, .jpeg, .png, .gif, .webp) attached as base64-encoded attachments
- Supports ~ expansion, relative and absolute paths
- Empty files are skipped silently
- Non-existent files cause immediate error with clear message
- Works in interactive, --print, and --mode text/json modes
- Not supported in --mode rpc (errors with clear message)

Examples:
  pi @prompt.md @image.png "Do this"
  pi --print @code.ts "Review this code"
  pi @requirements.md @design.png "Implement this"

Closes #54
2025-11-27 12:47:11 +01:00
Mario Zechner
ca0a86b981 Fix editor cursor navigation for wrapped lines, add word navigation
- Up/down arrows now navigate visual (wrapped) lines instead of logical lines
- Fixed double cursor display at wrap boundaries
- Added word by word navigation via Option+Left/Right or Ctrl+Left/Right
- Updated README keyboard shortcuts documentation

Closes #61
2025-11-27 12:08:36 +01:00
Mario Zechner
384e4a3a7d feat: fuzzy file search with @ prefix
- Type @ to fuzzy-search files/folders across project
- Respects .gitignore and skips hidden files
- Pure Node.js implementation using readdir with withFileTypes
- No external dependencies (fd/find) required
- Also optimized Tab completion to use withFileTypes instead of statSync

Based on PR #60 by @fightbulc, reimplemented for performance.
2025-11-27 00:59:12 +01:00
Tino Ehrich
15d5120b6a added support for finding folders as well 2025-11-27 00:06:59 +01:00
Tino Ehrich
b8e5f8db6d feat: Fuzzy search via 2025-11-27 00:06:54 +01:00
Mario Zechner
5b940c2686 docs: clarify that AGENTS.md files are loaded at every startup
Removed confusing parenthetical that suggested context files aren't loaded when continuing/resuming sessions. They are always freshly loaded from disk at startup - the parenthetical only applied to console logging behavior.
2025-11-26 23:41:52 +01:00
Mario Zechner
e89e657045 feat(coding-agent): allow starting CLI with prompt in interactive mode (#46)
BREAKING CHANGE: Passing a prompt on the command line now starts interactive
mode with the prompt pre-submitted, instead of exiting after completion.
Use --print or -p to get the previous non-interactive behavior.

- Add --print / -p flag for non-interactive mode
- Update runInteractiveMode to accept initial messages
- Update README documentation
- Fix Model Selection Priority docs to include --models scope
2025-11-21 21:57:35 +01:00
Mario Zechner
ba8c073ed2 feat: enhance model cycling with thinking levels and --thinking flag
PR #47 enhancements:
- Add thinking level syntax to --models (e.g., --models sonnet:high,haiku:low)
- First model in scope used as initial model when starting new session
- Auto-apply thinking level when cycling models with Ctrl+P
- Save both model and thinking to session AND settings for persistence
- Simplify UX by removing autoThinkingDisabled flag
- Fix model matching to prioritize exact matches over partial
- Support provider/modelId format (e.g., openrouter/openai/gpt-5.1-codex)

Issue #45:
- Add --thinking CLI flag to set thinking level directly
- Takes highest priority over all other thinking level sources

Closes #45
2025-11-21 21:32:30 +01:00
Mario Zechner
1b6a70ccb1 feat: add /clear command to reset context and start fresh session 2025-11-21 20:59:00 +01:00
Mario Zechner
85adcf22bf Release v0.8.0 2025-11-21 03:12:42 +01:00
Mario Zechner
c7d00e6ba4 Updated README.md 2025-11-20 21:17:32 +01:00
Mario Zechner
d44073b140 Release v0.7.28
- Add message queuing with configurable modes (one-at-a-time/all) (#15)
- Add /queue command to select queue mode
- Add TruncatedText component for proper viewport-aware text truncation
- Queue mode setting persists in ~/.pi/agent/settings.json
- Visual feedback for queued messages with proper ANSI handling
- Press Escape to abort and restore queued messages to editor
2025-11-20 20:39:43 +01:00
Mario Zechner
11aa39c5e4 Release v0.7.26 2025-11-20 17:29:24 +01:00
Mario Zechner
de39f1f493 Add custom headers support for models.json
Fixes #39

- Added headers field to Model type (provider and model level)
- Model headers override provider headers when merged
- Supported in all APIs:
  - Anthropic: defaultHeaders
  - OpenAI (completions/responses): defaultHeaders
  - Google: httpOptions.headers
- Enables bypassing Cloudflare bot detection for proxied endpoints
- Updated documentation with examples

Also fixed:
- Mistral/Chutes syntax error (iif -> if)
- process.env.ANTHROPIC_API_KEY bug (use delete instead of = undefined)
2025-11-20 17:05:31 +01:00
Mario Zechner
a1215fc32c Add table of contents to README 2025-11-20 13:20:48 +01:00
Mario Zechner
95247a3e5e Add documentation for model cycling feature 2025-11-20 12:58:31 +01:00
Mario Zechner
cfcdcf055d Add CHANGELOG and README docs for thinking level cycling feature 2025-11-20 12:35:54 +01:00
Mario Zechner
587d7c39a4 feat(coding-agent): add OAuth authentication for Claude Pro/Max
- Add /login and /logout commands for OAuth flow
- OAuth tokens stored in ~/.pi/agent/oauth.json with 0600 permissions
- Auto-refresh tokens when expired (5min buffer)
- Priority: OAuth > ANTHROPIC_OAUTH_TOKEN env > ANTHROPIC_API_KEY env
- Fix model selector async loading and re-render
- Add bracketed paste support to Input component for long codes
- Update README.md with OAuth documentation
- Add implementation docs and testing checklist
2025-11-18 17:33:33 +01:00
Mario Zechner
0c5cbd0068 v0.7.12: Custom models/providers support via models.json
- Add ~/.pi/agent/models.json config for custom providers (Ollama, vLLM, etc.)
- Support all 4 API types (openai-completions, openai-responses, anthropic-messages, google-generative-ai)
- Live reload models.json on /model selector open
- Smart model defaults per provider (claude-sonnet-4-5, gpt-5.1-codex, etc.)
- Graceful session fallback when saved model missing or no API key
- Validation errors show precise file/field info in CLI and TUI
- Agent knows its own README.md path for self-documentation
- Added gpt-5.1-codex (400k context, 128k output, reasoning)

Fixes #21
2025-11-16 22:56:24 +01:00
Mario Zechner
9b08f92dd9 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
2025-11-16 21:01:31 +01:00
Mario Zechner
8ae236f956 Add /branch command for conversation branching (fixes #16)
- Add /branch slash command to create conversation branches
- New UserMessageSelectorComponent shows all user messages chronologically
- Selecting a message creates new session with messages before selection
- Selected message is placed in editor for modification/resubmission
- SessionManager.createBranchedSession() creates new session files
- Updated README.md and CHANGELOG.md with /branch documentation
2025-11-14 23:52:46 +01:00
Mario Zechner
a686f61c1d feat(tui): improve editor Ctrl/Alt word and line deletion shortcuts
- Add Ctrl+W for word deletion (stops at whitespace/punctuation)
- Add Ctrl+U for delete to start of line (merges with previous line at col 0)
- Change Ctrl+K from delete entire line to delete to end of line (merges with next line at EOL)
- Add Option+Backspace support in Ghostty (maps to Ctrl+W via ESC+DEL sequence)
- Cmd+Backspace in Ghostty works as Ctrl+U (terminal sends same control code)
- Update README and CHANGELOG with new keyboard shortcuts

Fixes #2, Fixes #3
2025-11-14 23:19:24 +01:00
Mario Zechner
29ca62fb6e Document /changelog slash command in coding-agent README 2025-11-13 23:46:14 +01:00
Mario Zechner
c82f9f4f8c Add settings manager, show changelog on startup if not shown yet. 2025-11-13 21:19:57 +01:00
Mario Zechner
383b67b5c0 feat: add tool call and result counts to /session command 2025-11-13 00:02:24 +01:00
Mario Zechner
29900ce647 feat: make bash tool timeout optional and configurable
- Add optional timeout parameter (in seconds) to bash tool
- No default timeout - commands run until completion unless specified
- Agent can provide timeout when needed for long-running commands
- Update README to reflect optional timeout
2025-11-12 23:53:27 +01:00
Mario Zechner
0e5778c69b README.md update for coding agent 2025-11-12 23:38:35 +01:00
Mario Zechner
227aedc6db docs: rewrite opening paragraph with clearer value proposition
- Change title from package name to 'pi'
- Emphasize: radically simple, multi-model support, mid-session switching
- Highlight: CLI for headless tasks, creature comforts
- More concise and compelling
2025-11-12 23:34:26 +01:00