Skip to content

command line interface created in rust to generate and manage invoices

Notifications You must be signed in to change notification settings

Delvoid/clinvoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invoice Generation Tool

Report Bug · Request Feature

Banner

A fast and user-friendly command line invoice generator written in Rust. Designed to simplify and automate invoice creation for freelancers and small businesses.

This CLI tool was created to explore building practical CLI applications in Rust while providing a useful productivity tool. It eliminates the hassle of manual invoice creation by generating customized PDF invoices right from the command line.

Features

  • Create and manage companies, clients, invoices
  • Generate PDF invoices
  • Invoice regeneration
  • Search for existing records
  • Built-in SQLite database

Installation

From source

  1. Install Rust
  2. Clone the repository
  3. Run cargo build --release
git clone https://github.com/delvoid/clinvoice.git
cd cli-invoice
cargo build --release

From Precompiled Binaries

Precompiled binaries for Mac OS (Mach-O 64-bit executable arm64) and Windows (x86_64-pc-windows-gnu) are available in the releases section.

Download the appropriate binary for your system, add it to your PATH, and run:

cli-invoice

Commands

Setup

Initialize the configuration and database. Creates config.json and a SQLite database file. This command runs on first launch and is required to run the app.

clinvoice setup

(back to top)

Companies

The company details are your own details. These are used to generate the invoice.

# Create a company
cli-invoice company add # Prompts for details
# OR
cli-invoice company add [NAME] [ADDRESS] [EMAIL] [PHONE]

# Search companies
cli-invoice company search {name}

use cli-invoice company --help for more details.

Clients

The client details are the details of the person or company you are invoicing.

# Create a client
cli-invoice client add # Prompts for details
# OR
cli-invoice client add [NAME] [ADDRESS] [EMAIL] [PHONE]

# List clients
cli-invoice client list

# Search clients
cli-invoice client list --name <name>
# use cli-invoice client list --help for more options

use cli-invoice client --help for more details.

(back to top)

Client add prompts Client add options Client list example

(back to top)

Invoices

Generate invoices for clients. Invoices are generated as PDF files. You are able to use prompts or options to generate invoices. Any missing details will be prompted for.

When generating an invoice, the company is optional. By default, the first company in the database will be used. If you have multiple companies, you can specify which company to use by passing the --company option.

When searching for invoice, if there is more then one result it will show all results without items. You can then use the --id option to get the full invoice with items.

# Generate an invoice through prompts
cli-invoice invoice generate

# Generate an invoice through options 
cli-invoice invoice generate  --client John Doe --item '{"description": "Service 1", "quantity": 1, "price": 50}'

# List invoices
cli-invoice invoice list

# Search invoices
cli-invoice invoice search --client John Doe

# Regenerate an invoicei - creates a new invoice with the same details
cli-invoice invoice regen --id 1234

see cli-invoice invoice --help for more details.

(back to top)

Invoice options Invoice List by id

(back to top)

Database

The app uses an embedded SQLite database to store invoice data. The database file is created on initial setup at <User home dir>/clinvoice/cli_invoice.sqlite3.

PDF Generation

Invoice PDFs are generated using Handlebars templates and Headless Chrome via the headless_chrome crate.

Template options are currently a work in progress.

Contributions

Contributions are welcome! Feel free to open an issue or submit a pull request.

Contact

Delvoid - @delvoid

(back to top)