Assistant for reviewing your code
Project description
CodeSpector
CodeSpector is a Python package designed to review code changes for quality and security issues using AI chat agents. It supports different chat agents like Codestral and ChatGPT.
Features
- Automated code review using AI chat agents.
- Supports multiple chat agents and models.
- Generates detailed review reports in markdown format.
- Configurable via environment variables and command-line options.
Installation
To install the package, use the following command:
pip install codespector
uv add codespector
Usage
Command-Line Interface
You can use the codespector command to start a code review. Below are the available options:
Usage: codespector [OPTIONS]
Options:
--system-content TEXT Content which used in system field for agent
[default: Ты код ревьювер. Отвечай на русском языке.]
--output-dir TEXT Select the output directory [default: codespector]
-b, --compare-branch TEXT Select the branch to compare the current one with
[default: develop]
--chat-agent [codestral|chatgpt]
Choose the chat agent to use [default: codestral]
--chat-model TEXT Choose the chat model to use
--chat-token TEXT Chat agent token
--mode [local] Choose the mode of the application [default: local]
--version Show the version and exit.
--help Show this message and exit.
Example
To run a code review, use the following command:
codespector --chat-token YOUR_CHAT_TOKEN --chat-agent codestral --compare-branch develop
Configuration
You can also configure CodeSpector using environment variables. Create a .env file in the root directory of your project with the following content:
CODESPECTOR_SYSTEM_CONTENT=Ты код ревьювер. Отвечай на русском языке.
CODESPECTOR_OUTPUT_DIR=codespector
CODESPECTOR_CHAT_AGENT=codestral
CODESPECTOR_CHAT_MODEL=codestral-latest
CODESPECTOR_CHAT_TOKEN=YOUR_CHAT_TOKEN
Makefile Commands
lint: Run linting and formatting checks.format: Format the code.fix: Fix linting issues and format the code.test: Run the tests.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codespector-0.1.1.tar.gz.
File metadata
- Download URL: codespector-0.1.1.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360861b75502e7ae8fb7b604d2370fece973c04d7071bc320d62112ace1bb212
|
|
| MD5 |
779cc4ae38022e99a7cd3ea115157627
|
|
| BLAKE2b-256 |
23cd8f7d4180e0d9d845ef4df63a368986404ef15e4bcecf45a56a59315a3103
|
Provenance
The following attestation bundles were made for codespector-0.1.1.tar.gz:
Publisher:
build-publish.yml on Vladimir-Titov/codespector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codespector-0.1.1.tar.gz -
Subject digest:
360861b75502e7ae8fb7b604d2370fece973c04d7071bc320d62112ace1bb212 - Sigstore transparency entry: 186507084
- Sigstore integration time:
-
Permalink:
Vladimir-Titov/codespector@b48d9216ba820852257ae4dadce6a1d50f7887a5 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Vladimir-Titov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-publish.yml@b48d9216ba820852257ae4dadce6a1d50f7887a5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codespector-0.1.1-py3-none-any.whl.
File metadata
- Download URL: codespector-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4669e2e11e980a8986f034afc3a9abe42151fe59ffab02eac9d3e8e2dcee0734
|
|
| MD5 |
5797f54057db3061e9bbc12b4d869708
|
|
| BLAKE2b-256 |
6016a596ca69cd7601170c665594ef3fd49a56d5dba152fa29e709050c2c0026
|
Provenance
The following attestation bundles were made for codespector-0.1.1-py3-none-any.whl:
Publisher:
build-publish.yml on Vladimir-Titov/codespector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codespector-0.1.1-py3-none-any.whl -
Subject digest:
4669e2e11e980a8986f034afc3a9abe42151fe59ffab02eac9d3e8e2dcee0734 - Sigstore transparency entry: 186507085
- Sigstore integration time:
-
Permalink:
Vladimir-Titov/codespector@b48d9216ba820852257ae4dadce6a1d50f7887a5 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Vladimir-Titov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-publish.yml@b48d9216ba820852257ae4dadce6a1d50f7887a5 -
Trigger Event:
release
-
Statement type: