Skip to content

Commit da72ed2

Browse files
stephendolanclaude
andcommitted
docs(readme): streamline documentation for better scannability
Reduces verbosity throughout - removes redundant explanations, consolidates examples, and improves information density. Makes the documentation easier to scan while preserving all essential usage information. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 01b163d commit da72ed2

File tree

1 file changed

+51
-135
lines changed

1 file changed

+51
-135
lines changed

README.md

Lines changed: 51 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,220 +1,136 @@
11
# YNAB CLI
22

33
[![npm version](https://img.shields.io/npm/v/@stephendolan/ynab-cli.svg)](https://www.npmjs.com/package/@stephendolan/ynab-cli)
4-
[![npm downloads](https://img.shields.io/npm/dm/@stephendolan/ynab-cli.svg)](https://www.npmjs.com/package/@stephendolan/ynab-cli)
54
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6-
[![Bun](https://img.shields.io/badge/Bun-%3E%3D1.0-black)](https://bun.sh)
75

8-
A command-line interface for You Need a Budget (YNAB) designed to enable LLMs (Claude, ChatGPT, etc.) and developers to quickly interface with YNAB budgets, make changes, and audit financial data.
9-
10-
## Features
11-
12-
- **LLM-First Design**: JSON output by default for easy parsing and integration with AI assistants
13-
- **Advanced Filtering**: Built-in filters reduce need for external tools like `jq` - filter by approval status, amount ranges, field selection, and search capabilities
14-
- **Comprehensive Coverage**: Support for all major YNAB API endpoints
15-
- **Type Safety**: Built with TypeScript for robust error handling
16-
- **Raw API Access**: Fallback command for any operation not covered by convenience commands
17-
- **Simple Authentication**: Uses personal access tokens stored securely in OS keychain
6+
A command-line interface for YNAB designed for LLMs and developers. JSON output by default with built-in filtering.
187

198
## Installation
209

21-
Requires [Bun](https://bun.sh) runtime.
10+
Requires [Bun](https://bun.sh).
2211

2312
```bash
24-
# Install globally with bun (recommended)
2513
bun install -g @stephendolan/ynab-cli
2614

27-
# Or run directly without installing
15+
# Or run without installing
2816
bunx @stephendolan/ynab-cli budgets list
29-
npx @stephendolan/ynab-cli budgets list # also works
3017
```
3118

32-
### Linux Prerequisites
33-
34-
Requires `libsecret` for keychain storage:
19+
<details>
20+
<summary>Linux: requires libsecret for keychain storage</summary>
3521

3622
```bash
37-
# Ubuntu/Debian
38-
sudo apt-get install libsecret-1-dev
39-
40-
# Fedora/RHEL
41-
sudo dnf install libsecret-devel
42-
43-
# Arch Linux
44-
sudo pacman -S libsecret
23+
sudo apt-get install libsecret-1-dev # Ubuntu/Debian
24+
sudo dnf install libsecret-devel # Fedora/RHEL
25+
sudo pacman -S libsecret # Arch
4526
```
4627

47-
Without `libsecret`, use the `YNAB_API_KEY` environment variable instead.
48-
49-
### From Source
50-
51-
```bash
52-
git clone https://github.com/stephendolan/ynab-cli.git
53-
cd ynab-cli
54-
bun install
55-
bun run link # Build and link globally
56-
```
28+
Without libsecret, use `YNAB_API_KEY` environment variable instead.
29+
</details>
5730

5831
## Authentication
5932

60-
Set your YNAB personal access token using the CLI or environment variables:
61-
6233
```bash
63-
ynab auth login # Interactive token entry, stored in OS keychain
64-
ynab auth status # Check authentication status
65-
ynab auth logout # Remove stored credentials
34+
ynab auth login # Store token in OS keychain
35+
ynab auth status # Check authentication
36+
ynab auth logout # Remove credentials
6637
```
6738

68-
Or use environment variables (recommended for development):
69-
70-
```env
71-
YNAB_API_KEY=your_personal_access_token
72-
YNAB_BUDGET_ID=your_default_budget_id # Optional
73-
```
39+
Or set `YNAB_API_KEY` environment variable.
7440

75-
## Usage
41+
## Commands
7642

77-
### Global Flags
43+
### Budgets
7844

7945
```bash
80-
--compact, -c # Minified JSON output (single line)
46+
ynab budgets list
47+
ynab budgets view [id]
48+
ynab budgets set-default <id>
8149
```
8250

83-
### Commands
84-
85-
#### User
51+
### Accounts
8652

8753
```bash
88-
ynab user info # Get authenticated user information
54+
ynab accounts list
55+
ynab accounts view <id>
56+
ynab accounts transactions <id>
8957
```
9058

91-
#### Budgets
59+
### Categories
9260

9361
```bash
94-
ynab budgets list # List all budgets
95-
ynab budgets view [id] # View budget details
96-
ynab budgets settings [id] # View budget settings
97-
ynab budgets set-default <id> # Set default budget
98-
```
99-
100-
#### Accounts
101-
102-
```bash
103-
ynab accounts list # List all accounts
104-
ynab accounts view <id> # View account details
105-
ynab accounts transactions <id> # List transactions for account
106-
```
107-
108-
#### Categories
109-
110-
```bash
111-
ynab categories list # List all categories
112-
ynab categories view <id> # View category details
62+
ynab categories list
63+
ynab categories view <id>
11364
ynab categories budget <id> --month <YYYY-MM> --amount <amount>
114-
ynab categories transactions <id> # List transactions for category
65+
ynab categories transactions <id>
11566
```
11667

117-
#### Transactions
68+
### Transactions
11869

11970
```bash
120-
# List and filter
121-
ynab transactions list
122-
ynab transactions list --account <id>
123-
ynab transactions list --category <id>
124-
ynab transactions list --payee <id>
125-
ynab transactions list --since <YYYY-MM-DD> --until <YYYY-MM-DD>
126-
ynab transactions list --approved=false
127-
ynab transactions list --min-amount 100 --max-amount 500
128-
ynab transactions list --status=cleared,reconciled
71+
# List with filters
72+
ynab transactions list --account <id> --since <YYYY-MM-DD>
73+
ynab transactions list --approved=false --min-amount 100
12974
ynab transactions list --fields id,date,amount,memo
13075

13176
# Search
13277
ynab transactions search --memo "coffee"
13378
ynab transactions search --payee-name "Amazon"
134-
ynab transactions search --amount 42.50
13579

136-
# CRUD operations
80+
# CRUD
13781
ynab transactions view <id>
138-
ynab transactions create
13982
ynab transactions create --account <id> --amount <amount> --date <YYYY-MM-DD>
14083
ynab transactions update <id> --amount <amount>
14184
ynab transactions delete <id>
142-
ynab transactions import
143-
ynab transactions split <id> --splits '[{"amount": -50.00, "category_id": "xxx", "memo": "..."}]'
85+
ynab transactions split <id> --splits '[{"amount": -50.00, "category_id": "xxx"}]'
14486
```
14587

146-
#### Scheduled Transactions
88+
### Payees
14789

14890
```bash
149-
ynab scheduled list # List all scheduled transactions
150-
ynab scheduled view <id> # View scheduled transaction
151-
ynab scheduled delete <id> # Delete scheduled transaction
91+
ynab payees list
92+
ynab payees view <id>
93+
ynab payees update <id> --name <name>
94+
ynab payees transactions <id>
15295
```
15396

154-
#### Payees
97+
### Months
15598

15699
```bash
157-
ynab payees list # List all payees
158-
ynab payees view <id> # View payee details
159-
ynab payees update <id> --name <name> # Rename payee
160-
ynab payees locations <id> # List locations for payee
161-
ynab payees transactions <id> # List transactions for payee
100+
ynab months list
101+
ynab months view <YYYY-MM>
162102
```
163103

164-
#### Months
104+
### Scheduled Transactions
165105

166106
```bash
167-
ynab months list # List all budget months
168-
ynab months view <YYYY-MM> # View specific month details
107+
ynab scheduled list
108+
ynab scheduled view <id>
109+
ynab scheduled delete <id>
169110
```
170111

171-
#### Raw API Access
112+
### Raw API Access
172113

173114
```bash
174-
ynab api <method> <path> [--data <json>]
175-
176-
# Examples:
177115
ynab api GET /budgets
178-
ynab api GET /budgets/{budget_id}/transactions
179116
ynab api POST /budgets/{budget_id}/transactions --data '{"transaction": {...}}'
180117
```
181118

182-
## Output Format
119+
## Output
183120

184-
All commands return JSON by default:
121+
All commands return JSON. Use `--compact` for minified output.
185122

186-
- **Lists**: Arrays of objects (not wrapped)
187-
- **Single items**: Objects directly
188-
- **Errors**: `{"error": {"name": "...", "detail": "...", "statusCode": 400}}`
189-
190-
## Currency Format
191-
192-
**All amounts are in dollars.** The CLI automatically converts YNAB's internal milliunit format (1000 = $1.00) in both input and output.
193-
194-
- Input: `--min-amount 100` means $100
195-
- Output: `"amount": -555.28` means -$555.28
123+
**Amounts are in dollars** (not YNAB's internal milliunits). `--min-amount 100` means $100.
196124

197125
## API Limitations
198126

199-
The YNAB API does not support:
200-
201-
- Creating categories, category groups, or payees
202-
- Updating accounts (beyond initial creation)
203-
204-
Use the YNAB web or mobile app for these operations.
205-
206-
## API Rate Limits
207-
208-
The YNAB API enforces a rate limit of **200 requests per hour** per access token. When exceeded, the API returns HTTP 429 errors.
127+
The YNAB API does not support creating categories, category groups, or payees. Use the web or mobile app for these.
209128

210-
**If you hit the rate limit:**
211-
- Wait 5-10 minutes before retrying (the limit uses a rolling 60-minute window)
212-
- For batch operations, add delays between requests: `sleep 20` in shell loops ensures ~180 requests/hour
129+
Rate limit: 200 requests/hour per token. If exceeded, wait 5-10 minutes.
213130

214131
## References
215132

216133
- [YNAB API Documentation](https://api.ynab.com/)
217-
- [YNAB JavaScript SDK](https://github.com/ynab/ynab-sdk-js)
218134
- [Specification](./SPEC.md)
219135

220136
## License

0 commit comments

Comments
 (0)