codefox 0.4.0__tar.gz → 0.4.1__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.
Files changed (70) hide show
  1. codefox-0.4.1/.github/ISSUE_TEMPLATE/bug-report.md +52 -0
  2. codefox-0.4.1/.github/ISSUE_TEMPLATE/feature_request.md +30 -0
  3. codefox-0.4.1/.github/PULL_REQUEST_TEMPLATE.md +29 -0
  4. codefox-0.4.1/.github/workflows/ci.yml +39 -0
  5. codefox-0.4.1/.github/workflows/publish.yml +30 -0
  6. codefox-0.4.1/.gitignore +15 -0
  7. codefox-0.4.1/.python-version +1 -0
  8. codefox-0.4.1/CODE_OF_CONDUCT.md +128 -0
  9. codefox-0.4.1/CONTRIBUTING.md +109 -0
  10. {codefox-0.4.0 → codefox-0.4.1}/PKG-INFO +106 -54
  11. {codefox-0.4.0 → codefox-0.4.1}/README.md +73 -37
  12. codefox-0.4.1/SECURITY.md +50 -0
  13. codefox-0.4.1/WIKI.md +588 -0
  14. codefox-0.4.1/action.yml +58 -0
  15. codefox-0.4.1/assets/logo.png +0 -0
  16. codefox-0.4.1/assets/work_review.gif +0 -0
  17. {codefox-0.4.0 → codefox-0.4.1}/pyproject.toml +36 -2
  18. codefox-0.4.1/requirements-dev.txt +8 -0
  19. codefox-0.4.0/codefox.egg-info/requires.txt → codefox-0.4.1/requirements.in +3 -11
  20. codefox-0.4.1/requirements.txt +18 -0
  21. codefox-0.4.1/setup.py +74 -0
  22. codefox-0.4.1/tests/conftest.py +41 -0
  23. codefox-0.4.1/uv.lock +2363 -0
  24. codefox-0.4.0/codefox.egg-info/PKG-INFO +0 -256
  25. codefox-0.4.0/codefox.egg-info/SOURCES.txt +0 -49
  26. codefox-0.4.0/codefox.egg-info/dependency_links.txt +0 -1
  27. codefox-0.4.0/codefox.egg-info/entry_points.txt +0 -2
  28. codefox-0.4.0/codefox.egg-info/top_level.txt +0 -1
  29. codefox-0.4.0/setup.cfg +0 -4
  30. codefox-0.4.0/setup.py +0 -49
  31. {codefox-0.4.0 → codefox-0.4.1}/LICENSE +0 -0
  32. {codefox-0.4.0 → codefox-0.4.1}/codefox/__init__.py +0 -0
  33. {codefox-0.4.0 → codefox-0.4.1}/codefox/__main__.py +0 -0
  34. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/__init__.py +0 -0
  35. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/base_api.py +0 -0
  36. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/gemini.py +0 -0
  37. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/model_enum.py +0 -0
  38. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/ollama.py +0 -0
  39. {codefox-0.4.0 → codefox-0.4.1}/codefox/api/openrouter.py +0 -0
  40. {codefox-0.4.0 → codefox-0.4.1}/codefox/bots/__init__.py +0 -0
  41. {codefox-0.4.0 → codefox-0.4.1}/codefox/bots/github_bot.py +0 -0
  42. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/__init__.py +0 -0
  43. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/base_cli.py +0 -0
  44. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/clean.py +0 -0
  45. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/init.py +0 -0
  46. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/list.py +0 -0
  47. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli/scan.py +0 -0
  48. {codefox-0.4.0 → codefox-0.4.1}/codefox/cli_manager.py +0 -0
  49. {codefox-0.4.0 → codefox-0.4.1}/codefox/main.py +0 -0
  50. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/__init__.py +0 -0
  51. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/audit/__init__.py +0 -0
  52. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/audit/audit_content.py +0 -0
  53. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/audit/audit_system.py +0 -0
  54. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/prompt_template.py +0 -0
  55. {codefox-0.4.0 → codefox-0.4.1}/codefox/prompts/template.py +0 -0
  56. {codefox-0.4.0 → codefox-0.4.1}/codefox/tools/__init__.py +0 -0
  57. {codefox-0.4.0 → codefox-0.4.1}/codefox/tools/base_tool.py +0 -0
  58. {codefox-0.4.0 → codefox-0.4.1}/codefox/tools/rag_tool.py +0 -0
  59. {codefox-0.4.0 → codefox-0.4.1}/codefox/utils/__init__.py +0 -0
  60. {codefox-0.4.0 → codefox-0.4.1}/codefox/utils/helper.py +0 -0
  61. {codefox-0.4.0 → codefox-0.4.1}/codefox/utils/local_rag.py +0 -0
  62. {codefox-0.4.0 → codefox-0.4.1}/codefox/utils/parser.py +0 -0
  63. {codefox-0.4.0 → codefox-0.4.1}/tests/test_base_api_config.py +0 -0
  64. {codefox-0.4.0 → codefox-0.4.1}/tests/test_clean.py +0 -0
  65. {codefox-0.4.0 → codefox-0.4.1}/tests/test_cli_manager.py +0 -0
  66. {codefox-0.4.0 → codefox-0.4.1}/tests/test_helper.py +0 -0
  67. {codefox-0.4.0 → codefox-0.4.1}/tests/test_local_rag.py +0 -0
  68. {codefox-0.4.0 → codefox-0.4.1}/tests/test_model_enum.py +0 -0
  69. {codefox-0.4.0 → codefox-0.4.1}/tests/test_prompt_template.py +0 -0
  70. {codefox-0.4.0 → codefox-0.4.1}/tests/test_scan.py +0 -0
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug or unexpected behavior in CodeFox-CLI
4
+ title: "[Bug]: "
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Description
11
+
12
+ A clear, short description of the bug.
13
+
14
+ ## Steps to reproduce
15
+
16
+ 1.
17
+ 2.
18
+ 3.
19
+
20
+ ## Expected behavior
21
+
22
+ What you expected to happen.
23
+
24
+ ## Actual behavior
25
+
26
+ What actually happened (error message, wrong output, crash, etc.).
27
+
28
+ ## Environment
29
+
30
+ - **OS:** (e.g. macOS 14, Ubuntu 22.04, Windows 11)
31
+ - **Python version:** (e.g. 3.11.6 — run `python3 --version`)
32
+ - **CodeFox version:** (e.g. 0.3.2 — run `codefox --command version`)
33
+ - **Provider:** (e.g. gemini / ollama / openrouter)
34
+ - **Model:** (e.g. gemini-2.0-flash, llama3.2, from `.codefox.yml`)
35
+
36
+ ## Config (optional)
37
+
38
+ If relevant, paste the **non-sensitive** parts of `.codefox.yml` (e.g. provider, model name, review settings). Do **not** paste `.codefoxenv` or any API keys.
39
+
40
+ ```yaml
41
+ # paste here (without secrets)
42
+ ```
43
+
44
+ ## Logs / output (optional)
45
+
46
+ ```
47
+ Paste full terminal output or error traceback here.
48
+ ```
49
+
50
+ ## Additional context
51
+
52
+ Any other details that might help (repo type, size of diff, first time vs recurring, etc.).
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest a new feature or improvement for CodeFox-CLI
4
+ title: "[Feature]: "
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Problem or motivation
11
+
12
+ What problem does this solve, or what workflow would it improve? (e.g. "I want to run CodeFox in CI and post the result as a PR comment.")
13
+
14
+ ## Proposed solution
15
+
16
+ A clear description of the feature or change you’d like.
17
+
18
+ ## Alternatives considered
19
+
20
+ Have you thought about other ways to achieve the same? (e.g. "Could be a separate CLI flag instead of a config option.")
21
+
22
+ ## Additional context
23
+
24
+ - Use case (personal / team / CI / open source)?
25
+ - Provider(s) you use (e.g. ollama, gemini, openrouter)?
26
+ - Any mockups, examples, or links to similar tools?
27
+
28
+ ## Optional: implementation ideas
29
+
30
+ If you have ideas on how this could be implemented (e.g. "reuse existing BaseAPI", "add a new command"), share them here. Not required.
@@ -0,0 +1,29 @@
1
+ ## Description
2
+
3
+ Brief description of the changes in this PR.
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix (non-breaking change that fixes an issue)
8
+ - [ ] New feature (non-breaking change that adds functionality)
9
+ - [ ] Breaking change (fix or feature that would change existing behavior)
10
+ - [ ] Documentation update
11
+ - [ ] Refactor / code quality (no behavior change)
12
+
13
+ ## Related issue(s)
14
+
15
+ Fixes #(issue number)
16
+ _or_ Relates to #(issue number)
17
+
18
+ ## Checklist
19
+
20
+ - [ ] Tests added or updated for the changed behavior
21
+ - [ ] `ruff check codefox tests` and `ruff format codefox tests` pass
22
+ - [ ] `mypy codefox` passes
23
+ - [ ] `pytest tests -v` passes
24
+ - [ ] README / WIKI / docstrings updated if user-facing behavior or config changed
25
+ - [ ] No secrets or credentials in the diff
26
+
27
+ ## Additional notes
28
+
29
+ Any extra context for reviewers (e.g. why this approach, follow-up work).
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ pull_request:
7
+ branches: [main, dev]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Ruff
30
+ run: ruff check codefox tests
31
+
32
+ - name: Ruff format check
33
+ run: ruff format --check codefox tests
34
+
35
+ - name: Mypy
36
+ run: mypy codefox --no-error-summary || true
37
+
38
+ - name: Pytest
39
+ run: pytest tests -v --tb=short
@@ -0,0 +1,30 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.11"
17
+
18
+ - name: Install build tools
19
+ run: |
20
+ python -m pip install --upgrade build twine
21
+
22
+ - name: Build package
23
+ run: python -m build
24
+
25
+ - name: Publish package
26
+ env:
27
+ TWINE_USERNAME: __token__
28
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
29
+ run: |
30
+ twine upload dist/*
@@ -0,0 +1,15 @@
1
+ .vscode/
2
+ .idea/
3
+ .venv/
4
+ .*_cache/
5
+ .env
6
+ .codefoxenv
7
+ .codefoxignore
8
+ .codefox.yml
9
+
10
+ venv*/
11
+ build/
12
+ __pycache__/
13
+ *.pyc
14
+ .codefox/
15
+ codefox.egg-info/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ info@code-fox.online.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,109 @@
1
+ # Contributing to CodeFox-CLI
2
+
3
+ Thank you for your interest in contributing. This document explains how to set up the project, run checks, and submit changes.
4
+
5
+ ## Code of Conduct
6
+
7
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.
8
+
9
+ ## How to Contribute
10
+
11
+ - **Bug reports and feature ideas** — open a [GitHub Issue](https://github.com/URLbug/CodeFox-CLI/issues). Describe the problem or proposal and your environment (OS, Python version, provider).
12
+ - **Security issues** — do not open a public issue. See [SECURITY.md](SECURITY.md) for responsible disclosure.
13
+ - **Code and docs** — open a Pull Request (see below).
14
+
15
+ ## Development Setup
16
+
17
+ **Requirements:** Python 3.11+
18
+
19
+ 1. Clone the repository:
20
+
21
+ ```bash
22
+ git clone https://github.com/URLbug/CodeFox-CLI.git
23
+ cd CodeFox-CLI
24
+ ```
25
+
26
+ 2. Install in editable mode with dev dependencies:
27
+
28
+ **pip:**
29
+ ```bash
30
+ pip install -e ".[dev]"
31
+ ```
32
+
33
+ **uv:**
34
+ ```bash
35
+ uv pip install -e ".[dev]"
36
+ ```
37
+
38
+ 3. Verify:
39
+
40
+ ```bash
41
+ codefox --command version
42
+ ```
43
+
44
+ ## Running Checks
45
+
46
+ Before submitting a PR, run the following from the project root.
47
+
48
+ **Tests:**
49
+ ```bash
50
+ pytest tests -v --tb=short
51
+ ```
52
+
53
+ **Lint (Ruff):**
54
+ ```bash
55
+ ruff check codefox tests
56
+ ruff format codefox tests
57
+ ```
58
+
59
+ **Type check (mypy):**
60
+ ```bash
61
+ mypy codefox
62
+ ```
63
+
64
+ **All at once (recommended):**
65
+ ```bash
66
+ ruff check codefox tests && ruff format --check codefox tests && mypy codefox && pytest tests -v --tb=short
67
+ ```
68
+
69
+ CI runs the same checks on push/PR; your branch should pass before merge.
70
+
71
+ ## Pull Request Process
72
+
73
+ 1. **Branch** — create a branch from `main` (or `dev`, if that’s the default). Use a short prefix, e.g. `fix/`, `feat/`, `docs/`.
74
+ 2. **Changes** — keep the diff focused. One logical change per PR is easier to review.
75
+ 3. **Tests** — add or update tests for bug fixes and new behavior.
76
+ 4. **Docs** — update README, [WIKI.md](WIKI.md), or docstrings if you change behavior or config.
77
+ 5. **Open PR** — describe what you changed and why. Link any related issues.
78
+ 6. **Review** — address feedback. Once CI is green and a maintainer approves, your PR can be merged.
79
+
80
+ ## Project Structure (quick reference)
81
+
82
+ | Path | Purpose |
83
+ |------|--------|
84
+ | `codefox/main.py` | CLI entry point (Typer) |
85
+ | `codefox/cli_manager.py` | Command routing (init, scan, list, version) |
86
+ | `codefox/scan.py` | Scan workflow (diff → upload → model → output) |
87
+ | `codefox/init.py` | Init workflow (API key, .codefoxignore, .codefox.yml) |
88
+ | `codefox/api/base_api.py` | Abstract base for providers |
89
+ | `codefox/api/*.py` | Provider implementations (Gemini, Ollama, OpenRouter) |
90
+ | `codefox/api/model_enum.py` | Provider registry |
91
+ | `codefox/prompts/` | System prompts and template |
92
+ | `codefox/utils/` | Helpers (YAML, git diff, RAG, etc.) |
93
+ | `tests/` | Pytest tests |
94
+
95
+ Adding a new provider: implement `BaseAPI` in `codefox/api/`, register in `ModelEnum`, and add a default model name. See existing providers for patterns.
96
+
97
+ ## Code Style
98
+
99
+ - **Formatting:** Ruff (line length 79). Run `ruff format codefox tests` before committing.
100
+ - **Linting:** Ruff rules E, F, I, N, W, UP. No new warnings in `codefox` or `tests`.
101
+ - **Types:** mypy with the options in `pyproject.toml`. Type hints encouraged for new code.
102
+ - **Tests:** Pytest. Use `tests/conftest.py` fixtures where useful. Avoid `S101` in tests (assert with plain strings allowed).
103
+
104
+ ## Questions
105
+
106
+ - **Usage and config** — see [README.md](README.md) and [WIKI.md](WIKI.md).
107
+ - **Bugs and features** — open an [Issue](https://github.com/URLbug/CodeFox-CLI/issues).
108
+
109
+ Thanks for contributing.