DepBank
DepBank is a Rust CLI tool that helps you generate AI-friendly code banks for your project's dependencies. It automatically parses your Cargo.toml files, resolves the exact versions from Cargo.lock, and generates Markdown documentation for each dependency using the codebank library. Additionally, it calculates token counts to help you understand the size and complexity of your dependency documentation.
Features
- Recursively finds all Cargo.toml files in your project
- Parses dependencies from Cargo.toml files (regular, dev, and build dependencies)
- Resolves exact dependency versions from Cargo.lock
- Generates summary documentation for each dependency as Markdown files
- Creates a README.md in the output directory with dependency summaries and token information
- Calculates token counts for the generated documentation
- Lists all dependencies with optional detailed information
- Works with workspaces and complex project structures
Installation
# From crates.io
# Or from source
Usage
DepBank provides several subcommands:
# Display help
# Generate code banks for dependencies in a project
# Calculate tokens for files or directories
# List dependencies in a project
Generate Command
The generate command creates code banks for all dependencies in a Rust project:
# Generate code banks using default options (current directory, output to .codebank)
# Generate for a specific project directory
# Use a custom output directory
# Dry run (calculate tokens without generating files)
The command creates a README.md file in the output directory (.codebank by default) containing:
- A summary table of all dependencies with their versions and token counts
- Total token statistics for all code banks
- Information about what code banks are and how to use them
Tokens Command
The tokens command calculates token counts for files or directories:
# Calculate tokens for a file
# Calculate tokens for all files in a directory
# Filter by file extension
List Command
The list command shows dependencies in a Rust project:
# List all dependencies
# List dependencies for a specific project
# Show detailed dependency information including versions
Examples
Generating Code Banks for a Project
Listing Dependencies with Details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is distributed under the terms of the MIT license.
See LICENSE.md for details.
Copyright 2025 Tyr Chen