This guide covers running CodeWiki's CLI and web application directly from source for development.
git clone https://github.com/flamingo-stack/CodeWiki.git
cd CodeWiki
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe CLI can be invoked as a Python module without installing a package, via the codewiki/__main__.py entry point:
# Show CLI help
python -m codewiki --help
# Show version
python -m codewiki version
# Configure LLM providers
python -m codewiki config set --main-api-key "..." --main-model "claude-sonnet-4" \
--cluster-api-key "..." --cluster-model "claude-sonnet-4" \
--fallback-api-key "..." --fallback-model "claude-sonnet-4"
# Run generation against a target repository
cd /path/to/target/repo
python -m /path/to/CodeWiki generate --verbose
codewiki/cli/main.pyis built with Click. The root command group registers thegenerateandconfigsubcommands and handlesKeyboardInterrupt(exit code130) and unexpected exceptions (exit code1) with clean, colorized error output.
The FastAPI web app can be started directly with run_web_app.py, which forwards to codewiki/src/fe/web_app.py:
python codewiki/run_web_app.py --host 0.0.0.0 --port 8080The web app supports uvicorn's auto-reload for development:
python -m fe.web_app --host 0.0.0.0 --port 8080 --reload --debugWith --reload enabled, the server restarts automatically whenever source files change, and --debug increases log verbosity — both useful while iterating on route handlers, background job processing, or caching logic.
To exercise the same environment used in production:
docker network create codewiki-network
docker compose -f docker/docker-compose.yml up -d --buildThis builds the image from docker/Dockerfile (Python 3.12 slim, with git, curl, nodejs, and npm installed), mounts ../output for persistent cache/output storage, and exposes the app on ${APP_PORT:-8000}.
- CLI debugging: Pass
--verbosetocodewiki generatewhere supported to surface debug-level log output fromCLILogger. Third-party HTTP client loggers (httpx,openai,anthropic) are quieted toWARNINGby default viaquiet_third_party_loggers()to keep output readable; this only changes when the CLI logger is created in verbose mode. - Web app debugging: Use
--debugwithpython -m fe.web_appto increase log verbosity, and--reloadto avoid restarting the server manually after each code change. - IDE debugging: Both entry points (
codewiki/cli/main.pyandcodewiki/src/fe/web_app.py) are plain Python callables and can be attached to directly from VS Code or PyCharm's debugger by setting the module/script path and passing the same CLI arguments shown above.
- CLI generation runs (
codewiki generate) operate against the current working directory as the target repository —cdinto the repository you want to document before running the command. - Web app generation runs clone the submitted GitHub URL into a temporary directory managed by
BackgroundWorkerandGitHubRepoProcessor— you do not need to manually clone target repositories when using the web flow.