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.7.0.tar.gz (53.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.7.0-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepbase-1.7.0.tar.gz
  • Upload date:
  • Size: 53.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.7.0.tar.gz
Algorithm Hash digest
SHA256 b91c62e65aca438f02fb47c1cb67dd8b96e8c96e449da0e257ca0cb796078137
MD5 4e9ef82e7d6cc0ce8954070e7535747f
BLAKE2b-256 5da746cc9bb333aa2723cd58118e599fb7a83e3945808784e181d5aa16e10da8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deepbase-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 40.2 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dba73017a97814139849537091faeb259d3894406b4d1ec8df53c4119ecff713
MD5 a22edfaa0efcce630858b437fda8018d
BLAKE2b-256 45b4e6e97dfc2a7372912cc17d0fcf09793df21adfce35928df35ee128361724

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