A command line tool with interactive TUI for managing financial investment portfolios written in Rust.
This project is the modern successor of finance.
Install/run via pkgx:
pkgx portfolio_rs
You can install portfolio_rs directly from cargo (via crates.io):
cargo install portfolio_rs
Create a JSON file with your portfolio positions.
Look at the example data for the format and data scheme.
Default: Interactive TUI (recommended):
portfolio_rs [JSON_FILE] [--tab TAB]
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
If no file is specified, the tool uses the file from your config. If you need help, try portfolio_rs --help
for usage information.
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
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 tabs1-2
: Jump directly to specific tabsq
/Esc
: Quit the application
- Select any position with
j
/k
and presse
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
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.
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.