Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
- uses: oven-sh/setup-bun@v2
with:
node-version: '24'
cache: 'npm'
bun-version: latest

- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm test
- run: npm run build
- run: bun install
- run: bun run typecheck
- run: bun run lint
- run: bun test
- run: bun run build
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
- uses: oven-sh/setup-bun@v2
with:
node-version: '24'
cache: 'npm'
bun-version: latest

- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm test
- run: bun install
- run: bun run typecheck
- run: bun run lint
- run: bun test

publish:
needs: test
Expand All @@ -30,14 +29,17 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- run: npm run build
- run: bun install
- run: bun run build

- name: Publish to npm
run: npm publish --provenance --access public
Expand Down
24 changes: 12 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ YNAB CLI is a command-line interface for You Need a Budget (YNAB) designed for L

### Running and Building
```bash
npm run dev # Run CLI in development mode with tsx (no build required)
npm run build # Build for production using tsup
npm run link # Build and link globally (makes `ynab` available system-wide)
npm start # Run built CLI from dist/
bun run dev # Run CLI in development mode (no build required)
bun run build # Build for production using tsup
bun run link # Build and link globally (makes `ynab` available system-wide)
bun run start # Run built CLI from dist/

# Testing the CLI locally
tsx src/cli.ts <command> # Run directly without building
node dist/cli.js <command> # Run after building
bun run src/cli.ts <command> # Run directly without building
bun dist/cli.js <command> # Run after building
```

### Quality Checks
```bash
npm run typecheck # Type check without emitting files
npm run lint # Lint TypeScript files in src/
npm test # Run vitest tests
bun run typecheck # Type check without emitting files
bun run lint # Lint TypeScript files in src/
bun test # Run vitest tests
```

## Architecture
Expand Down Expand Up @@ -106,10 +106,10 @@ These operations must be done through YNAB's web/mobile apps.

## Testing

Tests use Vitest. Run with `npm test`.
Tests use Vitest. Run with `bun test`.

## Build Configuration

- **tsup.config.ts**: Bundles src/cli.ts → dist/cli.js as ESM for Node 18+
- **tsup.config.ts**: Bundles src/cli.ts → dist/cli.js as ESM
- **package.json**: Type is "module" (ESM), main is dist/cli.js, bin is "ynab"
- Shebang in src/cli.ts makes dist/cli.js directly executable
- Shebang `#!/usr/bin/env bun` in src/cli.ts makes dist/cli.js directly executable
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![npm version](https://img.shields.io/npm/v/@stephendolan/ynab-cli.svg)](https://www.npmjs.com/package/@stephendolan/ynab-cli)
[![npm downloads](https://img.shields.io/npm/dm/@stephendolan/ynab-cli.svg)](https://www.npmjs.com/package/@stephendolan/ynab-cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js Version](https://img.shields.io/node/v/@stephendolan/ynab-cli.svg)](https://nodejs.org)
[![Bun](https://img.shields.io/badge/Bun-%3E%3D1.0-black)](https://bun.sh)

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.

Expand All @@ -18,12 +18,15 @@ A command-line interface for You Need a Budget (YNAB) designed to enable LLMs (C

## Installation

Requires [Bun](https://bun.sh) runtime.

```bash
# Install globally
npm install -g @stephendolan/ynab-cli
# Install globally with bun (recommended)
bun install -g @stephendolan/ynab-cli

# Or run directly without installing
npx @stephendolan/ynab-cli budgets list
bunx @stephendolan/ynab-cli budgets list
npx @stephendolan/ynab-cli budgets list # also works
```

### Linux Prerequisites
Expand All @@ -48,8 +51,8 @@ Without `libsecret`, use the `YNAB_API_KEY` environment variable instead.
```bash
git clone https://github.com/stephendolan/ynab-cli.git
cd ynab-cli
npm install
npm run link # Build and link globally
bun install
bun run link # Build and link globally
```

## Authentication
Expand Down
Loading