No description
  • Rust 98.2%
  • Nix 1.8%
Find a file
Markus Zoppelt 9db6693848
Some checks are pending
Rust / build (push) Waiting to run
Rust / nix-build (push) Waiting to run
chore: update nix flake to 26.05
2026-05-30 09:42:57 +02:00
.github ci: improve caching, permissions, and nix test coverage 2026-04-25 17:08:49 +02:00
img docs: add TUI screenshots to README 2025-07-22 15:56:28 +02:00
src fix: remove invalid import and fix typo in main.rs 2026-04-25 17:08:49 +02:00
.envrc build: add nix flake 2025-07-22 10:57:46 +02:00
.gitignore chore: update gitignore 2026-04-25 17:08:49 +02:00
Cargo.lock build(deps): bump serde_json from 1.0.149 to 1.0.150 2026-05-26 09:09:38 +02:00
Cargo.toml build(deps): bump serde_json from 1.0.149 to 1.0.150 2026-05-26 09:09:38 +02:00
example_data.json style: format 2025-12-05 22:48:31 +01:00
flake.lock chore: update nix flake to 26.05 2026-05-30 09:42:57 +02:00
flake.nix chore: update nix flake to 26.05 2026-05-30 09:42:57 +02:00
LICENSE Create LICENSE 2022-09-20 14:58:31 +02:00
README.md docs: update #installation in README.md 2025-12-30 17:16:40 +01:00
rustfmt.toml chore: add release profile optimizations and rustfmt config 2026-04-25 17:08:49 +02:00

portfolio_rs logo
build status badge

A command line tool with interactive TUI for managing financial investment portfolios written in Rust.

This project is the modern successor of finance.

Installation

Available in nixpkgs: nix-shell -p portfolio_rs or nix run nixpkgs#portfolio_rs

Install via pkgx: pkgx portfolio_rs

Install from cargo: cargo install portfolio_rs

Usage

1. Create your portfolio file

Create a JSON file with your portfolio positions.

Look at the example data for the format and data scheme.

2. Launch the portfolio tool:

Default: Customizable Interactive TUI (recommended):

portfolio_rs [JSON_FILE] [--tab TAB] [--disable COMPONENTS]

You may optionally specify which tab to open at start-up:

portfolio_rs [JSON_FILE] --tab overview     # Start on Overview & Allocation tab (default)
portfolio_rs [JSON_FILE] --tab balances     # Start on Balances tab

CLI Commands (optional):

portfolio_rs balances [JSON_FILE]     # Show balances table
portfolio_rs allocation [JSON_FILE]   # Show allocation chart
portfolio_rs performance [JSON_FILE]  # Show performance metrics

Configuration:

portfolio_rs config                   # Show config file location
portfolio_rs components               # Show available components

If no file is specified, the tool uses the file from your config. If you need help, try portfolio_rs --help for usage information.

TUI Features

The interactive Terminal User Interface (default mode) provides:

  • Overview & Allocation Tab: Large display of total portfolio value, visual bar chart, and detailed allocation breakdown
  • Balances Tab: Detailed table of all positions with amounts, current values, and edit functionality

TUI Customization

You can disable specific UI components using the --disable flag with comma-separated component names:

Overview Tab Components:

  • tab_bar - Top navigation tabs
  • total_value - Large portfolio value display
  • asset_allocation - Visual bar chart
  • detailed_allocation - Allocation percentage list
  • help - Help text at bottom

Balances Tab Components:

  • tab_bar - Top navigation tabs
  • name - Position name column
  • asset_class - Asset class column
  • amount - Amount/quantity column
  • balance - Balance/value column

Examples:

# Hide tab bar and help text
portfolio_rs --disable tab_bar,help example_data.json

# Show only the allocation chart (hide detailed list)
portfolio_rs --disable detailed_allocation example_data.json

# Minimal balances view (name and balance only)
portfolio_rs --disable asset_class,amount example_data.json

TUI Navigation

  • h / l : Switch tabs left/right (vim-style)
  • j / k : Navigate up/down (select positions in Balances tab)
  • e : Edit selected position amount (in Balances tab)
  • Tab / : Switch between tabs
  • 1-2 : Jump directly to specific tabs
  • q / Esc : Quit the application

Edit Functionality

  • Select any position with j/k and press e to edit
  • Real-time balance preview and input validation
  • Changes are saved automatically to your data file
  • Supports decimal precision for crypto and fractional shares

Screenshots

Overview & Allocation Tab

TUI Overview

Balances Tab with Edit Functionality

TUI Balances

Demo

demo

Configuration

Upon first run, portfolio_rs will create a default config file. Use portfolio_rs config to show the config file location.

The most useful config entry is portfolio_file where you can set the absolute path to your data file. This will be used when no file is specified as an argument.

Bonus: GPG Encryption

This tool supports (gpg) encrypted json files. Decrypted values are never written to disk.

# you will need a valid gpg key in ~/.gnupg/
portfolio_rs [COMMAND] data.json.gpg

Pro Tip: Use a plugin like vim-gnupg for editing your data file.