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.8.0.tar.gz (58.4 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.8.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deepbase-1.8.0.tar.gz
Algorithm Hash digest
SHA256 d3d84111d2907ba2013c25961a832139b6699eb0e9cc5b21f9ab2f9298246b6b
MD5 82d87c0265c7ad704d9fc75c3d0610df
BLAKE2b-256 6bd0036825b28517c8fd469728f93cc63446c1c19a654d9c2b9329cf4691efc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deepbase-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 45.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.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 942125c2b1595da0f9e32e1e32937854d3bb79d6988617c2e19df1416edf632c
MD5 af356a2bd63aee293074111195e6a19e
BLAKE2b-256 9c3c9b7083244f7d6112cdfe329165a372dbd49c9f95eb552c6323324c473d58

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