A simple command-line application built in Go to manage your personal finances. The Expense Tracker CLI allows you to add, update, delete, and view expenses, along with providing a summary of your expenses. It also supports tracking monthly budgets (optional).
- Add Expense: Add a new expense with a description and amount.
- Update Expense: Modify an existing expense's description or amount.
- Delete Expense: Remove an expense by its ID.
- List Expenses: View all recorded expenses.
- Expense Summary: Get the total of all your expenses.
- Monthly Summary: View a summary of expenses for a specific month (of the current year).
- Budget Tracking (Optional): Set a monthly budget and get a warning if exceeded.
Here’s how to use the Expense Tracker CLI:
$ expense-tracker add --description "Lunch" --amount 20
# Expense added successfully (ID: 1)
$ expense-tracker list
# ID Date Description Amount
# 1 2024-08-06 Lunch $20
# 2 2024-08-06 Dinner $10
$ expense-tracker update --id 1 --description "Brunch" --amount 25
# Expense updated successfully (ID: 1)
$ expense-tracker delete --id 1
# Expense deleted successfully (ID: 1)
$ expense-tracker summary
# Total expenses: $30
$ expense-tracker summary --month 8
# Total expenses for August: $20
- Go: Make sure you have Go installed on your machine. You can download it from golang.org.
-
Clone the repository:
git clone https://github.com/yourusername/expense-tracker-cli.git cd expense-tracker-cli
-
Build the application:
go build -o expense-tracker ./cmd
-
Run the Expense Tracker CLI:
./expense-tracker
The expense data is stored locally in a JSON file (data/expenses.json
). You can customize the file path by modifying the relevant section in the code.
- Allow filtering expenses by categories (e.g., food, travel, etc.).
- Add a feature to export expenses to a CSV file.
- Improve user interface for better usability.
- Implement database storage (e.g., SQLite) for larger datasets.