Skip to content

minh-dnguyen/expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Tracker CLI

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.

Features

  • 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.

Technology Stack

  • Runtime: Node.js
  • Command-line Arguments: yargs
  • Output Styling: chalk
  • Tabular Display: cli-table3
  • Data Storage: JSON file (expenses.json)

Prerequisites

Make sure you have Node.js (version 14 or higher) installed on your system.

Installation

  1. Clone the repository:

    git clone https://github.com/minh-dnguyen/expense-tracker.git
    cd expense-tracker
  2. Install dependencies:

    npm install

Usage

The CLI provides several commands to manage your expenses.

Add a new expense

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"

View all expenses

To see all your recorded expenses, use the view command.

node index.js view

Delete an expense

To 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>

Get an expense summary

To get a summary of your total spending and a breakdown by category, use the summary command.

node index.js summary

Contributing

Contributions are welcome! If you have ideas for new features or improvements, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors