Skip to main content

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 audit installable 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

É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

  1. Poussez le dépôt sur GitHub
  2. Sur render.comNew → Web Service → connecter le repo
  3. Runtime : Docker (Render détecte automatiquement le Dockerfile)
  4. Dans Environment → Environment Variables, ajouter :
Key Value
GEMINI_API_KEY votre clé API Gemini
  1. Cliquer Create Web Service — Render construit l'image et expose l'URL publique.

Déploiement sur Streamlit Cloud

  1. Forkez / poussez ce dépôt sur GitHub
  2. Connectez-le à share.streamlit.io
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_audit_ai-1.0.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_audit_ai-1.0.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

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

Hashes for agent_audit_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e605834ff411684369cb7017bfa2caa913e590bfbebe88f6c57b386e91e87d90
MD5 b7bd888d12495797b8e4f91d347b17de
BLAKE2b-256 4056a4a2175983c0c33bac35c4bdf3e6954d5ee940cb3aa05c16411994b41b27

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for agent_audit_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f6e9d9a16d1b58126e7152cc6f335614fbefb660b417b65a74af60c573595e7
MD5 f5ac263a9fe4de0ce4ac494698804dac
BLAKE2b-256 2a5b68f7d72a8e9af748ef6df489ac5133c496eabeb60ea4fed0d22eb34945e2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page