Commit graph

56 commits

Author SHA1 Message Date
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
Mario Zechner
c0f94c2bba docs: note exa-search was built by agent in ~2 minutes 2025-11-12 23:30:39 +01:00
Mario Zechner
42e0cbd4f4 docs: add real-world example linking to exa-search tools
- Reference exa-search repo as concrete example
- Shows web search capability via simple tool pattern
- Demonstrates how easy it is to extend pi with custom tools
2025-11-12 23:28:40 +01:00
Mario Zechner
271810c808 docs: add Background Bash section before Planned Features
- Clear stance: no background bash execution
- Alternative: use tmux or tterminal-cp
- Link to tterminal-cp repo
- Rationale: long-running commands need proper terminal sessions
2025-11-12 23:25:29 +01:00
Mario Zechner
c4102c7b81 docs: clarify auto-compaction options and fix flicker claim
- Expanded auto-compaction: switch to bigger model and either continue or summarize
- Fixed planned feature: MORE flicker than Claude Code (not less)
2025-11-12 23:22:40 +01:00
Mario Zechner
cf2a0d1c22 docs: clarify planning approach in Planning section 2025-11-12 23:21:27 +01:00
Mario Zechner
6f032fbbf7 docs: add Planning section and improve auto-compaction note
Planning:
- Clear stance: no built-in planning mode
- Alternative: write plans to PLAN.md files
- Persists across sessions, can be versioned
- Example provided showing structured approach

Auto-compaction:
- Added alternative: switch to bigger context model (Gemini)
- Can summarize session with larger model mid-session
2025-11-12 23:19:58 +01:00
Mario Zechner
9066f58ca7 docs: add To-Dos section explaining no built-in support
- Clear stance: no built-in to-dos
- Rationale: they confuse models more than help
- Alternative: stateful TODO.md file with checkboxes
- Simple example provided
- Agent can read/update file as needed
2025-11-12 23:16:14 +01:00
Mario Zechner
e9935beb5f docs: add Sub-Agents and Planned Features sections
Sub-Agents:
- Clear stance: not supported as built-in feature
- Agent can spawn itself via CLI or write custom tools
- Rationale: poor context transfer between agents
- Manual orchestration recommended for parallel work

Planned Features:
- Custom/local models (Ollama, llama.cpp, vLLM, SGLang, LM Studio)
- Auto-compaction (current mitigation documented)
- Message queuing (core supports, UI needs wiring)
- Better RPC mode docs
- Less flicker than Claude Code
2025-11-12 23:14:36 +01:00
Mario Zechner
a0fa254107 feat: support file paths for --system-prompt option
- Check if --system-prompt argument is a valid file path
- Load file contents if it exists, otherwise use as literal text
- Works in both interactive and single-shot modes
- Project context and datetime still appended automatically
- Document in README with examples
2025-11-12 23:10:56 +01:00
Mario Zechner
79ee33c3fc refactor: rename package to @mariozechner/pi-coding-agent
- Changed package name from @mariozechner/coding-agent to @mariozechner/pi-coding-agent
- Updated README installation command
- Binary name 'pi' remains the same
- Avoids conflict with existing @mariozechner/pi (pods package)
2025-11-12 23:08:05 +01:00
Mario Zechner
6695219e67 docs: add note about referencing tool READMEs in AGENT.md files 2025-11-12 23:04:59 +01:00
Mario Zechner
858824df83 docs: clarify blog post link includes rationale 2025-11-12 23:01:19 +01:00
Mario Zechner
60e4fcf012 docs: simplify MCP section with clear stance and minimal example
- State upfront: pi does not support MCP
- Provide minimal working example (README + bash script)
- Show simple usage pattern
- Remove verbose explanations

fix(tui): don't show duplicate URL when link text equals href
2025-11-12 23:00:27 +01:00
Mario Zechner
fda04484b9 docs: restructure tools section and add MCP alternatives
- Rename 'Available Tools' to 'Tools' with 'Built-in Tools' subsection
- Add 'MCP & Adding Your Own Tools' section
- Explain bash/code approach vs MCP servers
- Highlight token efficiency and composability benefits
- Link to blog post for detailed examples
2025-11-12 22:57:45 +01:00
Mario Zechner
b172beb925 docs: add Security (YOLO Mode) section to README
- Document unrestricted filesystem and command access
- Explain no permission checks or safety rails
- Warn about prompt injection risks
- Provide mitigation suggestions
- Clear about design philosophy and use at own risk
2025-11-12 22:53:42 +01:00