Commit graph

43 commits

Author SHA1 Message Date
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
Mario Zechner
9bd297e253 docs: add /session command to README 2025-11-12 22:34:16 +01:00
Mario Zechner
b1c2c32e23 refactor: move context files to system prompt instead of user messages
- Context files now appended to system prompt
- Added current date/time to system prompt
- Added current working directory to system prompt
- Date/time and cwd placed at end of system prompt
- Updated README to reflect system prompt integration
2025-11-12 22:19:56 +01:00
Mario Zechner
dca3e1cc60 feat: hierarchical context file loading for monorepos
- Walk up parent directories to load all AGENT.md/CLAUDE.md files
- Load global context from ~/.pi/agent/AGENT.md or CLAUDE.md
- Load order: global → top-most parent → ... → cwd
- Prefer AGENT.md over CLAUDE.md in each directory
- Each context file injected as separate message
- Updated README with detailed documentation
2025-11-12 22:17:54 +01:00
Mario Zechner
9e3e319f1a Add session export to HTML, improve tool error handling, and enhance RPC mode documentation 2025-11-12 21:55:10 +01:00
Mario Zechner
68092ccf01 Add --mode flag for CLI output control (text/json/rpc)
- text mode: only outputs final assistant message text (default)
- json mode: streams all events as JSON (same as session manager writes)
- rpc mode: JSON output + listens for JSON input on stdin for headless operation
- Suppress informational messages in json/rpc modes
2025-11-12 20:33:31 +01:00
Mario Zechner
bf1a7d8571 Add 'pi' command alias and fix getApiKey import 2025-11-12 14:31:25 +01:00