Agent IA d'audit technique de projets — analyse le code source et génère un rapport structuré en Markdown et PDF.
Project description
CodePulse
Agent IA d'audit technique de projets informatiques. Analyse le code source, l'architecture, les dépendances et la configuration d'un projet, puis génère un rapport structuré en Markdown et PDF.
Fonctionnalités
- Commande
auditinstallable dans le terminal (CMD, PowerShell, bash) - Analyse via Google Gemini 2.5 Flash
- Rapport structuré en 11 blocs couvrant 8 piliers d'analyse
- Génération automatique d'un rapport PDF stylisé (couleurs, badges de risque, mise en page professionnelle)
- Ingestion intelligente : priorité aux fichiers critiques, troncature automatique, budget de tokens maîtrisé
- Exclusion automatique des fichiers sensibles (
.env,node_modules,__pycache__, venvs…) - Streaming : affichage du rapport en temps réel pendant la génération
- Interface web optionnelle (Streamlit) pour les non-développeurs
- Compatible Streamlit Cloud et Render : clé API configurable via variables d'environnement
Piliers analysés
| # | Pilier |
|---|---|
| 1 | Architecture & Qualité du code |
| 2 | Tests & Qualité Assurance |
| 3 | Sécurité & Robustesse (OWASP Top 10) |
| 4 | DevOps & Infrastructure |
| 5 | Performance & Scalabilité |
| 6 | Dépendances & Licences |
| 7 | Conformité & Réglementation (RGPD, WCAG) |
| 8 | Documentation & Expérience Développeur |
Installation en ligne de commande
Prérequis
- Python 3.12+
- Une clé API Google Gemini — obtenir une clé
Étapes
git clone <url-du-repo>
cd audit-project-agent
python -m venv codeaudit-env
codeaudit-env\Scripts\activate # Windows CMD / PowerShell
# source codeaudit-env/bin/activate # Linux / macOS
pip install -e .
Configurer la clé API (une seule fois)
# Windows CMD
echo GEMINI_API_KEY=votre_cle_api_ici >> %USERPROFILE%\.env
# Windows PowerShell
Add-Content "$env:USERPROFILE\.env" "GEMINI_API_KEY=votre_cle_api_ici"
# Linux / macOS
echo "GEMINI_API_KEY=votre_cle_api_ici" >> ~/.env
Utilisation
# Auditer un projet
audit /chemin/vers/mon-projet
# Auditer le dossier courant
audit .
# Afficher le rapport en temps réel
audit /chemin/vers/mon-projet --stream
Les rapports .md et .pdf sont générés à la racine du projet audité.
Interface web (optionnelle)
Pour les utilisateurs non-développeurs, une interface Streamlit est disponible.
Déploiement sur Render
- Poussez le dépôt sur GitHub
- Sur render.com → New → Web Service → connecter le repo
- Runtime : Docker (Render détecte automatiquement le
Dockerfile) - Dans Environment → Environment Variables, ajouter :
| Key | Value |
|---|---|
GEMINI_API_KEY |
votre clé API Gemini |
- Cliquer Create Web Service — Render construit l'image et expose l'URL publique.
Déploiement sur Streamlit Cloud
- Forkez / poussez ce dépôt sur GitHub
- Connectez-le à share.streamlit.io
- Dans Settings → Secrets, ajoutez :
GEMINI_API_KEY = "votre_cle_api_ici"
Docker (local)
DOCKER_BUILDKIT=1 docker build -t codeaudit .
docker run -p 8501:8501 -e GEMINI_API_KEY=votre_cle_api codeaudit
Structure du projet
audit-project-agent/
├── main.py # CLI — commande `audit`
├── app.py # Interface web Streamlit (optionnelle)
├── pyproject.toml # Packaging — rend `audit` installable
├── Dockerfile # Image production (python:3.12-slim, non-root, healthcheck)
├── .dockerignore
├── components/
│ └── folder_picker/ # Composant sélection de dossier (File System Access API)
│ └── index.html
├── config/
│ └── settings.py # Configuration : .env (CWD) → .env (~) → env vars
├── core/
│ ├── ingestion.py # Chargement et priorisation des fichiers du projet
│ └── prompts.py # Génération du prompt d'audit (11 blocs)
├── services/
│ ├── gemini_client.py # Client Gemini avec retry et streaming
│ └── pdf_generator.py # Génération PDF via ReportLab
├── requirements.txt
├── .env # Secrets — NE PAS COMMITTER
├── .env.example # Modèle de configuration
├── .gitignore
├── README.md
└── CHANGELOG.md
Variables d'environnement
| Variable | Défaut | Description |
|---|---|---|
GEMINI_API_KEY |
(obligatoire) | Clé API Google Gemini |
MODEL_NAME |
gemini-2.5-flash |
Modèle Gemini à utiliser |
TEMPERATURE |
0.1 |
Créativité du modèle (0 = déterministe) |
MAX_OUTPUT_TOKENS |
65536 |
Budget de tokens pour la réponse |
La lecture suit la priorité : .env (dossier courant) → ~/.env (home) → variables d'environnement système → st.secrets (Streamlit Cloud).
Licence
Usage personnel et professionnel. Ne pas partager la clé API.
Project details
Release history Release notifications | RSS feed
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 agent_audit_ai-1.0.0.tar.gz.
File metadata
- Download URL: agent_audit_ai-1.0.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e605834ff411684369cb7017bfa2caa913e590bfbebe88f6c57b386e91e87d90
|
|
| MD5 |
b7bd888d12495797b8e4f91d347b17de
|
|
| BLAKE2b-256 |
4056a4a2175983c0c33bac35c4bdf3e6954d5ee940cb3aa05c16411994b41b27
|
Provenance
The following attestation bundles were made for agent_audit_ai-1.0.0.tar.gz:
Publisher:
publish.yml on DIOMANDE-CODE/agent_ai_audit_projet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_audit_ai-1.0.0.tar.gz -
Subject digest:
e605834ff411684369cb7017bfa2caa913e590bfbebe88f6c57b386e91e87d90 - Sigstore transparency entry: 1926768432
- Sigstore integration time:
-
Permalink:
DIOMANDE-CODE/agent_ai_audit_projet@7f3c00dba25a0491dc1d536408c9dc8d65d37dec -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/DIOMANDE-CODE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f3c00dba25a0491dc1d536408c9dc8d65d37dec -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_audit_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: agent_audit_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f6e9d9a16d1b58126e7152cc6f335614fbefb660b417b65a74af60c573595e7
|
|
| MD5 |
f5ac263a9fe4de0ce4ac494698804dac
|
|
| BLAKE2b-256 |
2a5b68f7d72a8e9af748ef6df489ac5133c496eabeb60ea4fed0d22eb34945e2
|
Provenance
The following attestation bundles were made for agent_audit_ai-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on DIOMANDE-CODE/agent_ai_audit_projet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_audit_ai-1.0.0-py3-none-any.whl -
Subject digest:
7f6e9d9a16d1b58126e7152cc6f335614fbefb660b417b65a74af60c573595e7 - Sigstore transparency entry: 1926768610
- Sigstore integration time:
-
Permalink:
DIOMANDE-CODE/agent_ai_audit_projet@7f3c00dba25a0491dc1d536408c9dc8d65d37dec -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/DIOMANDE-CODE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f3c00dba25a0491dc1d536408c9dc8d65d37dec -
Trigger Event:
release
-
Statement type: