| Crates.io | expense-tracker |
| lib.rs | expense-tracker |
| version | 0.7.1 |
| created_at | 2025-10-31 17:38:32.646918+00 |
| updated_at | 2025-12-07 09:21:00.293648+00 |
| description | expense-tracker is a cli based tool to track expenses. |
| homepage | https://github.com/purnamahesh/expense-tracker |
| repository | https://github.com/purnamahesh/expense-tracker |
| max_upload_size | |
| id | 1910404 |
| size | 87,476 |
A command-line application for tracking personal expenses with categories, tags, and filtering capabilities. Built with Rust for performance and reliability.
~ expansion support✅ Modern CLI with clap derive macros
✅ Comprehensive test suite (unit, integration, doc tests)
✅ Idiomatic error handling with Result<>
✅ CI/CD with GitHub Actions
✅ Automated version management and releases
✅ Code coverage reporting
🚧 SQLite migration (planned)
cargo install expense-tracker
The binary will be installed to ~/.cargo/bin/ (make sure it's in your PATH).
git clone <repository-url>
cd expense-tracker
cargo install --path .
Or just build without installing:
cargo build --release
# Binary will be at: target/release/expense-tracker
./install-hooks.sh
See HOOKS-README.md for details on commit message validation and automatic version bumping.
# Add an expense
expense-tracker add --amount 12.50 --category food --description "Lunch"
# Add expense with tags
expense-tracker add -a 12.50 -c food -d "Lunch" --tag meal --tag restaurant
# List all expenses
expense-tracker list
# Calculate total spending
expense-tracker total
# Filter by category
expense-tracker filter --category food
# Filter by amount
expense-tracker filter --amount 50.0
# Filter by tags
expense-tracker filter --tag restaurant
# Use custom database file
expense-tracker -p ~/my-expenses.psv list
# Works with all commands
expense-tracker -p ./data/expenses.psv add -a 25.00 -c transport -d "Taxi"
# General help
expense-tracker --help
# Command-specific help
expense-tracker add --help
expense-tracker filter --help
src/
├── main.rs # Entry point with Result<> error handling
├── lib.rs # Library exports
├── cli.rs # Clap CLI definitions and argument validation
├── config.rs # Configuration constants (file format, etc.)
├── expense.rs # Expense struct, business logic, and operations
├── file_parser.rs # File I/O operations with error handling
└── path.rs # Path utilities (~ expansion, validation)
tests/
├── integration_test.rs # Integration tests with assert_cmd
└── resources/
└── mock_expenses.psv # Test fixtures
.github/workflows/
├── test.yml # Comprehensive test suite
├── release.yml # Automated releases
├── pr-title-check.yml # PR title validation
├── command-dispatch.yml # /bump, /test, /docs commands
├── docs.yml # Documentation generation
└── pre-release.yml # Pre-release versions
Version: 0.5.3-alpha.1
Implementation Highlights:
assert_cmd and rstest~/path notationadd, list, total, filterchrono = "0.4.42" - DateTime handling and formattingclap = { version = "4.5.51", features = ["derive"] } - CLI parsing with derive macrosassert_cmd = "2.1.1" - Integration testing for CLI applicationsrstest = "0.26.1" - Fixture-based testing frameworkPR Commands (comment on your PR):
/bump - Auto-detect version bump from PR title (feat: → minor, fix: → patch, etc.)/pre-release alpha - Create pre-release (alpha/beta/rc)/test - Run full test suite/docs - Generate and commit documentationNote: Make sure your PR title follows conventional commit format (e.g., feat:, fix:, chore:). The /bump command reads your PR title to determine the version bump type.
See VCS-README.md for:
See HOOKS-README.md for:
See ROADMAP.md for planned features including:
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_list
# Run integration tests only
cargo test --test integration_test
# Check formatting
cargo fmt --check
# Format code
cargo fmt
# Run clippy
cargo clippy --all-targets --all-features
# Fix clippy warnings
cargo clippy --fix
# Build optimized binary
cargo build --release
# Run benchmarks (if available)
cargo bench
This project is licensed under the MIT License - see the LICENSE file for details.
This project demonstrates: