A simple but powerful command-line interface (CLI) to manage your personal finances. This tool allows you to easily add, view, delete, and get a summary of your expenses right from your terminal.
- Add Expenses: Quickly add new expenses with details like amount, category, and a description.
- View Expenses: Display a list of all recorded expenses in a clean, tabular format.
- Delete Expenses: Remove expenses by their unique ID.
- Expense Summary: Get a summary of your spending, including total expenses and a breakdown by category.
- Runtime: Node.js
- Command-line Arguments: yargs
- Output Styling: chalk
- Tabular Display: cli-table3
- Data Storage: JSON file (
expenses.json)
Make sure you have Node.js (version 14 or higher) installed on your system.
-
Clone the repository:
git clone https://github.com/minh-dnguyen/expense-tracker.git cd expense-tracker -
Install dependencies:
npm install
The CLI provides several commands to manage your expenses.
To add an expense, use the add command with the required options.
node index.js add --amount <amount> --category "<category>" --description "<description>"Example:
node index.js add --amount 50 --category "Groceries" --description "Weekly grocery shopping"To see all your recorded expenses, use the view command.
node index.js viewTo remove an expense, use the delete command and specify the expense id. You can find the ID by using the view command.
node index.js delete --id <expense-id>To get a summary of your total spending and a breakdown by category, use the summary command.
node index.js summaryContributions are welcome! If you have ideas for new features or improvements, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.