Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@opes-app/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@opes-app/cli
AI-powered financial CLI for the Opes platform. Manage your finances directly from the terminal with natural language commands.
Features
- AI Chat Interface - Ask questions about your finances in natural language
- Data Browser - View and create accounts, transactions, categories with keyboard shortcuts
- Full CRUD Operations - Create, read, edit, and delete entities with keyboard shortcuts
- Interactive Mode - Full-featured terminal UI powered by Ink
- One-shot Commands - Quick queries without entering interactive mode
- Local/Production Toggle - Switch between local dev server and production
- Secure Authentication - JWT-based login with secure credential storage
Requirements
- Node.js >= 18.17.0
- An Opes account
Installation
npm install -g @opes-app/cliOr with yarn:
yarn global add @opes-app/cliOr with pnpm:
pnpm add -g @opes-app/cliUsage
Authentication
First, authenticate with your Opes account:
opes loginThis will open a browser window for OAuth authentication. Your credentials are stored securely in your system's config directory.
To log out and clear stored credentials:
opes logoutChat with AI
Interactive mode - Start a chat session:
opesOne-shot mode - Ask a single question:
opes "What's my spending this month?"opes "Show my account balances"opes "How much did I spend on groceries?"Server Configuration
By default, CLI connects to the local development server. Configure the server mode:
# Show current configuration
opes config
# Set default to local server (http://localhost:3000)
opes config local
# Set default to production server (https://opes.app)
opes config prodYou can also override the server for a single command:
# Use local server for this command
opes -l "What's my balance?"
# Use production server for this command
opes -p "What's my balance?"Help
opes --helpData Browser
In interactive mode, press F2 to switch to Data Browser. Navigate between tabs using number keys or arrow keys.
Keyboard Shortcuts
| Key | Action |
|---|---|
1-4 |
Switch to tab (1=Accounts, etc) |
← → |
Navigate between tabs |
↑ ↓ |
Select item in list |
a |
Add new entity |
e |
Edit selected entity |
d |
Delete selected entity |
r |
Refresh data |
Esc |
Cancel form / go back |
F1 |
Switch to Chat mode |
F2 |
Switch to Data Browser mode |
Creating Entities
Press a in any tab to create a new entity:
- Accounts: Name, Currency, Initial Balance
- Transactions: Account, Amount, Date, Description
- Categories: Name, Type (income/expense), Color
Use arrow keys to navigate select fields, Enter to confirm.
Editing Entities
Press e on a selected item to edit:
- Accounts: Edit name (currency cannot be changed)
- Transactions: Edit amount, date, description
- Categories: Edit name, color (type cannot be changed)
Deleting Entities
Press d on a selected item to delete:
- Accounts: Archived (soft delete) - preserves transaction history
- Transactions: Permanently deleted with confirmation
- Categories: Permanently deleted with confirmation
Commands
| Command | Description |
|---|---|
opes |
Start interactive session |
opes [message] |
Send a one-shot message to AI |
opes login |
Authenticate with Opes |
opes logout |
Clear stored credentials |
opes config |
Show current configuration |
opes config local |
Set default to local server |
opes config prod |
Set default to production server |
opes -l [cmd] |
Override to use local server |
opes -p [cmd] |
Override to use production server |
opes --version |
Show version |
opes --help |
Show help |
Configuration
Settings are stored in ~/.opes/settings.json.
Credentials are stored in your system's config directory:
- macOS:
~/Library/Preferences/opes-cli-nodejs/ - Linux:
~/.config/opes-cli-nodejs/ - Windows:
%APPDATA%/opes-cli-nodejs/
Development
# Clone the repository
git clone https://github.com/opes-app/opes.git
cd opes/apps/cli
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Run tests
npm testLicense
MIT - see LICENSE for details.