Skip to main content

CLI tool for quickly mapping the architecture of an unfamiliar repository.

Project description

Explain Codebase

CLI tool that analyzes any repository and explains its architecture, entrypoints, dependencies, and impact of changes.

explain-codebase analyzes a repository and helps developers understand unfamiliar projects faster by showing how the system is structured and where execution likely starts.

It works with both local folders and public GitHub repositories.


Why

When opening a new repository, it is often unclear:

  • where the application starts
  • which modules are central
  • which files interact with external systems
  • what files are risky to modify

explain-codebase scans the project, builds a dependency graph, detects architectural signals, and produces a compact CLI overview that helps you understand the codebase faster.


Installation

pip install explain-codebase

For local development:

pip install -e .[dev]

Quick Start

Analyze the current repository:

explain-codebase .

Verbose architecture output:

explain-codebase . --verbose

Deep architecture analysis:

explain-codebase . --deep

Analyze a GitHub repository:

explain-codebase https://github.com/user/repo

Example Output

Explain Codebase
--------------------------------

Repository

  Path        C:\Projects\orders-api
  Type        Python backend service
  Language    python
  Files       7

Architecture

  Entrypoints        1
  Core modules       5
  Side effects       4

Suggested starting point

  api_server.py

Run with --verbose to see full architecture

Verbose mode provides a deeper architecture view:

Execution flow

api_server.py
|- routes/order_routes.py
|- services/order_service.py
|  |- repositories/order_repository.py
|  \- clients/warehouse_client.py
\- middleware/auth_guard.py

Features

  • Analyze local folders and public GitHub repositories
  • Detect project language and project type
  • Detect entrypoints automatically
  • Rank core modules by dependency usage
  • Infer likely execution flow
  • Detect modules that interact with database, network, filesystem, or cache
  • Detect architecture folders such as services, repositories, routes, and models
  • Detect large modules and highly coupled files
  • Detect architecture smells such as circular dependencies
  • Generate dependency graph visualizations
  • Generate HTML architecture reports
  • Explain a single file in project context
  • Suggest onboarding reading paths
  • Support CI mode for architecture checks

Common Commands

Analyze a repository:

explain-codebase .

Verbose architecture output:

explain-codebase . --verbose

Deep architecture analysis:

explain-codebase . --deep

Suggest a reading order for a new developer:

explain-codebase onboarding .

Explain a single file:

explain-codebase file src/services/order_service.ts

Generate a dependency graph:

explain-codebase . --graph

Generate an HTML architecture report:

explain-codebase . --report

Run in CI mode:

explain-codebase . --ci

Remote Repositories

You can analyze a public GitHub repository directly:

explain-codebase https://github.com/user/repo

The tool will:

  1. Resolve the repository
  2. Check that it exists and is publicly accessible
  3. Ask for confirmation before cloning
  4. Clone it into a temporary workspace
  5. Run the analysis
  6. Remove the temporary workspace automatically

Output Modes

Default mode shows a compact overview:

explain-codebase .

Verbose mode shows the full architecture structure:

explain-codebase . --verbose

Deep mode focuses on architecture risks and potential issues:

explain-codebase . --deep

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

explain_codebase-0.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

explain_codebase-0.1.0-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file explain_codebase-0.1.0.tar.gz.

File metadata

  • Download URL: explain_codebase-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for explain_codebase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64db4a73c06520e2b26704411f3a0ac23ed6ed03a9b2a5724d8356783d13f750
MD5 ffaee7621caa505d2337ed52d30ac1b2
BLAKE2b-256 52c47748ac7d24c2dc303ba0774274021a0525bfefe29973ce4624f35f93f496

See more details on using hashes here.

File details

Details for the file explain_codebase-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for explain_codebase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5046a2bb98303f924139b9bca4d590acdd6a0ea2986714d5b9f786687b1de29
MD5 4576a524f209616dc1231c01cd24fa35
BLAKE2b-256 590bfa65a440f36f50af9c690259e600063de737c951b97b34cdec1d4b2ae385

See more details on using hashes here.

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