Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
526 commits
Select commit Hold shift + click to select a range
e6d60d1
makes start/stop also enable/disable
mpfaffenberger Aug 31, 2025
818d580
Seems good.
mpfaffenberger Aug 31, 2025
73728b5
Cancellation restored
mpfaffenberger Aug 31, 2025
ed76e56
Things are kind of working!
mpfaffenberger Aug 31, 2025
c9066b1
Working almost perfectly
mpfaffenberger Aug 31, 2025
5bda1d9
Fixed help in TUI
mpfaffenberger Aug 31, 2025
1b07012
Fix TUI output
mpfaffenberger Aug 31, 2025
7229f41
Fixing TUI issues
mpfaffenberger Aug 31, 2025
b162575
Fix message errors
mpfaffenberger Aug 31, 2025
6d7940e
Everything working amazing.
mpfaffenberger Aug 31, 2025
d499e12
Fixing some display bugs
mpfaffenberger Aug 31, 2025
e36d1a1
In a decent spot, but random nitpicks stil
mpfaffenberger Sep 1, 2025
4880284
Last thing to fix is aesthetic in --interactive
mpfaffenberger Sep 1, 2025
9a4e336
Remove md files
mpfaffenberger Sep 1, 2025
11a0932
fix /mcp stop all
mpfaffenberger Sep 1, 2025
418c64c
chore: bump version [ci skip]
github-actions[bot] Sep 1, 2025
679be4c
Cleanup
mpfaffenberger Sep 1, 2025
530a74d
Fix cancellations in --interactive
mpfaffenberger Sep 1, 2025
ab6d90d
chore: bump version [ci skip]
github-actions[bot] Sep 1, 2025
6884e0b
Fix /m -> /model
mpfaffenberger Sep 1, 2025
5f408b5
chore: bump version [ci skip]
github-actions[bot] Sep 1, 2025
8ba36d7
MCP server config wizard working
mpfaffenberger Sep 1, 2025
45adbc1
TUI wizard looking great.
mpfaffenberger Sep 1, 2025
a5f4534
feat: Introduce MCPServerRequirements data model and template getters
mpfaffenberger Sep 1, 2025
c592d1c
feat: Add System Tool Detection module
mpfaffenberger Sep 1, 2025
2c8bdac
feat: Update server registry with comprehensive requirements example
mpfaffenberger Sep 1, 2025
bc36df0
feat: Implement interactive CLI handling for comprehensive server req…
mpfaffenberger Sep 1, 2025
efa4486
feat: Enhance TUI install wizard for comprehensive server requirements
mpfaffenberger Sep 1, 2025
1125a37
Update catalog with new requires fields
mpfaffenberger Sep 1, 2025
f9fb92d
Fix boodlement.
mpfaffenberger Sep 1, 2025
8eb4e2b
TUI MCP Wizard Looking Good!
mpfaffenberger Sep 1, 2025
0a16824
MCP configure kinda working on interactive
mpfaffenberger Sep 1, 2025
be896e5
Aesthetic updates
mpfaffenberger Sep 1, 2025
5ff405a
chore: bump version [ci skip]
github-actions[bot] Sep 2, 2025
8ba1ce2
Working on capturing stderr from MCP
mpfaffenberger Sep 2, 2025
df4d9cb
Working
mpfaffenberger Sep 2, 2025
1f8d9d3
Merge branch 'mcp-stderr'
mpfaffenberger Sep 2, 2025
3781a6d
chore: bump version [ci skip]
github-actions[bot] Sep 2, 2025
e932ff9
Custom JSON MCPs in Wizard
mpfaffenberger Sep 2, 2025
842e6cd
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 2, 2025
9292c9f
chore: bump version [ci skip]
github-actions[bot] Sep 2, 2025
9ae2c9b
Use common http client in mcp
mpfaffenberger Sep 2, 2025
d348681
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 2, 2025
af1a558
chore: bump version [ci skip]
github-actions[bot] Sep 2, 2025
a4940c2
No need to send headers if we're sending http client with headers
mpfaffenberger Sep 2, 2025
d6c98f9
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 2, 2025
8e740f6
chore: bump version [ci skip]
github-actions[bot] Sep 2, 2025
d083c53
Refactor command line stuff for mcp
Sep 2, 2025
55759a1
Agent swapping without clobbering message history
Sep 3, 2025
93a202f
Make terminal sessions have sticky agents
Sep 3, 2025
0eead9c
Linters and tests
Sep 3, 2025
bcd7ee6
Fix circ import
mpfaffenberger Sep 3, 2025
a0ee422
chore: bump version [ci skip]
github-actions[bot] Sep 3, 2025
d39c2a2
Fix broken model fallback
mpfaffenberger Sep 3, 2025
197efea
chore: bump version [ci skip]
github-actions[bot] Sep 3, 2025
4547d0f
Fix model issue
mpfaffenberger Sep 3, 2025
3898311
chore: bump version [ci skip]
github-actions[bot] Sep 3, 2025
b2138a7
Add sonnet 4 to models.json
mpfaffenberger Sep 3, 2025
d53b132
chore: bump version [ci skip]
github-actions[bot] Sep 3, 2025
a903855
Bump Pydantic AI to 1.0.0
mpfaffenberger Sep 5, 2025
cc56f92
chore: bump version [ci skip]
github-actions[bot] Sep 5, 2025
983bdc0
sub-agents working
mpfaffenberger Sep 6, 2025
8ab41bb
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 6, 2025
e3d1f66
QOL improvements
mpfaffenberger Sep 6, 2025
3aadf76
Fix broken tests
mpfaffenberger Sep 6, 2025
e200833
chore: bump version [ci skip]
github-actions[bot] Sep 6, 2025
b8f0f90
More fixed tests
mpfaffenberger Sep 6, 2025
589195c
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 6, 2025
f9f9bee
chore: bump version [ci skip]
github-actions[bot] Sep 6, 2025
42fe8ef
Round robin model!
mpfaffenberger Sep 10, 2025
2736eee
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
e49f3e2
Update README
mpfaffenberger Sep 10, 2025
c51505a
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 10, 2025
8f4aad6
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
552c913
Add rotate_every to the round robin config
mpfaffenberger Sep 10, 2025
f2e9f0d
Fix tests
mpfaffenberger Sep 10, 2025
0f7ff0d
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 10, 2025
ede0372
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
ac65586
Set message limit
mpfaffenberger Sep 10, 2025
4640d0c
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
11ab001
allow_recusion = true/false
mpfaffenberger Sep 10, 2025
330732a
Fix tests
mpfaffenberger Sep 10, 2025
a10890f
fix test
mpfaffenberger Sep 10, 2025
d0204c8
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 10, 2025
b688d04
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
4a45b2d
Look for all 4 combos of agents.md / agent.md lowercase and uppercase
mpfaffenberger Sep 10, 2025
6501141
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 10, 2025
d79d044
chore: bump version [ci skip]
github-actions[bot] Sep 10, 2025
94bf6ee
Swap grep to ripgrep
mpfaffenberger Sep 11, 2025
0c294e0
Update README.md
mpfaffenberger Sep 11, 2025
90f562a
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
eeb9848
Update README.md
mpfaffenberger Sep 11, 2025
0778297
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
0b54d81
Ripgrep working okay
mpfaffenberger Sep 11, 2025
f7ba3df
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 11, 2025
6f022e0
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
e508ecf
Remove unnecessary prompt
mpfaffenberger Sep 11, 2025
b98f898
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 11, 2025
6879293
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
3fd57e6
List files now uses ripgrep
mpfaffenberger Sep 11, 2025
f60d604
Corrected token counts
mpfaffenberger Sep 11, 2025
07b774e
Make sure list_files emits
mpfaffenberger Sep 11, 2025
dc3485a
default allow recursion to true
mpfaffenberger Sep 11, 2025
205704e
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 11, 2025
2058ada
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
6ef4db6
Remove
mpfaffenberger Sep 11, 2025
1033c6b
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 11, 2025
64db193
chore: bump version [ci skip]
github-actions[bot] Sep 11, 2025
94ffe29
Run linters / fix tests
mpfaffenberger Sep 13, 2025
895bad7
Clean up unused code
mpfaffenberger Sep 13, 2025
4fdd8e2
chore: bump version [ci skip]
github-actions[bot] Sep 13, 2025
6af2567
Pinned models working or so it seems
mpfaffenberger Sep 7, 2025
5179467
Remove multi-agent.md
mpfaffenberger Sep 13, 2025
c1cd545
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 13, 2025
3f5ba52
chore: bump version [ci skip]
github-actions[bot] Sep 13, 2025
867d3de
Remove sonoma sky alpha
mpfaffenberger Sep 13, 2025
909f5a0
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 13, 2025
6e48a53
chore: bump version [ci skip]
github-actions[bot] Sep 13, 2025
7e6c3f8
Add openrouter provider, and make /compact re-read protected tokens
mpfaffenberger Sep 13, 2025
b078a49
chore: bump version [ci skip]
github-actions[bot] Sep 13, 2025
a819866
Preserve Rich Tags
mpfaffenberger Sep 14, 2025
be53aeb
Fix config
mpfaffenberger Sep 14, 2025
9c498ed
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
5cda3c0
Wrap the pure string path for edit_file in a try/except with validati…
mpfaffenberger Sep 14, 2025
3065a9f
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 14, 2025
6085ca1
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
47c91d6
Remove redundant tool registration / add the exception block to the "…
mpfaffenberger Sep 14, 2025
5b06212
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
40a7dbe
Fix exception error
mpfaffenberger Sep 14, 2025
20f72f8
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 14, 2025
ea51f30
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
3febd63
Added more hints in edit_file tool calls
mpfaffenberger Sep 14, 2025
9f7b70b
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 14, 2025
21ea4f7
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
c7d4fbc
feat: Add robust error handling for extra models configuration loading
mpfaffenberger Sep 14, 2025
b4420fd
chore: bump version [ci skip]
github-actions[bot] Sep 14, 2025
92086d7
fix tool return duplication
Sep 17, 2025
4822a8e
chore: bump version [ci skip]
github-actions[bot] Sep 17, 2025
c94643e
Revert "fix tool return duplication"
mpfaffenberger Sep 20, 2025
ee69f7c
Fix alt+enter and revert the double tool-call tool-return duplication
mpfaffenberger Sep 20, 2025
de350b2
chore: bump version [ci skip]
github-actions[bot] Sep 20, 2025
e898945
Retries on 503, tool protection on shell commands, MCP fix
mpfaffenberger Sep 20, 2025
ca8b2a4
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 20, 2025
7fbb914
chore: bump version [ci skip]
github-actions[bot] Sep 20, 2025
7b4495f
Adds truncate-down-to-latest-n command
mpfaffenberger Sep 20, 2025
cea49d1
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 20, 2025
35909ad
chore: bump version [ci skip]
github-actions[bot] Sep 20, 2025
90e2570
Increase num retries
mpfaffenberger Sep 20, 2025
1e0185a
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 20, 2025
993f8a0
chore: bump version [ci skip]
github-actions[bot] Sep 20, 2025
2f60180
Add pup alias for code-puppy command (#35)
znanfelt Sep 22, 2025
fda6a46
chore: bump version [ci skip]
github-actions[bot] Sep 22, 2025
8ac3737
Potential fixes to all the message processing issues
mpfaffenberger Sep 25, 2025
5e46eb6
chore: bump version [ci skip]
github-actions[bot] Sep 25, 2025
5116148
Remove deduplicate tool returns
mpfaffenberger Sep 25, 2025
b48d284
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 25, 2025
260c048
giv dobie a sok
Sep 24, 2025
408aeb2
qa-kitten
Sep 24, 2025
15336ac
feat: add comprehensive browser automation tools with Camoufox suppor…
mpfaffenberger Sep 26, 2025
9b62064
Merge branch 'web-puppy'
mpfaffenberger Sep 26, 2025
523abd7
chore: bump version [ci skip]
github-actions[bot] Sep 26, 2025
f2e15c9
refactor: move TUI state management to dedicated module
mpfaffenberger Sep 26, 2025
20c5add
refactor: consolidate message history processing logic into BaseAgent…
mpfaffenberger Sep 26, 2025
02b62db
chore: bump version [ci skip]
github-actions[bot] Sep 26, 2025
8a72710
refactor: consolidate agent runtime management and message history pr…
mpfaffenberger Sep 26, 2025
12560be
refactor: improve message history processing and token estimation logic
mpfaffenberger Sep 26, 2025
7b74492
Direct UI flows through current agent and prune dead tool calls
mpfaffenberger Sep 26, 2025
03fecd5
chore: downgrade pydantic-ai dependency and update agent configurations
mpfaffenberger Sep 27, 2025
abcf7ec
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
2c549ed
refactor: restructure agent management and message history persistence
mpfaffenberger Sep 27, 2025
ebba2ac
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
a49c087
refactor: remove playwright fallback and streamline camoufox initiali…
mpfaffenberger Sep 27, 2025
792ea4a
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
f1468c4
refactor: reorganize imports and remove obsolete test files
mpfaffenberger Sep 27, 2025
98abce0
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 27, 2025
22bf30b
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
bfb66c5
Introduce Golang reviewer agent with idiomatic Go playbook (#37)
diegonix Sep 27, 2025
42691cf
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
6524f97
refactor: restructure agent message history handling and remove brows…
mpfaffenberger Sep 27, 2025
d457da1
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
dc0fe04
Feat/spec agents (#38)
diegonix Sep 27, 2025
9440054
chore: bump version [ci skip]
github-actions[bot] Sep 27, 2025
c48a1f3
Fix for /agent bug
mpfaffenberger Sep 28, 2025
271f8a5
chore: bump version [ci skip]
github-actions[bot] Sep 28, 2025
61d6d69
fix: handle agent reload failures after model changes
mpfaffenberger Sep 28, 2025
f31c6c9
Merge remote-tracking branch 'origin/main'
mpfaffenberger Sep 28, 2025
ab6c7bd
chore: bump version [ci skip]
github-actions[bot] Sep 28, 2025
1773029
feat: add message limit configuration to MCP agent execution
mpfaffenberger Oct 1, 2025
7fda8da
chore: bump version [ci skip]
github-actions[bot] Oct 1, 2025
4d5a6cf
Handle missing model configs with friendly fallback path (#39)
diegonix Oct 1, 2025
84e00f3
chore: bump version [ci skip]
github-actions[bot] Oct 1, 2025
a2af62f
Support ZAI
mpfaffenberger Oct 3, 2025
658d7a2
chore: bump version [ci skip]
github-actions[bot] Oct 3, 2025
347dd34
Handle missing model configs with friendly fallback path (#44)
diegonix Oct 4, 2025
14d3bb9
chore: bump version [ci skip]
github-actions[bot] Oct 4, 2025
3c40eef
feat: add plugin system for custom slash commands
mpfaffenberger Oct 9, 2025
1ba6be1
feat: add spinner context display and custom command plugin example
mpfaffenberger Oct 9, 2025
524f5d6
chore: bump version [ci skip]
github-actions[bot] Oct 9, 2025
ab5a724
build: remove tree-sitter language pack dependencies
mpfaffenberger Oct 9, 2025
bbc0c1d
Merge remote-tracking branch 'origin/main'
mpfaffenberger Oct 9, 2025
7ff7bd2
chore: bump version [ci skip]
github-actions[bot] Oct 9, 2025
baa5508
feat: add --agent CLI option for startup agent selection (#33)
wkramme Oct 10, 2025
9b6b5c0
chore: bump version [ci skip]
github-actions[bot] Oct 10, 2025
2f536e5
Quick fix for openai reasoning
mpfaffenberger Oct 10, 2025
fe7073a
chore: bump version [ci skip]
github-actions[bot] Oct 10, 2025
44c7544
feat: add configurable OpenAI reasoning effort for GPT-5 models
mpfaffenberger Oct 10, 2025
cc4b2b2
chore: bump version [ci skip]
github-actions[bot] Oct 10, 2025
8c75712
refactor: simplify enter key handling in prompt completion
mpfaffenberger Oct 10, 2025
8a77362
Merge remote-tracking branch 'origin/main'
mpfaffenberger Oct 10, 2025
cefeb85
chore: bump version [ci skip]
github-actions[bot] Oct 10, 2025
6caab8d
Bump Pydantic AI to 1.0.6
mpfaffenberger Oct 11, 2025
a27303f
refactor: update pydantic-ai imports for renamed model classes
mpfaffenberger Oct 11, 2025
a0470e3
chore: bump version [ci skip]
github-actions[bot] Oct 11, 2025
c323a7e
feat: implement auto-save context functionality (#46)
cgycorey Oct 11, 2025
104590e
chore: bump version [ci skip]
github-actions[bot] Oct 11, 2025
d8f9ab7
refactor: extract session persistence into dedicated storage module
mpfaffenberger Oct 11, 2025
618c667
chore: bump version [ci skip]
github-actions[bot] Oct 11, 2025
fd58280
refactor: replace rolling autosave deletion with stable session IDs
mpfaffenberger Oct 12, 2025
7029ae1
chore: bump version [ci skip]
github-actions[bot] Oct 12, 2025
d757670
feat: add autosave session management with TUI picker and multiline i…
mpfaffenberger Oct 12, 2025
e0b8aa7
chore: bump version [ci skip]
github-actions[bot] Oct 12, 2025
a42fc9e
feat: add autosave session rotation on agent switch and conversation …
mpfaffenberger Oct 12, 2025
c4d33e1
chore: bump version [ci skip]
github-actions[bot] Oct 12, 2025
ca322c6
refactor: honor per-agent pinned models in context length calculation…
mpfaffenberger Oct 13, 2025
557e66c
chore: bump version [ci skip]
github-actions[bot] Oct 13, 2025
6c59aa6
feat: add support for file attachments and URLs in prompts
mpfaffenberger Oct 12, 2025
b6794c1
fix: add string representation for BinaryContent in message formatting
mpfaffenberger Oct 12, 2025
64f63c4
doing stuff
mpfaffenberger Oct 12, 2025
61f01d1
Basic image input
mpfaffenberger Oct 12, 2025
56a490c
feat: add support for drag-and-drop file paths with escaped spaces
mpfaffenberger Oct 13, 2025
d032a8c
fix: preserve backslashes in file paths on Windows during tokenization
mpfaffenberger Oct 13, 2025
1e78747
refactor: simplify attachment handling to support images only
mpfaffenberger Oct 13, 2025
95386dc
chore: bump version [ci skip]
github-actions[bot] Oct 13, 2025
4f2ceb2
refactor: implement pagination for autosave session selection interface
mpfaffenberger Oct 13, 2025
aaca8f8
chore: bump version [ci skip]
github-actions[bot] Oct 13, 2025
b97e62b
refactor: disable URL parsing in prompt attachments and fix agent his…
mpfaffenberger Oct 13, 2025
87e1f44
chore: bump version [ci skip]
github-actions[bot] Oct 13, 2025
a30447e
feat: implement persistent browser profile storage for Camoufox
Oct 14, 2025
450cabb
fix: resolve import path and browser initialization issues
mpfaffenberger Oct 14, 2025
e1a6f35
chore: bump version [ci skip]
github-actions[bot] Oct 14, 2025
9fae017
Fix windoze bug
mpfaffenberger Oct 14, 2025
2be1060
chore: bump version [ci skip]
github-actions[bot] Oct 14, 2025
c4e235b
first pass at /history
RonStew2019 Oct 15, 2025
266f417
display userpromptpart, thinkingpart, toolcallpart, and textpart
RonStew2019 Oct 15, 2025
3a2f115
linecount arg
RonStew2019 Oct 15, 2025
7c33850
tests
RonStew2019 Oct 16, 2025
bcd5f02
verbose
RonStew2019 Oct 16, 2025
6c6843d
blufus made interesting decisions with tests
RonStew2019 Oct 16, 2025
da2d567
refactor: extract history command logic into dedicated module
RonStew2019 Oct 29, 2025
9ce8a20
refactor: migrate /history command to dedicated module
RonStew2019 Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Quality Checks

on:
pull_request:
branches:
- '**'

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dev dependencies (ruff, pytest)
run: pip install ruff pytest pytest-cov pytest-asyncio

- name: Install code_puppy
run: pip install .

- name: Lint with ruff
run: ruff check .

- name: Check formatting with ruff
run: ruff format --check .

- name: Run pytest
run: pytest --cov=code_puppy -s
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ wheels/
.venv

.coverage

# Session memory
.puppy_session_memory.json

# Pytest cache
.pytest_cache/

dummy_path

.idea/
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
fail_fast: true
repos:
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: [--filter-files, --profile, black]
files: \.py$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-json
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.2
hooks:
# Run the linter.
- id: ruff
args: [--fix, --ignore=E501]
# Run the formatter.
- id: ruff-format
53 changes: 53 additions & 0 deletions AGENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Code Puppy

Code Puppy is a code gen agent!

## Code Style

- Clean
- Concise
- Follow yagni, srp, dry, etc
- Don't write files longer than 600 lines
- type hints on everything

## Testing

- `uv run pytest`

## Namespaces Packages

code_puppy
- agent.py - declares code generation agent
- agent_prompts.py - declares prompt for agent
- config.py - global config manager
- main.py - CLI loop
- message_history_processor.py - message history trimming, summarization logic
- __init__.py - package version detection and exposure
- model_factory.py - constructs models from configuration mapping
- models.json - available models and metadata registry
- state_management.py - global message history state helpers
- summarization_agent.py - specialized agent for history summarization
- version_checker.py - fetches latest PyPI package version

code_puppy.tools
- __init__.py - registers all available tool modules
- common.py - shared console and ignore helpers
- command_runner.py - shell command execution with confirmations
- file_modifications.py - robust file editing with diffs
- file_operations.py - list read grep filesystem files

code_puppy.command_line
- __init__.py - marks command line subpackage init
- file_path_completion.py - path completion with @ trigger
- meta_command_handler.py - handles meta commands and configuration
- model_picker_completion.py - model selection completion and setters
- motd.py - message of the day tracking
- prompt_toolkit_completion.py - interactive prompt with combined completers
- utils.py - directory listing and table utilities

## Git Workflow

- ALWAYS run `pnpm check` before committing
- Fix linting errors with `ruff check --fix`
- Run `ruff format .` to auto format
- NEVER use `git push --force` on the main branch
57 changes: 57 additions & 0 deletions DEV_CONSOLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Code Puppy Developer Console Commands

Woof! Here’s the scoop on built-in dev-console `~` meta-commands and exactly how you can add your own. This is for the secret society of code hackers (that’s you now).

## Available Console Commands

| Command | Description |
|---------------------|----------------------------------------------------------|
| `~cd [dir]` | Show directory listing or change working directory |
| `~show` | Show puppy/owner/model status and metadata |
| `~m <model>` | Switch the active code model for the agent |
| `~set KEY=VALUE` | Set a puppy.cfg setting! |
| `~help` or `~h` | Show available meta-commands |
| any unknown `~...` | Warn user about unknown command and (for plain `~`) |
| | shows current model |

## How to Add a New Meta-Command

All `~meta` commands are handled in **`code_puppy/command_line/meta_command_handler.py`** inside the `handle_meta_command` function. Follow these steps:

### 1. Edit the Command Handler
- Open `code_puppy/command_line/meta_command_handler.py`.
- Locate the `handle_meta_command(command: str, console: Console) -> bool` function.
- Add a new `if command.startswith("~yourcmd"):` block (do this _above_ the "unknown command" fallback).
- Use .startswith for prefix commands (e.g., `~foo bar`), or full equality if you want only the bare command to match.
- Implement your logic. Use rich’s Console to print stuff back to the terminal.
- Return `True` if you handle the command.

### 2. (Optional) Add Autocomplete

### ~set: Update your code puppy’s settings

`~set` lets you instantly update values in your puppy.cfg, like toggling YOLO_MODE or renaming your puppy on the fly!

- Usage:
- `~set YOLO_MODE=true`
- `~set puppy_name Snoopy`
- `~set owner_name="Best Owner"`

As you type `~set`, tab completion pops up with available config keys so you don’t have to remember them like a boring human.

If your new command needs tab completion/prompt support, check these files:
- `code_puppy/command_line/prompt_toolkit_completion.py` (has completer logic)
- `code_puppy/command_line/model_picker_completion.py`, `file_path_completion.py` (for model/filename completions)

Update them if your command would benefit from better input support. Usually you just need meta_command_handler.py, though!

### 3. (Optional) Update Help
- Update the help text inside the `~help` handler to list your new command and a short description.

### 4. (Optional) Add Utilities
Place any helper logic for your command in an appropriate utils or tools module if it grows big. Don’t go dumping everything in meta_command_handler.py, or the puppy will fetch your slippers in protest!


---

Be concise, be fun, don’t make your files long, and remember: if you find yourself writing more than a quick conditional in meta_command_handler.py, break that logic out into another module! Woof woof!
8 changes: 2 additions & 6 deletions ENVIRONMENT_VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ This document lists all environment variables that can be used to configure Code
| `MODELS_JSON_PATH` | Optional path to a custom models.json configuration file. | Package directory models.json | agent.py |
| `GEMINI_API_KEY` | API key for Google's Gemini models. | None | model_factory.py |
| `OPENAI_API_KEY` | API key for OpenAI models. | None | model_factory.py |

## Command Execution

| Variable | Description | Default | Used In |
|----------|-------------|---------|---------|
| `YOLO_MODE` | When set to "true" (case-insensitive), bypasses the safety confirmation prompt when running shell commands. This allows commands to execute without user intervention. | `false` | tools/command_runner.py |
| `CEREBRAS_API_KEY` | API key for Cerebras models. | None | model_factory.py |

## Custom Endpoints

Expand Down Expand Up @@ -72,5 +67,6 @@ code-puppy --interactive
# Set API keys for model providers
export OPENAI_API_KEY=sk-...
export GEMINI_API_KEY=...
export CEREBRAS_API_KEY=...
code-puppy --interactive
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Mike Pfaffenberger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading