Thanks for contributing.
ExplainThisRepo is a CLI that explains codebases using real project signals, not blind AI guessing.
The architecture is not symmetric.
- Python → core system (source of truth)
- PyInstaller → builds native binaries
- Node → thin launcher only (npm distribution)
If you misunderstand this, you will break the system.
All logic lives in Python. Node must remain a launcher.
This is the product.
It handles:
- Repository analysis (GitHub + local)
- Signal extraction (entrypoints, configs, manifests, structure)
- Dependency graph understanding
- Prompt construction
- LLM provider routing
- Output generation (
EXPLAIN.md, stdout, custom formats) - CLI flags and behavior
- Config and initialization (
init) - Diagnostics (
--doctor)
If behavior changes, it happens here.
Python is compiled into platform-specific executables:
- macOS
- Linux
- Windows
These binaries are what users actually run via npm.
This is distribution only.
Node does:
- Detect platform
- Select correct binary
- Execute it with user args
Node does NOT:
- Analyze repositories
- Read files
- Call LLMs
- Build prompts
- Detect stacks
- Handle config
If you add logic here, you are doing it wrong.
Focus on the actual system, not the wrapper.
- Improve signal extraction accuracy
- Better entrypoint detection
- Better handling of monorepos
- Reduce hallucination via stronger grounding
- Improve prompt construction
- Improve output clarity and structure
- Add or improve LLM providers
- Performance improvements (IO, parsing, API usage)
- Error handling and diagnostics
- Test coverage
- Adding logic to Node launcher
- Cosmetic abstractions that increase complexity
- Features that rely on guessing instead of signals
- Check existing issues or open one
- Keep PRs small and surgical
- Prefer correctness over cleverness
- Reduce edge cases, don't multiply them
- Don't introduce unnecessary dependencies
- Python 3.9+
- Node.js 18+
- pip
- npm
- make
git clone https://github.com/calchiwo/ExplainThisRepo.git
cd ExplainThisRepoThis is where you work.
make installmake devThis allows running the CLI directly from the local sourc
pip install -e .python -m explain_this_repo facebook/reactmake doctorEquivalent:
python -m explain_this_repo --doctormake testmake lintmake formatRuns:
blackisort
make buildMaintainers only:
Any change to core logic requires rebuilding binaries.
If you don't do this, npm users are running stale logic.
Use PyInstaller via project scripts:
make build-binariesLocation: node_version/
This layer must stay minimal.
- Platform detection fixes
- Binary resolution fixes
- Packaging improvements
- Business logic
- Feature additions
- CLI behavior changes
If you need any of those:
→ change Python
→ rebuild binaries
make build-nodenode node_version/dist/cli.js facebook/reactProviders are pluggable.
Each provider:
- Implements a common interface
- Is resolved via provider registry
- Must be deterministic in structure, not prompt guessing
Current providers include:
- Gemini
- OpenAI
- Ollama
- Anthropic
- Groq
- OpenRouter
- No provider-specific hacks leaking into core logic
- Keep interface clean and consistent
- Fail loudly and clearly
- Small, focused functions
- Explicit logic over cleverness
- Deterministic behavior > heuristic guessing
- Clear error messages
- Stable CLI output
Before submitting a PR, ensure::
- Change is necessary and scoped
- Tested locally (Python CLI)
- Binaries rebuilt if core changed
- No logic added to Node layer
- Docs updated if behavior changed
Use Conventional Commits:
feat: add feature
fix: resolve bug
docs: update docs
refactor: internal change
chore: maintenance
Include:
- OS (Windows / macOS / Linux / Termux)
- Python version (if using pip)
- Node version (if using npm)
- Command executed
- Full error output
- Target repo (
owner/repo)
- Logic added to Node launcher
- Features that bypass signal extraction
- Prompt hacks instead of system fixes
- Over-engineering simple paths
- Breaking CLI output consistency