|
1 | 1 | # Zero Finance CLI
|
2 | 2 |
|
3 |
| -A bleeding-edge terminal interface for self-custody business banking. Manage your entire business finances from the command line. |
4 |
| - |
5 |
| -## Features |
6 |
| - |
7 |
| -- 🏢 **Company Management** - Create and manage LLCs, C-Corps |
8 |
| -- 🏦 **Self-Custody Banking** - Your keys, your control |
9 |
| -- 💸 **Smart Payments** - Pay contractors instantly with USDC or traditional methods |
10 |
| -- 🤖 **AI Integration** - Claude AI for intelligent financial automation |
11 |
| -- 📧 **Financial Inbox** - Process invoices from Gmail automatically |
12 |
| -- 📊 **Analytics** - Real-time financial insights in your terminal |
13 |
| -- 🔐 **Secure** - All funds stored as USDC in wallets you control |
| 3 | +Self-custody business banking in your terminal. |
14 | 4 |
|
15 | 5 | ## Installation
|
16 | 6 |
|
17 | 7 | ```bash
|
18 |
| -# From the packages/cli directory |
| 8 | +# Install dependencies |
19 | 9 | npm install
|
20 | 10 |
|
21 |
| -# Or using pnpm |
| 11 | +# Or with pnpm |
22 | 12 | pnpm install
|
23 | 13 | ```
|
24 | 14 |
|
| 15 | +## Authentication |
| 16 | + |
| 17 | +The CLI uses token-based authentication. To authenticate: |
| 18 | + |
| 19 | +1. Run the auth command: |
| 20 | + ```bash |
| 21 | + npm start auth login |
| 22 | + # or |
| 23 | + node src/index.js auth login |
| 24 | + ``` |
| 25 | + |
| 26 | +2. The CLI will open your browser to https://zerofinance.ai/cli-auth |
| 27 | + - If not logged in to Zero Finance, you'll be redirected to sign in first |
| 28 | + - Once logged in, you'll see the CLI authentication page |
| 29 | + |
| 30 | +3. Click "Generate Token" on the web page |
| 31 | + |
| 32 | +4. Copy the generated token |
| 33 | + |
| 34 | +5. Paste the token in your terminal when prompted |
| 35 | + |
| 36 | +6. You're authenticated! The token will be stored securely and used for API calls. |
| 37 | + |
| 38 | +### Check Authentication Status |
| 39 | + |
| 40 | +```bash |
| 41 | +node src/index.js auth status |
| 42 | +``` |
| 43 | + |
| 44 | +### Logout |
| 45 | + |
| 46 | +```bash |
| 47 | +node src/index.js auth logout |
| 48 | +``` |
| 49 | + |
25 | 50 | ## Usage
|
26 | 51 |
|
27 | 52 | ### Interactive Mode
|
28 | 53 |
|
| 54 | +Run the CLI without arguments to enter interactive mode: |
| 55 | + |
29 | 56 | ```bash
|
| 57 | +npm start |
| 58 | +# or |
30 | 59 | node src/index.js
|
31 | 60 | ```
|
32 | 61 |
|
33 |
| -This launches the interactive CLI with a beautiful menu system. |
| 62 | +### Command Line Mode |
34 | 63 |
|
35 |
| -### Command Mode |
| 64 | +Use specific commands directly: |
36 | 65 |
|
37 | 66 | ```bash
|
| 67 | +# Show help |
| 68 | +node src/index.js --help |
| 69 | + |
| 70 | +# Check version |
| 71 | +node src/index.js --version |
| 72 | + |
38 | 73 | # Check balance
|
39 | 74 | node src/index.js balance
|
40 | 75 |
|
41 | 76 | # Quick payment
|
42 |
| -node src/index.js pay alex@example.com 5000 |
| 77 | +node src/index.js pay john@example.com 1000 |
43 | 78 |
|
44 | 79 | # Company management
|
45 | 80 | node src/index.js company
|
46 | 81 | ```
|
47 | 82 |
|
48 |
| -## Key Commands |
| 83 | +## Available Commands |
| 84 | + |
| 85 | +### Authentication |
| 86 | +- `auth login` - Authenticate with Zero Finance |
| 87 | +- `auth status` - Check authentication status |
| 88 | +- `auth logout` - Log out from the CLI |
49 | 89 |
|
50 | 90 | ### Company Management
|
51 |
| -- Create new LLC or C-Corp |
52 |
| -- Switch between companies |
53 |
| -- View company details |
| 91 | +- `company` - Enter company management menu (interactive) |
54 | 92 |
|
55 |
| -### Banking |
56 |
| -- Create self-custody bank accounts |
57 |
| -- Check balances (USDC) |
58 |
| -- View transactions |
59 |
| -- Transfer funds |
60 |
| -- Configure auto-yield (5.2% APY) |
| 93 | +### Banking Operations |
| 94 | +- `balance` - Check account balance |
| 95 | +- `accounts list` - List all accounts |
| 96 | +- `accounts balance` - Check account balances |
61 | 97 |
|
62 | 98 | ### Payments
|
63 |
| -- Pay contractors (USDC/ACH/Wire) |
64 |
| -- Run payroll |
| 99 | +- `pay <email> <amount>` - Quick payment to contractor |
| 100 | + |
| 101 | +### KYC Verification |
| 102 | +- `kyc start` - Start KYC verification process |
| 103 | +- `kyc status` - Check KYC status |
| 104 | + |
| 105 | +### QR Codes |
| 106 | +- `qr generate --amount 100` - Generate payment QR code |
| 107 | +- `qr scan` - Scan a QR code |
| 108 | + |
| 109 | +### Transfers |
| 110 | +- `transfers send --to <address> --amount <amount>` - Send funds |
| 111 | +- `transfers list` - List recent transfers |
| 112 | + |
| 113 | +## Features |
| 114 | + |
| 115 | +### 🏢 Company Management |
| 116 | +- Create new companies (LLC, C-Corp, S-Corp) |
| 117 | +- Switch between multiple companies |
| 118 | +- View company details and balances |
| 119 | + |
| 120 | +### 🏦 Banking Operations |
| 121 | +- Create self-custody bank accounts |
| 122 | +- Check balances with real-time APY |
| 123 | +- View transaction history |
| 124 | +- Transfer funds between accounts |
| 125 | + |
| 126 | +### 💸 Payments & Payroll |
| 127 | +- Pay contractors via email |
| 128 | +- Run payroll for employees |
65 | 129 | - Pay invoices
|
66 | 130 | - Quick pay to recent recipients
|
| 131 | +- Multiple payment methods (USDC, ACH, Wire) |
67 | 132 |
|
68 |
| -### AI & Automation |
| 133 | +### 🤖 AI & Automation |
69 | 134 | - Connect Gmail for invoice detection
|
70 |
| -- Enable Claude AI assistant |
71 |
| -- Set automation rules |
72 |
| -- View AI performance stats |
73 |
| - |
74 |
| -### Financial Inbox |
75 |
| -- View pending invoices |
76 |
| -- One-click payment processing |
77 |
| -- AI-powered insights |
| 135 | +- Connect Claude AI for financial insights |
| 136 | +- Auto-categorize transactions |
| 137 | +- Smart payment scheduling |
| 138 | +- Spending pattern analysis |
| 139 | + |
| 140 | +### 📊 Analytics Dashboard |
| 141 | +- Revenue trends |
| 142 | +- Key metrics display |
| 143 | +- Recent activity summary |
| 144 | +- AI-generated insights |
| 145 | + |
| 146 | +### 📧 Financial Inbox |
| 147 | +- Process pending invoices |
| 148 | +- Review payment requests |
| 149 | +- Batch payment processing |
| 150 | +- AI-powered recommendations |
78 | 151 |
|
79 | 152 | ## Configuration
|
80 | 153 |
|
81 |
| -The CLI stores configuration in: |
82 |
| -- macOS: `~/Library/Preferences/zero-finance-cli-nodejs` |
83 |
| -- Linux: `~/.config/zero-finance-cli-nodejs` |
84 |
| -- Windows: `%APPDATA%\zero-finance-cli-nodejs\Config` |
| 154 | +The CLI stores configuration data locally using the `conf` package. Data is persisted between sessions including: |
| 155 | +- Authentication tokens (encrypted) |
| 156 | +- Company information |
| 157 | +- Current company selection |
| 158 | +- User preferences |
| 159 | + |
| 160 | +To reset configuration: |
| 161 | +```bash |
| 162 | +# Config is stored in: |
| 163 | +# macOS: ~/Library/Preferences/zero-finance-cli-v2-nodejs |
| 164 | +# Linux: ~/.config/zero-finance-cli-v2 |
| 165 | +# Windows: %APPDATA%/zero-finance-cli-v2 |
| 166 | +``` |
85 | 167 |
|
86 | 168 | ## Development
|
87 | 169 |
|
88 | 170 | ```bash
|
89 | 171 | # Run in development mode with auto-reload
|
90 | 172 | npm run dev
|
| 173 | + |
| 174 | +# Run tests |
| 175 | +npm test |
| 176 | + |
| 177 | +# Run test CLI with mock auth (for development) |
| 178 | +node test-cli-full.js |
| 179 | +``` |
| 180 | + |
| 181 | +## Testing |
| 182 | + |
| 183 | +### Automated Tests |
| 184 | +```bash |
| 185 | +node test-cli.js |
| 186 | +``` |
| 187 | + |
| 188 | +### Manual Testing with Mock Auth |
| 189 | +For testing without real API connection: |
| 190 | +```bash |
| 191 | +# Use the test CLI with mock auth |
| 192 | +node test-cli-full.js auth login |
| 193 | +node test-cli-full.js auth status |
| 194 | +node test-cli-full.js company |
91 | 195 | ```
|
92 | 196 |
|
93 |
| -## Architecture |
| 197 | +## Troubleshooting |
| 198 | + |
| 199 | +### Config File Corrupted |
| 200 | +If you see "Config file corrupted" message, the CLI will automatically create a new config file. |
| 201 | + |
| 202 | +### Authentication Issues |
| 203 | +1. Ensure you're logged in to Zero Finance web app |
| 204 | +2. Check that your token hasn't expired with `auth status` |
| 205 | +3. Try logging out and back in: `auth logout` then `auth login` |
94 | 206 |
|
95 |
| -- Built with modern ES modules |
96 |
| -- Uses Inquirer.js for interactive prompts |
97 |
| -- Chalk for beautiful terminal colors |
98 |
| -- Ora for elegant loading spinners |
99 |
| -- Boxen for styled terminal boxes |
100 |
| -- Commander for CLI argument parsing |
101 |
| -- Conf for persistent configuration |
| 207 | +### API Connection Issues |
| 208 | +- Check your internet connection |
| 209 | +- Verify the API URL is correct (defaults to https://zerofinance.ai/api/trpc) |
| 210 | +- Check if you're authenticated with `auth status` |
102 | 211 |
|
103 | 212 | ## Security
|
104 | 213 |
|
105 |
| -- All funds stored as USDC in self-custody wallets |
106 |
| -- You control the private keys |
107 |
| -- No bank can freeze your account |
108 |
| -- Traditional banking rails via partners |
| 214 | +- CLI tokens are hashed with bcrypt before storage in the database |
| 215 | +- Tokens expire after 90 days by default |
| 216 | +- Each token is shown only once when generated |
| 217 | +- Tokens are stored locally with encryption |
| 218 | +- You can revoke tokens from the web interface |
109 | 219 |
|
110 | 220 | ## License
|
111 | 221 |
|
112 |
| -MIT |
| 222 | +MIT |
0 commit comments