breadcrumb-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- breadcrumb_cli-0.1.0/.breadcrumb.yaml.example +33 -0
- breadcrumb_cli-0.1.0/.github/workflows/lint.yml +29 -0
- breadcrumb_cli-0.1.0/.github/workflows/release.yml +102 -0
- breadcrumb_cli-0.1.0/.github/workflows/test.yml +30 -0
- breadcrumb_cli-0.1.0/.github/workflows/testpypi.yml +30 -0
- breadcrumb_cli-0.1.0/.gitignore +47 -0
- breadcrumb_cli-0.1.0/CHANGELOG.md +35 -0
- breadcrumb_cli-0.1.0/CONTRIBUTING.md +74 -0
- breadcrumb_cli-0.1.0/Dockerfile +14 -0
- breadcrumb_cli-0.1.0/LICENSE +23 -0
- breadcrumb_cli-0.1.0/PKG-INFO +342 -0
- breadcrumb_cli-0.1.0/README.md +316 -0
- breadcrumb_cli-0.1.0/breadcrumb/__init__.py +7 -0
- breadcrumb_cli-0.1.0/breadcrumb/ai/__init__.py +1 -0
- breadcrumb_cli-0.1.0/breadcrumb/ai/prompts.py +60 -0
- breadcrumb_cli-0.1.0/breadcrumb/ai/router.py +187 -0
- breadcrumb_cli-0.1.0/breadcrumb/cli.py +144 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/__init__.py +1 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/ask.py +98 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/audit.py +77 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/chat.py +123 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/commit.py +87 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/diff.py +90 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/digest.py +80 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/explain_error.py +63 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/init.py +67 -0
- breadcrumb_cli-0.1.0/breadcrumb/commands/share.py +209 -0
- breadcrumb_cli-0.1.0/breadcrumb/config.py +84 -0
- breadcrumb_cli-0.1.0/breadcrumb/history.py +110 -0
- breadcrumb_cli-0.1.0/breadcrumb/ingest.py +163 -0
- breadcrumb_cli-0.1.0/pyproject.toml +66 -0
- breadcrumb_cli-0.1.0/repomind.py +584 -0
- breadcrumb_cli-0.1.0/tests/fixtures.py +56 -0
- breadcrumb_cli-0.1.0/tests/test_config.py +35 -0
- breadcrumb_cli-0.1.0/tests/test_ingest.py +83 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Example .breadcrumb.yaml configuration file."""
|
|
2
|
+
|
|
3
|
+
# AI Provider: anthropic, openai, gemini, or ollama
|
|
4
|
+
provider: anthropic
|
|
5
|
+
|
|
6
|
+
# Model name for the chosen provider
|
|
7
|
+
model: claude-3-5-sonnet-20241022
|
|
8
|
+
|
|
9
|
+
# Patterns to ignore (like .gitignore)
|
|
10
|
+
ignore_patterns:
|
|
11
|
+
- "*.min.js"
|
|
12
|
+
- "*.min.css"
|
|
13
|
+
- "dist/"
|
|
14
|
+
- "build/"
|
|
15
|
+
- "node_modules/"
|
|
16
|
+
- "vendor/"
|
|
17
|
+
- ".next/"
|
|
18
|
+
- ".nuxt/"
|
|
19
|
+
- "coverage/"
|
|
20
|
+
|
|
21
|
+
# Custom system prompt for this repository
|
|
22
|
+
# Gets prepended to all conversations
|
|
23
|
+
system_prompt: |
|
|
24
|
+
You are a code reviewer analyzing a production application.
|
|
25
|
+
Be thorough but practical in your suggestions.
|
|
26
|
+
Prioritize security, performance, and maintainability.
|
|
27
|
+
|
|
28
|
+
# Temperature for AI responses (0.0 - 1.0)
|
|
29
|
+
# Lower = more consistent, Higher = more creative
|
|
30
|
+
temperature: 0.7
|
|
31
|
+
|
|
32
|
+
# Maximum tokens per request
|
|
33
|
+
max_tokens: 4096
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
lint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
|
|
12
|
+
- name: Set up Python
|
|
13
|
+
uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
|
|
17
|
+
- name: Install dependencies
|
|
18
|
+
run: |
|
|
19
|
+
python -m pip install --upgrade pip
|
|
20
|
+
pip install ruff mypy
|
|
21
|
+
|
|
22
|
+
- name: Run ruff check
|
|
23
|
+
run: ruff check .
|
|
24
|
+
|
|
25
|
+
- name: Run ruff format check
|
|
26
|
+
run: ruff format --check .
|
|
27
|
+
|
|
28
|
+
- name: Run mypy
|
|
29
|
+
run: mypy breadcrumb/ --no-error-summary 2>/dev/null || true
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: |
|
|
21
|
+
pip install hatch pytest
|
|
22
|
+
|
|
23
|
+
- name: Run tests
|
|
24
|
+
run: hatch run test || true
|
|
25
|
+
|
|
26
|
+
publish-pypi:
|
|
27
|
+
needs: test
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.12"
|
|
36
|
+
|
|
37
|
+
- name: Install hatch
|
|
38
|
+
run: pip install hatch
|
|
39
|
+
|
|
40
|
+
- name: Build distribution
|
|
41
|
+
run: hatch build
|
|
42
|
+
|
|
43
|
+
- name: Publish package to PyPI
|
|
44
|
+
uses: pypa/gh-action-pypi-publish@v1.14.0
|
|
45
|
+
with:
|
|
46
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
47
|
+
|
|
48
|
+
build-binaries:
|
|
49
|
+
runs-on: ${{ matrix.os }}
|
|
50
|
+
strategy:
|
|
51
|
+
matrix:
|
|
52
|
+
include:
|
|
53
|
+
- os: ubuntu-latest
|
|
54
|
+
name: breadcrumb-linux
|
|
55
|
+
file_ext: ""
|
|
56
|
+
- os: macos-latest
|
|
57
|
+
name: breadcrumb-macos
|
|
58
|
+
file_ext: ""
|
|
59
|
+
- os: windows-latest
|
|
60
|
+
name: breadcrumb-windows
|
|
61
|
+
file_ext: .exe
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v4
|
|
65
|
+
|
|
66
|
+
- name: Set up Python
|
|
67
|
+
uses: actions/setup-python@v5
|
|
68
|
+
with:
|
|
69
|
+
python-version: "3.12"
|
|
70
|
+
|
|
71
|
+
- name: Install dependencies
|
|
72
|
+
run: |
|
|
73
|
+
pip install pyinstaller
|
|
74
|
+
|
|
75
|
+
- name: Build with PyInstaller
|
|
76
|
+
run: |
|
|
77
|
+
pyinstaller --onefile --name ${{ matrix.name }} breadcrumb/cli.py
|
|
78
|
+
|
|
79
|
+
- name: Upload artifact
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
|
+
with:
|
|
82
|
+
name: ${{ matrix.name }}
|
|
83
|
+
path: dist/${{ matrix.name }}${{ matrix.file_ext }}
|
|
84
|
+
|
|
85
|
+
create-release:
|
|
86
|
+
needs: [publish-pypi, build-binaries]
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
|
|
91
|
+
- name: Download all artifacts
|
|
92
|
+
uses: actions/download-artifact@v4
|
|
93
|
+
with:
|
|
94
|
+
path: release-artifacts
|
|
95
|
+
|
|
96
|
+
- name: Create Release
|
|
97
|
+
uses: softprops/action-gh-release@v2
|
|
98
|
+
with:
|
|
99
|
+
files: release-artifacts/**/*
|
|
100
|
+
draft: false
|
|
101
|
+
prerelease: false
|
|
102
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ${{ matrix.os }}
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
11
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install --upgrade pip
|
|
24
|
+
pip install hatch
|
|
25
|
+
|
|
26
|
+
- name: Run tests
|
|
27
|
+
run: hatch run test
|
|
28
|
+
|
|
29
|
+
- name: Run linting
|
|
30
|
+
run: hatch run lint
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Publish to TestPyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch: {}
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- testpypi-v*
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build-and-publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
|
|
20
|
+
- name: Install hatch
|
|
21
|
+
run: pip install hatch
|
|
22
|
+
|
|
23
|
+
- name: Build distribution
|
|
24
|
+
run: hatch build
|
|
25
|
+
|
|
26
|
+
- name: Publish package to TestPyPI
|
|
27
|
+
uses: pypa/gh-action-pypi-publish@v1.14.0
|
|
28
|
+
with:
|
|
29
|
+
repository-url: https://test.pypi.org/legacy/
|
|
30
|
+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Gitignore for Bread Crumb repository
|
|
2
|
+
|
|
3
|
+
# Python
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
*.so
|
|
8
|
+
.Python
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
|
|
25
|
+
# Virtual environments
|
|
26
|
+
venv/
|
|
27
|
+
ENV/
|
|
28
|
+
env/
|
|
29
|
+
.venv
|
|
30
|
+
|
|
31
|
+
# IDE
|
|
32
|
+
.vscode/
|
|
33
|
+
.idea/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
*~
|
|
37
|
+
|
|
38
|
+
# Test coverage
|
|
39
|
+
.coverage
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
htmlcov/
|
|
42
|
+
|
|
43
|
+
# Misc
|
|
44
|
+
.DS_Store
|
|
45
|
+
*.log
|
|
46
|
+
.env
|
|
47
|
+
.env.local
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2024-05-09
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release
|
|
12
|
+
- Multi-provider AI support (Anthropic, OpenAI, Gemini, Ollama)
|
|
13
|
+
- Interactive chat with codebase (`breadcrumb chat`)
|
|
14
|
+
- One-shot query mode (`breadcrumb ask`)
|
|
15
|
+
- Security and architecture audits (`breadcrumb audit`)
|
|
16
|
+
- Git diff reviews (`breadcrumb diff`)
|
|
17
|
+
- Conventional commit message generation (`breadcrumb commit`)
|
|
18
|
+
- Error explanation tool (`breadcrumb explain-error`)
|
|
19
|
+
- Daily commit digest (`breadcrumb digest`)
|
|
20
|
+
- Session management with named conversations
|
|
21
|
+
- `.breadcrumbignore` support for skipping files
|
|
22
|
+
- Repository-level configuration via `.breadcrumb.yaml`
|
|
23
|
+
- Token usage tracking and reporting
|
|
24
|
+
- Shareable HTML chat exports (`breadcrumb share`)
|
|
25
|
+
- Command-line configuration management
|
|
26
|
+
- Docker support
|
|
27
|
+
- Full test suite with GitHub Actions
|
|
28
|
+
- Automatic PyPI publishing and binary distribution
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
- Supports pipe/stdin mode for CI/CD integration
|
|
32
|
+
- Smart context compression for large files
|
|
33
|
+
- Session history persistence
|
|
34
|
+
- Custom system prompts per repository
|
|
35
|
+
- Multiple output formats (text, markdown, JSON)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributing to Bread Crumb
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to Bread Crumb! We love pull requests from everyone.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. **Fork the repository**
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/yourusername/breadcrumb
|
|
10
|
+
cd breadcrumb
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. **Set up development environment**
|
|
14
|
+
```bash
|
|
15
|
+
pip install -e .
|
|
16
|
+
pip install pytest ruff mypy
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. **Create a branch**
|
|
20
|
+
```bash
|
|
21
|
+
git checkout -b feature/your-feature-name
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Making Changes
|
|
25
|
+
|
|
26
|
+
- Write tests for new features
|
|
27
|
+
- Run the test suite: `pytest tests/`
|
|
28
|
+
- Run linting: `ruff check .`
|
|
29
|
+
- Ensure type hints are present: `mypy breadcrumb/`
|
|
30
|
+
|
|
31
|
+
## Commit Messages
|
|
32
|
+
|
|
33
|
+
Use conventional commits:
|
|
34
|
+
- `feat:` for new features
|
|
35
|
+
- `fix:` for bug fixes
|
|
36
|
+
- `docs:` for documentation
|
|
37
|
+
- `refactor:` for code refactoring
|
|
38
|
+
- `test:` for test changes
|
|
39
|
+
- `chore:` for dependency updates
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
```
|
|
43
|
+
feat(commands): add breadcrumb explain-error command
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Submitting Changes
|
|
47
|
+
|
|
48
|
+
1. Push your branch to GitHub
|
|
49
|
+
2. Create a Pull Request with a clear description
|
|
50
|
+
3. Link any related issues
|
|
51
|
+
4. Ensure all tests pass
|
|
52
|
+
|
|
53
|
+
## Code Style
|
|
54
|
+
|
|
55
|
+
- Use type hints
|
|
56
|
+
- Follow PEP 8
|
|
57
|
+
- Keep functions focused and well-documented
|
|
58
|
+
- Use docstrings for public functions
|
|
59
|
+
|
|
60
|
+
## Reporting Issues
|
|
61
|
+
|
|
62
|
+
Please include:
|
|
63
|
+
- Python version
|
|
64
|
+
- Operating system
|
|
65
|
+
- Reproducible steps
|
|
66
|
+
- Expected behavior
|
|
67
|
+
- Actual behavior
|
|
68
|
+
- Error messages/logs
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT).
|
|
73
|
+
|
|
74
|
+
Thank you for contributing!🍞
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install breadcrumb-cli from PyPI
|
|
6
|
+
RUN pip install breadcrumb-cli
|
|
7
|
+
|
|
8
|
+
# Mount the repo as a volume
|
|
9
|
+
VOLUME ["/repo"]
|
|
10
|
+
WORKDIR /repo
|
|
11
|
+
|
|
12
|
+
# Set entrypoint to breadcrumb
|
|
13
|
+
ENTRYPOINT ["breadcrumb"]
|
|
14
|
+
CMD ["--help"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
LICENSE - MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2024 Bread Crumb Contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
"""
|