5 unstable releases
Uses new Rust 2024
new 0.4.3 | Apr 7, 2025 |
---|---|
0.4.2 | Mar 22, 2025 |
0.4.1 | Mar 22, 2025 |
0.3.2 | Mar 17, 2025 |
0.2.0 | Mar 16, 2025 |
#30 in Cargo plugins
544 downloads per month
200KB
3K
SLoC
Cargo Thanku
A command-line tool for generating acknowledgments for your Rust project dependencies.
Key Features
- Generates acknowledgments in multiple formats (Markdown table/list, JSON, TOML, CSV, YAML)
- Fetches dependency information from crates.io and GitHub
- Supports concurrent processing with configurable limits
- Implements retry mechanism for failed requests
- Offers command-line completion for Bash, Zsh, Fish, PowerShell, and Elvish
- Provides internationalization support (zh/en/ja/ko/es/fr/de/it)
Installation
Ensure you have the Rust toolchain installed on your system, then execute:
# Install cargo-thanku
cargo install cargo-thanku
# Generate shell completions (optional)
cargo thanku completions bash > ~/.local/share/bash-completion/completions/cargo-thanku
Usage
Basic Usage
# Generate acknowledgments for your project
cargo thanku
# Specify output format
cargo thanku -f markdown-table # or markdown-list, json, csv, yaml, toml
# Set GitHub token for more information and automatic starring
cargo thanku -t YOUR_GITHUB_TOKEN
# Change language
cargo thanku -l en # supports zh/en/ja/ko/es/fr/de/it
Advanced Options
# Configure concurrent requests
cargo thanku -j 10 # Set maximum concurrent requests to 10
# Adjust retry attempts
cargo thanku -r 5 # Set maximum retry attempts to 5
# Customize output file
cargo thanku -o custom_thanks.md
# Enable verbose logging
cargo thanku -v
# Filter out libraries imported with relative paths
cargo thanku --no-relative-libs
Format Conversion
Convert between different output formats:
# Do support `cargo thanku convert` syntax to invoke converter
# Convert a single file to multiple formats
cargo-thanku convert input.md -o markdown-table,json,yaml,toml
# Short command aliases
cargo-thanku cvt input.csv -o mt,yaml
cargo-thanku conv input.md -o json,csv
cargo-thanku convt input.yaml -o markdown-list
The converter will:
- Create a
converted
directory in the same location as the input file - Generate output files with appropriate extensions
- Support conversion between all supported formats (mt[markdown-table], ml[markdown-list], json, toml, yaml, csv)
Command-Line Arguments
Argument | Description | Default Value |
---|---|---|
-i, --input |
Input Cargo.toml file path | - |
-o, --outputs |
Output file formats | - |
-l, --language |
Language (zh/en/ja/ko/es/fr/de/it) | zh |
-v, --verbose |
Enable verbose logging | false |
Command-Line Completion
Generate command-line completion scripts for various shells:
# Bash
cargo thanku completions bash > ~/.local/share/bash-completion/completions/cargo-thanku
# Zsh
cargo thanku completions zsh > ~/.zsh/_cargo-thanku
# Fish
cargo thanku completions fish > ~/.config/fish/completions/cargo-thanku.fish
# PowerShell
mkdir -p $PROFILE\..\Completions
cargo thanku completions powershell > $PROFILE\..\Completions\cargo-thanku.ps1
# Elvish
cargo thanku completions elvish > ~/.elvish/lib/cargo-thanku.elv
Command-Line Arguments
Argument | Description | Default Value |
---|---|---|
-i, --input |
Input Cargo.toml file path | Cargo.toml |
-o, --output |
Output file path | thanks.md |
-f, --format |
Output format | markdown-table |
-t, --token |
GitHub API token | - |
-l, --language |
Language (zh/en/ja/ko/es/fr/de/it) | zh |
-v, --verbose |
Enable verbose logging | false |
-j, --concurrent |
Maximum concurrent requests | 5 |
-r, --retries |
Maximum retry attempts | 3 |
--no-relative-libs |
Filter out libraries imported with relative paths | false |
Output Formats
Markdown Table
| Name | Description | Source | Stats | Status |
|------|-------------|--------|-------|--------|
|🔍 | Normal | | | |
|[serde](https://crates.io/crates/serde) | Serialization framework | [GitHub](https://github.com/serde-rs/serde) | 🌟 3.5k | ✅ |
Markdown List
# Dependencies
- [serde](https://crates.io/crates/serde) [Serialization framework](https://github.com/serde-rs/serde) (🌟 3.5k) ✅
MARKDOWN/JSON/TOML/YAML/CSV
Also supports structured output formats for programmatic use.
Important Notes
-
Setting a GitHub token (
-t
orGITHUB_TOKEN
env) enables:- Fetching additional repository information
- Automatic fetching stars of dependency repositories
- Higher API rate limits
-
Failed dependency processing:
- Won't interrupt the overall process
- Will be marked with ❌ in the output
- Shows error messages for debugging
-
Language codes:
- Supports flexible formats (e.g., "en", "en_US", "en_US.UTF-8")
- Falls back to primary language code
- Suggests similar codes for typos
Acknowledgments
This project itself is built with many excellent Rust crates. Here are some key dependencies:
Tip
Generated by cargo-thanku
tool
Name | Description | Crates.io | Source | Stats | Status |
---|---|---|---|---|---|
🔍 | Normal | ||||
anyhow | Flexible concrete Error type built on std::error::Error | anyhow | GitHub | ❓ | ✅ |
cargo_metadata | structured access to the output of cargo metadata |
cargo_metadata | GitHub | ❓ | ✅ |
clap | A simple to use, efficient, and full-featured Command Line Argument Parser | clap | GitHub | ❓ | ✅ |
clap_complete | Generate shell completion scripts for your clap::Command | clap_complete | GitHub | ❓ | ✅ |
futures | An implementation of futures and streams featuring zero allocations, composability, and iterator-like interfaces. | futures | GitHub | ❓ | ✅ |
reqwest | higher level HTTP client library | reqwest | GitHub | ❓ | ✅ |
rust-i18n | Rust I18n is use Rust codegen for load YAML file storage translations on compile time, and give you a t! macro for simply get translation texts. | rust-i18n | GitHub | ❓ | ✅ |
serde | A generic serialization/deserialization framework | serde | GitHub | ❓ | ✅ |
serde_json | A JSON serialization file format | serde_json | GitHub | ❓ | ✅ |
serde_yaml | YAML data format for Serde | serde_yaml | GitHub | ❓ | ✅ |
strsim | Implementations of string similarity metrics. Includes Hamming, Levenshtein, OSA, Damerau-Levenshtein, Jaro, Jaro-Winkler, and Sørensen-Dice. | strsim | GitHub | ❓ | ✅ |
thiserror | derive(Error) | thiserror | GitHub | ❓ | ✅ |
tokio | An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications. | tokio | GitHub | ❓ | ✅ |
toml | A native Rust encoder and decoder of TOML-formatted files and streams. Provides implementations of the standard Serialize/Deserialize traits for TOML data to facilitate deserializing and serializing Rust structures. | toml | GitHub | ❓ | ✅ |
tracing | Application-level tracing for Rust. | tracing | GitHub | ❓ | ✅ |
tracing-subscriber | Utilities for implementing and composing tracing subscribers. |
tracing-subscriber | GitHub | ❓ | ✅ |
url | URL library for Rust, based on the WHATWG URL Standard | url | GitHub | ❓ | ✅ |
🔧 | Development | ||||
assert_fs | Filesystem fixtures and assertions for testing. | assert_fs | GitHub | ❓ | ✅ |
pretty_assertions | Overwrite assert_eq! and assert_ne! with drop-in replacements, adding colorful diffs. |
pretty_assertions | GitHub | ❓ | ✅ |
tokio-test | Testing utilities for Tokio- and futures-based code | tokio-test | GitHub | ❓ | ✅ |
For a complete list of dependencies and their acknowledgments, run:
cargo thanku
License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~17–29MB
~424K SLoC