GenCodeDoc

Intelligent code versioning (snapshots) and automatic documentation generator. With CLI, REST API, and MCP support.

๐Ÿš€ GenCodeDoc

Smart documentation generator and intelligent versioning system with full MCP support

Python 3.10+ Poetry MCP Compatible License: MIT AI Ready

Intelligent versioning and documentation for modern development workflows

Quick Start โ€ข Features โ€ข MCP Tools โ€ข Documentation


โšก Quick Start

# 1. Install
cd /path/to/gencodedoc
poetry install

# 2. Initialize your project
poetry run gencodedoc init --preset python

# 3. Create your first snapshot
poetry run gencodedoc snapshot create -m "Initial version" -t v1.0

# 4. Generate documentation (Smart Split)
poetry run gencodedoc doc generate --limit 5000

# 5. Visualize Tree
poetry run gencodedoc tree

๐ŸŽฏ For AI Assistants (Claude/Gemini): See MCP Integration

โœจ Features ๐ŸŽฏ Core Features ๐Ÿ“ธ Smart Snapshots - Create intelligent snapshots with ~70% space savings via SHA256 deduplication ๐Ÿ”„ Intelligent Autosave - 3 modes (timer/diff/hybrid) with configurable thresholds ๐Ÿ“ Beautiful Documentation - Generate Markdown docs with syntax highlighting, directory trees, and smart splitting ๐Ÿ” Advanced Diff - Compare versions with unified, JSON, or AST-based diffs ๐Ÿ—œ๏ธ Efficient Storage - zstd compression (~3x reduction) + SQLite with optimized indexes ๐ŸŽจ Project Presets - Pre-configured for Python, Node.js, Go, and Web projects ๐Ÿ”Œ MCP Integration (Model Context Protocol) 26 MCP Tools - Full CLI functionality exposed via MCP for AI Assistants 3 Transports - stdio (Gemini CLI) + SSE (Claude Desktop) + REST API Multi-Project - Manage multiple projects simultaneously Code Intelligence - File history, search, and changelog generation Live Status - Real-time project statistics and snapshot management ๐Ÿ“ฆ Installation Prerequisites Python 3.10+ Poetry (dependency manager) Install Poetry Bash

Linux/macOS

curl -sSL https://install.python-poetry.org | python3 -

Windows (PowerShell)

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - Install GenCodeDoc Bash

Clone or navigate to the project

cd /home/fkomp/Bureau/oracle/utilitaires/gencodedoc/gencodedoc

Install dependencies

poetry install

Verify installation

poetry run gencodedoc --help ๐ŸŽฏ Usage ๐Ÿ“‹ CLI Usage Initialize a Project Bash

Basic initialization

gencodedoc init

With Python preset (recommended for Oracle projects)

gencodedoc init --preset python

Available presets: python, nodejs, go, web

Snapshot Management Bash

Create snapshot

gencodedoc snapshot create --message "Feature X completed" --tag v1.0

List snapshots

gencodedoc snapshot list --limit 10

Show snapshot details

gencodedoc snapshot show v1.0

View file content at specific version (NEW)

gencodedoc snapshot cat v1.0 src/main.py

List files in a snapshot (NEW)

gencodedoc snapshot files v1.0 --pattern "*.py"

Compare versions

gencodedoc snapshot diff v1.0 v2.0

Restore snapshot (full or partial)

gencodedoc snapshot restore v1.0 --force gencodedoc snapshot restore v1.0 --filter "src/*.py" # Partial restore

Export snapshot (NEW)

gencodedoc snapshot export v1.0 ./dist-v1 --archive # Creates .tar.gz

Delete snapshot

gencodedoc snapshot delete old-version --force

Cleanup orphaned data (NEW)

gencodedoc snapshot cleanup Documentation Generation Bash

Full documentation

gencodedoc doc generate

Custom output

gencodedoc doc generate --output docs/API.md

Specific paths only

gencodedoc doc generate --include src/api/ --include README.md

Structure preview

gencodedoc doc preview --max-depth 3

Project statistics

gencodedoc doc stats Configuration Bash

View configuration

gencodedoc config show

Edit configuration

gencodedoc config edit

Set specific values

gencodedoc config set autosave.enabled true gencodedoc config set autosave.mode hybrid

Apply preset

gencodedoc config preset python

Manage ignore rules

gencodedoc config ignore --add-dir dist gencodedoc config ignore --add-ext .tmp gencodedoc config ignore --list-all

Customizable Presets

Presets are now defined in YAML files (gencodedoc/config/presets/*.yaml)

and can be modified directly in the source code.

Project Status Bash

Show project status

gencodedoc status ๐Ÿ”Œ MCP Integration GenCodeDoc exposes 22 powerful tools via the Model Context Protocol, compatible with Claude Desktop, Gemini CLI, and any MCP-compatible client.

๐ŸŽฏ Transport Modes Transport Use Case AI Assistants Port stdio CLI integration Gemini CLI, custom scripts stdin/stdout SSE Web/Desktop apps Claude Desktop, web UIs 8000 (HTTP) REST API integration Any HTTP client 8000 (HTTP) ๐Ÿš€ Setup for Gemini CLI (stdio)

  1. Find your Poetry venv path:

Bash

cd /home/fkomp/Bureau/oracle/utilitaires/gencodedoc/gencodedoc poetry env info --path

Copy the path and append /bin/python

  1. Add to ~/.config/gemini-desktop-app/settings.json:

JSON

{ "mcpServers": { "gencodedoc": { "command": "/path/to/your/venv/bin/python", "args": ["-m", "gencodedoc.mcp.server_stdio"], "env": { "PROJECT_PATH": "/home/fkomp/Bureau/oracle/utilitaires/gencodedoc/gencodedoc" } } } } 3. Restart Gemini CLI and you`re ready! ๐ŸŽ‰

๐Ÿš€ Setup for Claude Desktop (SSE)

  1. Start the SSE server:

Bash

Terminal 1: Start server

poetry run python -m gencodedoc.mcp.server_sse

Server runs on http://127.0.0.1:8000

  1. Add to Claude Desktop config:

Location:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json Config:

JSON

{ "mcpServers": { "gencodedoc": { "url": "http://127.0.0.1:8000/mcp/sse", "transport": "sse", "description": "GenCodeDoc - Smart documentation and versioning" } } } 3. Restart Claude Desktop and the server must remain running!

๐Ÿš€ REST API Bash

Start REST server

poetry run python -m gencodedoc.mcp.server

Available endpoints

GET http://127.0.0.1:8000/ # Server info GET http://127.0.0.1:8000/mcp/tools # List tools POST http://127.0.0.1:8000/mcp/execute # Execute tool ๐Ÿ› ๏ธ MCP Tools (26 Tools)

๐Ÿง  Code Intelligence (3 tools)

ToolDescriptionKey Parameters
get_file_historyTrack file changes across versionsfile_path
search_snapshotsSearch text in all snapshotsquery, case_sensitive, file_filter
generate_changelogGenerate Keep-a-Changelogfrom_ref, to_ref

๐Ÿ“ธ Snapshot Management (11 tools)

ToolDescriptionKey Parameters
create_snapshotCreate a new snapshotmessage, tag, include_paths
list_snapshotsList all snapshotslimit, include_autosave
get_snapshot_detailsGet full snapshot infosnapshot_ref
restore_snapshotRestore a snapshot (full or partial)snapshot_ref, force, file_filters
restore_filesRestore specific filessnapshot_ref, file_filters
delete_snapshotDelete a snapshotsnapshot_ref
diff_versionsCompare two versionsfrom_ref, to_ref, format, file_filters
get_file_at_versionGet content of a single filesnapshot_ref, file_path
list_files_at_versionList files in a snapshotsnapshot_ref, pattern
export_snapshotExport snapshot to folder/archivesnapshot_ref, output_path, archive
cleanup_orphaned_contentsCleanup unused datanone

๐Ÿ“ Documentation (3 tools)

ToolDescriptionKey Parameters
generate_documentationGenerate Markdown docsoutput_path, split_limit, ignore_tree_patterns
preview_structureShow directory treemax_depth, ignore_add, limit, page
get_project_statsGet project statisticsnone

๐ŸŽฏ Project Management (2 tools)

ToolDescriptionKey Parameters
init_projectInitialize gencodedocproject_path, preset
get_project_statusGet project statusproject_path

โš™๏ธ Configuration (4 tools)

ToolDescriptionKey Parameters
get_configView configurationproject_path
set_config_valueModify config valuekey, value
apply_presetApply preset configpreset (python/nodejs/go/web)
manage_ignore_rulesManage ignore rulesadd_dir, add_file, add_ext, list_all

๐Ÿ”„ Autosave (3 tools)

ToolDescriptionKey Parameters
start_autosaveStart automatic versioningproject_path, mode
stop_autosaveStop automatic versioningproject_path
get_autosave_statusGet status of all autosavesnone

๐Ÿค Contributing Contributions welcome! ๐ŸŽ‰

๐Ÿ› Report bugs via GitHub Issues ๐Ÿ’ก Suggest features via Discussions ๐Ÿ”ง Submit Pull Requests

Development workflow:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Make your changes
  4. Run tests (make test)
  5. Submit PR

๐Ÿ“„ License MIT License - See LICENSE file

๐Ÿ› Issues: GitHub Issues ๐Ÿ’ฌ Discussions: GitHub Discussions ๐ŸŒ Website: esprit-artificiel.com ๐Ÿ“ง Email: support@esprit-artificiel.com

๐Ÿ’ก Pro Tip: Use GenCodeDoc with Gemini CLI or Claude Desktop for AI-powered version control!

โญ Star this repo if you find it useful!

๐Ÿค– "Stop all autosaves and show me their status" โ†’ Calls: stop_autosave(...) + get_autosave_status() โš™๏ธ Configuration Configuration File (.gencodedoc.yaml) YAML

project_name: "my-project"

Files/directories to ignore

ignore: dirs: - node_modules - venv - .venv - pycache - .git - dist - build files: - "*.log" - package-lock.json - .DS_Store extensions: - .pyc - .pyo - .exe - .jpg - .png - .pdf patterns: [] # gitignore-style patterns

Intelligent autosave

autosave: enabled: false # Set to true to enable mode: hybrid # timer | diff | hybrid (recommended)

Timer mode: fixed interval

timer: interval: 300 # seconds (5 minutes)

Diff mode: threshold-based

diff_threshold: threshold: 0.05 # Save if 5% of files changed check_interval: 60 # Check every 60 seconds ignore_whitespace: true ignore_comments: false

Hybrid mode: combines timer + diff (RECOMMENDED)

hybrid: min_interval: 180 # Minimum 3 minutes between saves max_interval: 600 # Maximum 10 minutes between saves threshold: 0.03 # Save if 3% of files changed

Retention policy

retention: max_autosaves: 50 # Keep max 50 autosaves compress_after_days: 7 # Compress after 7 days delete_after_days: 30 # Delete after 30 days keep_manual: true # Always keep manual snapshots

Documentation output

output: default_name: "{project}doc{date}.md" include_tree: true include_code: true tree_full_code_select: false # Full tree, selected code only language_detection: true max_file_size: 1000000 # 1 MB max per file

Diff output format

diff_format: default: unified # unified | json | ast unified_context: 3 json_include_content: true ast_enabled: false # Experimental

Storage

storage_path: .gencodedoc compression_enabled: true compression_level: 3 # 1-22 (3 = good balance) Quick Config Commands Bash

Enable autosave

gencodedoc config set autosave.enabled true gencodedoc config set autosave.mode hybrid

Adjust autosave thresholds

gencodedoc config set autosave.hybrid.min_interval 300 gencodedoc config set autosave.hybrid.max_interval 1800 gencodedoc config set autosave.hybrid.threshold 0.03

Add ignore rules

gencodedoc config ignore --add-dir dist gencodedoc config ignore --add-ext .tmp gencodedoc config ignore --add-file debug.log ๐Ÿ—๏ธ Architecture text

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ GenCodeDoc System โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ CLI (Typer) โ”‚ โ”‚ MCP stdio โ”‚ โ”‚ MCP SSE/REST โ”‚ โ”‚ โ”‚ โ”‚ (Gemini CLI) โ”‚ โ”‚ (Claude/Web) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Core Managers โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ€ข ConfigManager โ”‚ โ”‚ โ€ข VersionManager โ”‚ โ”‚ โ€ข DocGenerator โ”‚ โ”‚ โ€ข AutosaveManager โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Scanner โ”‚ โ”‚ Differ โ”‚ โ”‚ Storage โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Scan โ”‚ โ”‚ โ€ข Unified โ”‚ โ”‚ โ€ข SQLite โ”‚ โ”‚ โ€ข Filter โ”‚ โ”‚ โ€ข JSON โ”‚ โ”‚ โ€ข zstd โ”‚ โ”‚ โ€ข Detect โ”‚ โ”‚ โ€ข AST โ”‚ โ”‚ โ€ข Dedup โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Storage Layer โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ .gencodedoc/ โ”‚ โ”‚ โ”œโ”€โ”€ gencodedoc.db โ† SQLite (metadata) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ snapshots โ† Snapshot records โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ snapshot_files โ† File entries โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ file_contents โ† Deduplicated content (SHA256) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ autosave_state โ† Autosave status โ”‚ โ”‚ โ””โ”€โ”€ config/ โ† Configuration files โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Features: โ€ข ๐Ÿ”‘ SHA256 deduplication โ†’ ~70% space savings โ€ข ๐Ÿ—œ๏ธ zstd compression โ†’ ~3x size reduction โ€ข ๐Ÿ“Š Indexed SQLite โ†’ Fast queries โ€ข ๐Ÿ”„ Watchdog observer โ†’ Real-time file monitoring Project Structure text

gencodedoc/ โ”œโ”€โ”€ gencodedoc/ # Source code โ”‚ โ”œโ”€โ”€ cli/ # CLI commands (Typer) โ”‚ โ”‚ โ”œโ”€โ”€ main.py # Entry point โ”‚ โ”‚ โ”œโ”€โ”€ snapshot_cmd.py โ”‚ โ”‚ โ”œโ”€โ”€ doc_cmd.py โ”‚ โ”‚ โ”œโ”€โ”€ config_cmd.py โ”‚ โ”‚ โ””โ”€โ”€ mcp_cmd.py โ”‚ โ”œโ”€โ”€ core/ # Business logic โ”‚ โ”‚ โ”œโ”€โ”€ config.py # Configuration management โ”‚ โ”‚ โ”œโ”€โ”€ scanner.py # File scanning & filtering โ”‚ โ”‚ โ”œโ”€โ”€ versioning.py # Snapshot management โ”‚ โ”‚ โ”œโ”€โ”€ documentation.py โ”‚ โ”‚ โ”œโ”€โ”€ differ.py # Version comparison โ”‚ โ”‚ โ””โ”€โ”€ autosave.py # Intelligent autosave โ”‚ โ”œโ”€โ”€ mcp/ # MCP servers โ”‚ โ”‚ โ”œโ”€โ”€ server_stdio.py # stdio transport โ”‚ โ”‚ โ”œโ”€โ”€ server_sse.py # SSE transport โ”‚ โ”‚ โ”œโ”€โ”€ server.py # REST transport โ”‚ โ”‚ โ””โ”€โ”€ tools.py # Tool definitions โ”‚ โ”œโ”€โ”€ models/ # Data models (Pydantic) โ”‚ โ”‚ โ”œโ”€โ”€ config.py โ”‚ โ”‚ โ””โ”€โ”€ snapshot.py โ”‚ โ”œโ”€โ”€ storage/ # Storage & compression โ”‚ โ”‚ โ”œโ”€โ”€ database.py # SQLite manager โ”‚ โ”‚ โ”œโ”€โ”€ snapshot_store.py โ”‚ โ”‚ โ””โ”€โ”€ compression.py # zstd compression โ”‚ โ””โ”€โ”€ utils/ # Utilities โ”‚ โ”œโ”€โ”€ filters.py โ”‚ โ”œโ”€โ”€ formatters.py โ”‚ โ””โ”€โ”€ tree.py โ”œโ”€โ”€ config/ # Configuration presets โ”‚ โ””โ”€โ”€ presets/ โ”‚ โ”œโ”€โ”€ python.yaml โ”‚ โ”œโ”€โ”€ nodejs.yaml โ”‚ โ”œโ”€โ”€ go.yaml โ”‚ โ””โ”€โ”€ web.yaml โ”œโ”€โ”€ tests/ # Unit tests โ”œโ”€โ”€ pyproject.toml # Poetry config โ”œโ”€โ”€ Makefile # Dev commands โ””โ”€โ”€ README.md ๐Ÿ”ฌ Advanced Features ๐ŸŽฏ Intelligent Deduplication (~70% savings) GenCodeDoc uses SHA256-based deduplication:

โœ… Identical files across snapshots are stored once โœ… Massive space savings (~70% on real projects) โœ… zstd compression for ~3x additional reduction โœ… Optimized SQLite with indexes

Example: 10 snapshots of a 100 MB project

Without deduplication: 1 GB With GenCodeDoc: ~300 MB (dedup + compression) ๐Ÿ”„ Autosave Modes Mode How it works Best for timer Save every X seconds Continuous development diff Save when X% changed Critical projects hybrid โญ Min/max interval + threshold General use (recommended) Hybrid mode example:

YAML

hybrid: min_interval: 300 # Don`t save more often than 5 min max_interval: 1800 # Force save after 30 min threshold: 0.03 # OR if 3% of files changed ๐Ÿ“Š Diff Formats Format Description Use Case unified Git-style diff Human reading json Structured data Automation ast Semantic diff Code analysis (experimental) Bash

Unified diff (default)

gencodedoc snapshot diff v1.0 v2.0

JSON for scripts

gencodedoc snapshot diff v1.0 v2.0 --format json > changes.json

AST (semantic)

gencodedoc snapshot diff v1.0 v2.0 --format ast ๐Ÿ› Troubleshooting Common Issues 1๏ธโƒฃ MCP Error: notifications/initialized Symptom: Error on MCP startup:

text

MCP ERROR: Unknown method: notifications/initialized Cause: MCP protocol sends notifications that older versions didn`t handle.

Solution: โœ… Already fixed in current version. The server now silently ignores MCP notifications.

2๏ธโƒฃ Snapshots created in wrong location Symptom: All snapshots go to gencodedoc`s own directory instead of target project.

Cause: project_path not properly extracted from MCP tools/call parameters.

Solution: โœ… Already fixed. The server now correctly extracts project_path from arguments.

Verify fix:

Bash

This should create snapshot in /path/to/project, not gencodedoc

/gencodedoc create_snapshot project_path=/path/to/project tag=test 3๏ธโƒฃ Zod validation errors (id=null) Symptom:

text

Error: Expected string or number, received null (path: ["id"]) Cause: JSON-RPC responses with "id": null instead of "id": 0.

Solution: โœ… Already fixed. All error responses now use request_id or 0.

4๏ธโƒฃ Files not properly scanned Symptom: Snapshot shows wrong number of files or files from wrong directory.

Cause: snapshot_store.py used relative paths instead of absolute.

Solution: โœ… Already fixed. SnapshotStore now receives and uses project_path for absolute file paths.

5๏ธโƒฃ DB not initialized Symptom:

text

Error: no such table: snapshots Cause: Project not initialized before creating snapshot.

Solution:

Bash

Always init first (creates tables)

gencodedoc init --preset python

Or via MCP

/gencodedoc init_project project_path=/path/to/project preset=python 6๏ธโƒฃ Autosave not starting Symptom: start_autosave tool doesn`t work.

Cause: Autosave requires the MCP server to remain running (it`s a background process).

Solution:

stdio mode: Server runs per-request โ†’ autosave stops when request ends SSE/REST mode: โœ… Server persistent โ†’ autosave works! Recommended: Use SSE/REST for autosave, stdio for one-off commands.

Debug Mode Bash

Enable verbose logging (if implemented)

export GENCODEDOC_DEBUG=1 poetry run gencodedoc snapshot create --message "test"

Check SQLite DB directly

sqlite3 /path/to/project/.gencodedoc/gencodedoc.db ".tables" sqlite3 /path/to/project/.gencodedoc/gencodedoc.db "SELECT * FROM snapshots;" ๐Ÿงช Testing Bash

Run all tests

poetry run pytest

With coverage

poetry run pytest --cov=gencodedoc --cov-report=html

Specific tests

poetry run pytest tests/test_scanner.py -v poetry run pytest tests/test_versioning.py -v poetry run pytest tests/test_mcp.py -v

Watch mode (requires pytest-watch)

poetry run ptw ๐Ÿ› ๏ธ Development Setup Development Environment Bash

Install with dev dependencies

poetry install

Activate virtual environment

poetry shell

Install pre-commit hooks (if configured)

pre-commit install Makefile Commands Bash

make help # Show all commands make install # Install dependencies make test # Run tests make test-cov # Tests with coverage make lint # Check code quality make format # Format code (Black) make clean # Remove temporary files make docs # Generate documentation make serve-mcp-sse # Start SSE server make serve-mcp-stdio # Start stdio server make all # Lint + test + build Code Style Formatter: Black (line length 100) Linter: Ruff Type hints: Enforced with Pydantic Docstrings: Google style ๐ŸŽฏ Use Cases 1๏ธโƒฃ Continuous Documentation Bash

Initialize with autosave

gencodedoc init --preset python gencodedoc config set autosave.enabled true gencodedoc config set autosave.mode hybrid

Documentation is always up-to-date

gencodedoc doc generate --output docs/API.md 2๏ธโƒฃ Safe Refactoring Bash

Snapshot before critical changes

gencodedoc snapshot create
--message "Before refactoring authentication system"
--tag before-refactor

... make changes ...

Snapshot after

gencodedoc snapshot create
--message "After refactoring - tests passing"
--tag after-refactor

Compare

gencodedoc snapshot diff before-refactor after-refactor

Rollback if needed

gencodedoc snapshot restore before-refactor --force 3๏ธโƒฃ Selective API Documentation Bash

Document only specific modules

gencodedoc doc generate
--include src/api/
--include src/models/
--include README.md
--output docs/API_Reference.md 4๏ธโƒฃ AI-Assisted Workflow (Gemini/Claude) Bash

1. Configure MCP (once)

Add gencodedoc to your AI assistant config

2. Use natural language

"Create a snapshot with tag v2.0" "Compare v1.0 and v2.0" "Show me project statistics" "Start autosave in hybrid mode" "Generate complete documentation"

AI automatically calls the right MCP tools! ๐ŸŽ‰

๐ŸŒŸ Roadmap Git integration (auto-snapshot on commit) Cloud backup (S3, GCS) Web UI dashboard AST-based semantic diff (full implementation) Multi-language presets (Rust, Java, C++) Snapshot encryption Collaborative features (shared snapshots) ๐Ÿ“„ License MIT License - See LICENSE file

๐Ÿค Contributing Contributions welcome! ๐ŸŽ‰

๐Ÿ› Report bugs via GitHub Issues ๐Ÿ’ก Suggest features via Discussions ๐Ÿ”ง Submit Pull Requests Development workflow:

Fork the repo Create a feature branch (git checkout -b feature/amazing) Make your changes Run tests (make test) Submit PR ๐Ÿ“ž Support ๐Ÿ› Issues: GitHub Issues ๐Ÿ’ฌ Discussions: GitHub Discussions ๐ŸŒ Website: esprit-artificiel.com ๐Ÿ“ง Email: support@esprit-artificiel.com ๐Ÿ™ Acknowledgments Built with these amazing tools:

FastAPI - MCP server framework Pydantic - Data validation Typer - CLI framework Rich - Terminal formatting zstandard - Compression Watchdog - File monitoring SQLite - Embedded database

๐Ÿ’ก Pro Tip: Use GenCodeDoc with Gemini CLI or Claude Desktop for AI-powered version control!

โญ Star this repo if you find it useful!

Related Servers