> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselim.com/llms.txt
> Use this file to discover all available pages before exploring further.

# lim add

> Create journal entries using natural language or file attachments.

# lim add

The `add` command is lim's signature feature. Describe a transaction in plain language and lim creates the correct journal entry, including tax decomposition.

## Basic Usage

```bash theme={null}
lim add "<description>"
```

### Examples

```bash theme={null}
# Simple expense
lim add "AWS 11000 yen credit card"
```

```
✅ Communication     10,000 / Accounts payable  11,000
   Input VAT          1,000
📚 Learned rule for "AWS" (auto-suggest next time)
```

```bash theme={null}
# Revenue
lim add "Received 550,000 yen from Acme Corp for consulting"
```

```
✅ Accounts receivable  550,000 / Sales revenue     500,000
                                  Output VAT         50,000
```

```bash theme={null}
# Payroll
lim add "March salary for Tanaka, gross 400000, withholding 20000, social insurance 50000"
```

```
✅ Salary expense     400,000 / Withholding tax payable    20,000
                                Social insurance payable   50,000
                                Cash                      330,000
```

## File Attachments

Attach receipts, invoices, or screenshots. lim extracts vendor, amount, date, and description using vision AI.

```bash theme={null}
lim add "expense" --file receipt.jpg
```

```
📎 Analyzing receipt.jpg...
   Vendor: Starbucks Shibuya
   Amount: ¥680 (tax-inclusive)
   Date: 2026-03-15

✅ Meeting expense       618 / Cash              680
   Input VAT              62
📎 Document attached to journal entry
```

### Multiple Files

```bash theme={null}
lim add "office supplies" --file receipt1.jpg --file receipt2.png
```

### Supported Formats

| Format | Extensions                               | Notes                                         |
| ------ | ---------------------------------------- | --------------------------------------------- |
| Images | `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp` | Auto-resized to max 1568px (long edge)        |
| PDF    | `.pdf`                                   | Multi-page supported, first 5 pages processed |
| CSV    | `.csv`                                   | Bank statement import                         |

<Tip>
  Images are automatically resized before sending to the vision API. Files larger than 20MB are
  rejected. For best results, ensure receipts are well-lit and text is readable.
</Tip>

## The 3-Step Judgment Process

When you run `lim add`, the engine processes your input through three steps:

1. **Rule Match** -- checks learned rules from previous entries. Zero AI cost. Instant.
2. **History Match** -- searches past journal entries with similar descriptions. Zero AI cost.
3. **AI Inference** -- calls an LLM to classify the transaction. Only used as a last resort.

If all three steps produce low confidence, the entry is created in `draft` status for human review.

```bash theme={null}
# First time: AI inference (step 3)
lim add "GitHub 1100 yen credit card"
# => ✅ Communication 1,000 / Accounts payable 1,100 (AI inference, 87% confidence)
#    📚 Learned rule for "GitHub"

# Second time: Rule match (step 1)
lim add "GitHub 1100 yen credit card"
# => ✅ Communication 1,000 / Accounts payable 1,100 (Rule match, 88% confidence)
```

## Flags

| Flag           | Description                                  | Example              |
| -------------- | -------------------------------------------- | -------------------- |
| `--file`, `-f` | Attach a file (receipt, invoice, screenshot) | `--file receipt.jpg` |
| `--date`, `-d` | Override the transaction date (YYYY-MM-DD)   | `--date 2026-03-01`  |
| `--draft`      | Create as draft (skip auto-posting)          | `--draft`            |
| `--yes`, `-y`  | Skip confirmation prompt                     | `-y`                 |
| `--format`     | Output format: `table`, `json`               | `--format json`      |

## Interactive Confirmation

By default, `lim add` shows the proposed journal entry and asks for confirmation:

```bash theme={null}
lim add "Uber 2500 yen"
```

```
Proposed journal entry:
  Travel expense     2,273 / Cash    2,500
  Input VAT            227

  Confidence: 85% (AI inference)

? Confirm this entry? (Y/n/edit)
```

Options:

* **Y** (default) -- confirm and post. The entry is learned for next time.
* **n** -- cancel.
* **edit** -- open an interactive editor to modify accounts or amounts.

<Tip>Use `--yes` or `-y` to skip the confirmation prompt in scripts and automation.</Tip>

## JSON Output

```bash theme={null}
lim add "AWS 11000 yen credit card" --format json --yes
```

```json theme={null}
{
  "id": "01926f3a-...",
  "effectiveDate": "2026-03-16",
  "status": "posted",
  "memo": "AWS 11000 yen credit card",
  "lines": [
    { "side": "debit", "account": "Communication", "amount": 10000 },
    { "side": "debit", "account": "Input VAT", "amount": 1000 },
    { "side": "credit", "account": "Accounts payable", "amount": 11000 }
  ],
  "judgment": {
    "step": "rule",
    "confidence": 0.91,
    "autoPost": true
  }
}
```

<Warning>
  When `autoPost` is `true`, the entry is posted without confirmation. This happens when a rule has been confirmed enough times (confidence >= 0.95). Use `--draft` to override this behavior.
</Warning>
