Skip to main content

Code wiki platform with AST graph analysis, GraphRAG, SQLite/PostgreSQL storage, and LiteLLM.

Project description

CodeWiki

English  ·  简体中文  ·  Usage Guide  ·  Design  ·  Benchmarks  ·  Changelog

Tests License PyPI downloads GitHub stars

CodeWiki is a single-user code intelligence platform for AST-based repository analysis, GraphRAG retrieval, source-grounded wiki generation, and LiteLLM-powered Q&A.

Screenshots

CodeWiki wiki page

CodeWiki graph explorer

Highlights

  • Analyze Python, TypeScript/TSX, JavaScript/JSX, Java, Go, Rust, C, C++, and C#.
  • Build deterministic code graphs for imports, definitions, calls, routes, inheritance, source references, and configuration usage.
  • Generate DeepWiki-style catalogs and pages with source citations, diagrams, translations, incremental updates, and browser-side exports.
  • Ask GraphRAG-grounded questions through the Web UI, CLI, HTTP API, or MCP server.
  • Use Lite Mode for a project-local, no-LLM graph index optimized for AI agent context, traces, impact analysis, and MCP tools.
  • Use SQLite by default, or PostgreSQL with full-text search and optional pgvector vector search.

Quick Start

Install from PyPI:

pip install codewiki
codewiki serve

Open http://127.0.0.1:8000, register a repository, run analysis, then generate a wiki or ask questions.

Run with Docker Compose:

docker compose up --build

The packaged Python app includes the built frontend. A source checkout is only needed for development or Docker-based local runs.

Common Commands

codewiki repos add . --name my-repo
codewiki analyze .
codewiki graphrag build . --embeddings
codewiki wiki catalog .
codewiki wiki pages .
codewiki ask --repo my-repo "How does the main workflow fit together?"
codewiki mcp

Most repository arguments accept an id, id prefix, registered name, path, or Git URL. Use --json for machine-readable output.

Lite Mode

Lite Mode creates a project-local .codewiki/codewiki-lite.sqlite3 index and skips LLM, Wiki, GraphRAG chunk, and Web UI workflows. It is intended for local AI assistants that need fast symbol search, source context, call traces, and affected-file analysis.

codewiki lite index .
codewiki lite query AuthService
codewiki lite context "how authentication works"
codewiki lite trace LoginForm createSession
codewiki lite callers generate_page
codewiki lite affected src/auth.py
codewiki lite agents install . --target all
codewiki mcp --lite --path .

codewiki lite status reports pending file changes. codewiki lite sync refreshes the index, and codewiki lite watch keeps it fresh with a polling watcher. MCP Lite Mode catches up an existing index on startup unless --no-sync is passed. codewiki lite agents install can write Codex CLI and Claude Code MCP config plus agent instructions for the project.

Configuration

CodeWiki defaults to SQLite:

CODEWIKI_DATABASE_URL=sqlite+aiosqlite:///./data/codewiki.sqlite3

PostgreSQL is also supported:

CODEWIKI_DATABASE_URL=postgresql+psycopg://codewiki:codewiki@localhost:5432/codewiki

Configure LLM profiles with codewiki config or .env:

codewiki config
codewiki config --set CODEWIKI_LLM__DEFAULT__MODEL=openai/gpt-4.1
codewiki config --profile qa --model openai/gpt-4.1 --api-key "$OPENAI_API_KEY"

Documentation

Development

make install
make start
make lint
make typecheck
make test
make build

Default local URLs:

  • Backend: http://127.0.0.1:8000
  • Frontend: http://127.0.0.1:5173

Python Typing

Python type checking uses mypy with a gradual configuration in pyproject.toml. New public service, repository, API helper, and CLI helper functions should include explicit parameter and return types. Prefer dataclasses, Pydantic models, TypedDict, or Protocol over broad dict[str, Any] when data crosses module boundaries. Keep Any near integration edges such as LLM JSON payloads, SQLAlchemy JSON columns, and third-party parser output.

License

MIT

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

codewiki-0.6.3.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

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

codewiki-0.6.3-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file codewiki-0.6.3.tar.gz.

File metadata

  • Download URL: codewiki-0.6.3.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codewiki-0.6.3.tar.gz
Algorithm Hash digest
SHA256 fc29d201097492133cdcde6cb613ae224cbacb9a56b1c204ed3e88979394bf76
MD5 20280249f7adf6f04110d8b1b62d1e71
BLAKE2b-256 afbbf9bb87d57357bbbb20ada0544ad20ddd487bf4cdb71ce15567b31b582f6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for codewiki-0.6.3.tar.gz:

Publisher: publish-pypi.yml on PorunC/CodeWiki

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

File details

Details for the file codewiki-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: codewiki-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codewiki-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cff9e37c27168d03b06a3cfdd997c1f0bb7ff4f632c8ce6f815de3206b3d782e
MD5 ab44c106503c24d006533ed2dbdb3bc7
BLAKE2b-256 ca9e8e83b2bf72acc5e903ca1bc2b03db46fe35777ec49fb4b5e87133a3c0aeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for codewiki-0.6.3-py3-none-any.whl:

Publisher: publish-pypi.yml on PorunC/CodeWiki

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