Skip to main content

A CLI utility to consolidate project context for LLMs.

Project description

DeepBase

DeepBase is a command-line tool that analyzes a project directory, extracts the folder structure and the content of all significant code files, and consolidates them into a single text/markdown file.

This unified "context" is perfect for providing to a Large Language Model (LLM) to enable it to deeply understand the entire codebase.

Features

  • Project Structure: Generates a tree view of the folder and file structure.
  • Smart Filtering: Automatically ignores common unnecessary directories (e.g., .git, venv, node_modules).
  • Token Optimization (TOON): Capable of generating "Semantic Skeletons" (class definitions, function signatures, docstrings) instead of full code to save up to 90% of tokens.
  • Hybrid Focus Mode: Combine lightweight context for the whole project with full content only for specific files or folders.
  • Configurable: Customize ignored directories and included extensions via a .deepbase.toml file.
  • Unified Output: Combines everything into a single file, easy to copy and paste.
  • PyPI Ready: Easy to install via pip.

Installation

You can install DeepBase directly from PyPI:

pip install deepbase

How to Use

Once installed, use the deepbase command followed by the target (directory or file).

1. Basic Project Analysis

Structure Only (Default) Quickly generate a tree view of your project folders and files. No code content is included.

deepbase .

Include All Content To generate the full context including the code of all significant files, use the --all (or -a) flag. Warning: use this only for small projects.

deepbase . --all

2. Smart Token Optimization (TOON)

For large projects, sending all code to an LLM is expensive and inefficient. TOON (Token Oriented Object Notation) extracts only the semantic "skeleton" of your code (classes, signatures, docstrings), ignoring implementations.

deepbase . --toon
# or
deepbase . -t

Result: LLMs understand your architecture using minimal tokens.

3. Hybrid Mode (Focus)

This is the power user feature. You can provide the TOON skeleton for the entire project (background context) while focusing on specific files (full content).

Focus via CLI: Use -f or --focus with glob patterns (e.g., *auth*, src/utils/*).

deepbase . --toon --focus "server/controllers/*" --focus "client/src/login.js"

Focus via File: Instead of typing patterns every time, create a text file (e.g., context_task.txt) with the list of files/folders you are working on.

content of context_task.txt:

server/routes/auth.js
server/models/User.js
client/src/components/LoginForm.jsx

Run deepbase loading the file:

deepbase . --toon --focus-file context_task.txt

4. Single File Analysis

DeepBase supports analyzing a single specific file.

Structure Only (Default) Extracts only the outline/headers. Useful for large documentation files.

deepbase README.md

Structure + Content Appends the full content after the structure.

deepbase README.md --all

Configuration (.deepbase.toml)

You can customize behavior by creating a .deepbase.toml file in your project root:

ignore_dirs = ["my_assets", "experimental"]
significant_extensions = [".cfg", "Makefile", ".tsx"]

Development Workflow

If you want to contribute or test the tool locally:

# Install in editable mode
pip install -e ".[dev]"

# Run tests
pytest

License

This project is released under the GPL 3 license. See the LICENSE file for details.

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

deepbase-1.4.0.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

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

deepbase-1.4.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file deepbase-1.4.0.tar.gz.

File metadata

  • Download URL: deepbase-1.4.0.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deepbase-1.4.0.tar.gz
Algorithm Hash digest
SHA256 1e2cec562c98b9c280fd9ce6639239d90570665c75a044624bf2bcb3633f2ae3
MD5 ac18f3e24d4494c2ea0092e75584ae7d
BLAKE2b-256 584869ea6207e09cb927b7ba455c8b24a5e229d869b196cf73910a266231745a

See more details on using hashes here.

File details

Details for the file deepbase-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: deepbase-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deepbase-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd4a508588e8b20f79b8fd1f2c0438f071928c8dd2b6370bc1fcea6777d46dbb
MD5 f89d86aef4c18b6f124699e2b2477572
BLAKE2b-256 0f4a4bba4369887957070c91ad9c684afc0af62d7a4c40a10e2436862b14b559

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