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

# CLI: Command Reference

> Complete command-line reference for the DualEntry CLI, documenting every resource, subcommand, flag, environment variable, and configuration option.

Use this page as a scannable reference for the DualEntry CLI. For getting started, see the [Quickstart Guide](./cli-quickstart).

## Global options

The flags below apply to every CLI invocation, regardless of subcommand.

| Flag                   | Description                             |
| ---------------------- | --------------------------------------- |
| `--version`, `-v`      | Print the CLI version and exit          |
| `--help`               | Show help for any command or subcommand |
| `--install-completion` | Install shell tab completion            |

<Info>
  `dualentry --help` is the fastest way to see all available commands. You can also run `dualentry [resource] --help` for help on a specific resource.
</Info>

## Authentication commands

The authentication commands manage how the CLI connects to your DualEntry account.

| Command                | Description                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `dualentry auth login` | Opens your browser for OAuth login. Credentials are stored in your system keychain. |

For CI/CD or headless environments, set the `X_API_KEY` environment variable instead. See [Configuration](#configuration) below.

## Resource commands

The Resource commands section lists all CLI resources grouped by domain. Every resource supports the following four subcommands.

| Subcommand | What it does                                                    |
| ---------- | --------------------------------------------------------------- |
| `list`     | Show all records for this resource (paginated table by default) |
| `get`      | Retrieve a single record by ID                                  |
| `create`   | Create a new record                                             |
| `update`   | Update an existing record                                       |

<Info>
  There are no `delete` commands. Records can only be listed, retrieved, created, or updated.
</Info>

Run `dualentry [resource] --help` to see the exact flags and required arguments for each subcommand - they vary by resource.

### Receivables

| Command                                      | Description                             |
| -------------------------------------------- | --------------------------------------- |
| `dualentry invoices`                         | Manage invoices                         |
| `dualentry sales-orders`                     | Manage sales orders                     |
| `dualentry customer-payments`                | Manage customer payments                |
| `dualentry customer-credits`                 | Manage customer credits                 |
| `dualentry customer-prepayments`             | Manage customer prepayments             |
| `dualentry customer-prepayment-applications` | Manage customer prepayment applications |
| `dualentry customer-deposits`                | Manage customer deposits                |
| `dualentry customer-refunds`                 | Manage customer refunds                 |
| `dualentry cash-sales`                       | Manage cash sales                       |

### Payables

| Command                                    | Description                           |
| ------------------------------------------ | ------------------------------------- |
| `dualentry bills`                          | Manage bills                          |
| `dualentry purchase-orders`                | Manage purchase orders                |
| `dualentry vendor-payments`                | Manage vendor payments                |
| `dualentry vendor-credits`                 | Manage vendor credits                 |
| `dualentry vendor-prepayments`             | Manage vendor prepayments             |
| `dualentry vendor-prepayment-applications` | Manage vendor prepayment applications |
| `dualentry vendor-refunds`                 | Manage vendor refunds                 |
| `dualentry direct-expenses`                | Manage direct expenses                |

### Accounting

| Command                        | Description               |
| ------------------------------ | ------------------------- |
| `dualentry journal-entries`    | Manage journal entries    |
| `dualentry bank-transfers`     | Manage bank transfers     |
| `dualentry fixed-assets`       | Manage fixed assets       |
| `dualentry depreciation-books` | Manage depreciation books |

### Master data

| Command                     | Description              |
| --------------------------- | ------------------------ |
| `dualentry customers`       | Manage customers         |
| `dualentry vendors`         | Manage vendors           |
| `dualentry items`           | Manage items             |
| `dualentry accounts`        | Manage chart of accounts |
| `dualentry companies`       | Manage companies         |
| `dualentry classifications` | Manage classifications   |

### Automation

| Command               | Description                                      |
| --------------------- | ------------------------------------------------ |
| `dualentry recurring` | Manage recurring records (invoices, bills, etc.) |
| `dualentry contracts` | Manage contracts                                 |
| `dualentry budgets`   | Manage budgets                                   |
| `dualentry workflows` | Manage workflows                                 |

## Common flags

The flags below work across multiple resource commands and control output format, pagination, and filtering.

### Output format

The output format flag toggles between human-readable tables and machine-readable JSON.

| Flag            | Description                                        |
| --------------- | -------------------------------------------------- |
| `--format json` | Output as JSON instead of the default table format |

* **Table format** (default) - a human-readable, column-aligned table rendered with Rich. Best for quick lookups in the terminal.
* **JSON format** - raw JSON output. Best for scripting, piping to `jq`, or feeding into other tools.

The example below shows both output modes for the same command:

```bash theme={null}
# Table output (default)
dualentry invoices list

# JSON output
dualentry invoices list --format json
```

### Pagination

The pagination flag controls whether `list` commands return one page or the full dataset.

| Flag    | Description                                               |
| ------- | --------------------------------------------------------- |
| `--all` | Fetch all pages of results instead of just the first page |

By default, `list` commands return one page of results. Use `--all` when you need the complete dataset:

```bash theme={null}
dualentry invoices list --all
```

### Filtering

The filtering flags below are available on the `journal-entries` and `bills` resources.

| Flag                      | Description                                          |
| ------------------------- | ---------------------------------------------------- |
| `--start-date YYYY-MM-DD` | Filter records on or after this date                 |
| `--end-date YYYY-MM-DD`   | Filter records on or before this date                |
| `--status STATUS`         | Filter by record status (e.g., `posted`, `archived`) |

For other resources, run `dualentry [resource] list --help` to see the flags supported on that specific resource.

```bash theme={null}
dualentry journal-entries list --start-date 2026-03-01 --end-date 2026-03-31
dualentry bills list --status posted
```

## Configuration

The configuration commands and environment variables below control how the CLI connects to DualEntry.

### Viewing config

Display your current configuration, including API URL and auth state, with the following command:

```bash theme={null}
dualentry config show
```

### Environment variables

Set the variables below to override default CLI behavior, primarily for CI/CD or non-production environments.

| Variable            | Description                                                          | Default                     |
| ------------------- | -------------------------------------------------------------------- | --------------------------- |
| `X_API_KEY`         | API key for authentication. Skips OAuth when set. Use this in CI/CD. | (none)                      |
| `DUALENTRY_API_URL` | Override the API base URL.                                           | `https://api.dualentry.com` |

```bash theme={null}
# Use an API key instead of OAuth
export X_API_KEY="your-api-key-here"

# Point at a different API environment
export DUALENTRY_API_URL="https://api-dev.dualentry.com"
```

## Example output

The columns below appear in the table output of `dualentry invoices list`: record ID, document number, dates, company, counterparty, currency, financial amounts, and status. Other resources follow a similar table layout with columns relevant to that record type.

```text theme={null}
ID   #      Date        Company     Customer       Due Date    Currency  Amount    Paid    Due       Status
───  ────   ──────────  ──────────  ─────────────  ──────────  ────────  ────────  ──────  ────────  ────────
12   INV-1  2026-01-15  Acme Corp   Widget Co.     2026-02-14  USD       1,500.00  0.00    1,500.00  posted
15   INV-2  2026-02-01  Acme Corp   Sprocket Inc.  2026-03-03  USD       3,200.00  3,200   0.00      archived
```

## Known limitations

The CLI is early-stage software. The current limitations are:

* **Version `v0.1.9`** - expect evolving commands and occasional rough edges.
* **No delete operations** - only `list`, `get`, `create`, and `update` are available.
* **Performance** - some operations may be slow, especially on large datasets.
* **Python 3.11+ required** - Homebrew handles this automatically; other install methods require you to have Python 3.11+ already installed.
