| Crates.io | depbank |
| lib.rs | depbank |
| version | 0.2.7 |
| created_at | 2025-04-29 03:28:15.084111+00 |
| updated_at | 2025-04-29 06:44:47.564019+00 |
| description | A Rust CLI tool for generating AI-friendly code banks from dependencies. Automatically parses Cargo.toml files, resolves versions, and generates searchable documentation while calculating token counts. |
| homepage | https://github.com/tyrchen/depbank |
| repository | https://github.com/tyrchen/depbank |
| max_upload_size | |
| id | 1653012 |
| size | 412,385 |
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.
# From crates.io
cargo install depbank
# Or from source
git clone https://github.com/your-username/depbank.git
cd depbank
cargo install --path .
DepBank provides several subcommands:
# Display help
depbank --help
# Generate code banks for dependencies in a project
depbank generate [OPTIONS]
# Calculate tokens for files or directories
depbank tokens <PATH> [OPTIONS]
# List dependencies in a project
depbank list [OPTIONS]
The generate command creates code banks for all dependencies in a Rust project:
# Generate code banks using default options (current directory, output to .codebank)
depbank generate
# Generate for a specific project directory
depbank generate --path /path/to/project
# Use a custom output directory
depbank generate --output ./docs/dependencies
# Dry run (calculate tokens without generating files)
depbank generate --dry-run
The command creates a README.md file in the output directory (.codebank by default) containing:
The tokens command calculates token counts for files or directories:
# Calculate tokens for a file
depbank tokens path/to/file.md
# Calculate tokens for all files in a directory
depbank tokens ./docs
# Filter by file extension
depbank tokens ./docs --extension md
The list command shows dependencies in a Rust project:
# List all dependencies
depbank list
# List dependencies for a specific project
depbank list --path /path/to/project
# Show detailed dependency information including versions
depbank list --detailed
$ cd my-rust-project
$ depbank generate
Analyzing project...
Found 1 Cargo.toml files
Found 5 dependencies
Found Cargo.lock
Resolved 5 versions
5/5 dependencies available locally
Generating code banks...
Generated 5 code bank files
Summary:
- Generated 5 code bank files
- Total tokens: 88200
- Added README.md with summary and token information
- Output directory: .codebank
$ depbank list --detailed
Found 1 Cargo.toml files
Dependency specifications from ./Cargo.toml:
anyhow: 1
clap: { version = "4.5", features = ["derive"] }
serde: { version = "1", features = ["derive"] }
tokio: { version = "1", features = ["rt", "macros"] }
toml: 0.8
Resolved dependency versions from Cargo.lock:
anyhow: 1.0.75
clap: 4.5.1
serde: 1.0.188
tokio: 1.32.0
toml: 0.8.2
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is distributed under the terms of the MIT license.
See LICENSE.md for details.
Copyright 2025 Tyr Chen