> ## 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.

# Common Workflows: DualEntry CLI

> Step-by-step DualEntry CLI workflows for common accounting and CI/CD tasks: reviewing invoices, month-end review, and automating bill checks.

Use this guide for end-to-end DualEntry CLI workflows aimed at both developers and accountants. For installation and authentication, see the [Quickstart Guide](./cli-quickstart). For a complete list of resources and flags, see the [Command Reference](./cli-reference).

## Prerequisites

Before running any workflow on this page, complete the steps in the [Quickstart Guide](./cli-quickstart):

* The CLI is installed and on your `PATH`.
* You're authenticated (`dualentry auth login`) or have `X_API_KEY` set for CI/CD.
* You have read access to the resources used in each workflow (invoices, bills, journal entries).

## Review outstanding invoices

This workflow shows accountants and developers how to identify outstanding invoices and export them for further analysis.

### Steps

**Step 1 - List your invoices:**

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

The default table output includes a `Status` column (e.g., `posted`, `archived`) so you can see at a glance which invoices are still outstanding.

**Step 2 - Discover available filters for the invoices resource:**

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

The CLI is evolving, so the supported flags vary by version and resource. Confirmed filtering flags on `journal-entries` and `bills` (`--start-date`, `--end-date`, `--status`) may also be available on `invoices` - `--help` is the source of truth for your installed version.

**Step 3 - Pull the full details on a specific invoice:**

```bash theme={null}
dualentry invoices get [INV-ID]
```

Replace `INV-ID` with the ID from the list output. This shows all the detail for a single invoice - line items, customer, amounts, and status.

**Step 4 - Export to JSON for further analysis:**

```bash theme={null}
dualentry invoices list --format json > outstanding_invoices.json
```

This dumps the full dataset as JSON and saves it to a file. From here you can feed it into Excel, a Python script, a BI tool, or whatever your team uses for reporting. The `>` operator redirects the output to a file instead of printing it to screen.

**Result:** You have an exported JSON file of your invoice data, ready for downstream filtering and analysis with tools like `jq`, Python, or Excel.

## Run a month-end journal entry review

This workflow shows accountants (and the developers supporting them) how to review every journal entry booked in a given month before closing the books.

### Steps

**Step 1 - List journal entries for the month:**

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

The `--start-date` and `--end-date` flags are confirmed on `journal-entries`. This returns every journal entry booked in March.

**Step 2 - Fetch all pages if the list is long:**

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

By default, the CLI returns one page of results. Adding `--all` fetches every page so you don't miss anything - important during close when completeness matters.

**Step 3 - Spot-check a specific entry:**

```bash theme={null}
dualentry journal-entries get [JE-ID]
```

Replace `JE-ID` with the ID from your list. This pulls the full detail - debits, credits, accounts, memo, posting date - for a single journal entry so you can verify it's correct.

**Step 4 - Export the full month for the workpaper file:**

```bash theme={null}
dualentry journal-entries list --start-date 2026-03-01 --end-date 2026-03-31 --all --format json > march_journal_entries.json
```

Save the complete dataset as JSON for your close binder, audit trail, or to share with your auditors.

<Info>
  Combining `--all` with `--format json` gives you a complete, machine-readable export. This is the fastest way to pull data out of DualEntry for external analysis.
</Info>

**Result:** You have a complete, machine-readable export of every journal entry booked in the period, suitable for review, audit, or close documentation.

## Automate bill status checks in CI/CD

This workflow shows developers how to build automation around accounts payable - for example, a scheduled job that checks for new posted bills and sends a notification to Slack, or a pipeline that reconciles bill data against another system.

### Steps

**Step 1 - Set up authentication for your pipeline:**

In your CI/CD environment (GitHub Actions, Jenkins, etc.), add `X_API_KEY` as a secret. The CLI uses this automatically when the environment variable is set - no browser-based login required.

```bash theme={null}
export X_API_KEY="$DUALENTRY_API_KEY"  # reference your CI/CD secret
```

**Step 2 - Pull posted bills as JSON:**

```bash theme={null}
dualentry bills list --status posted --format json
```

The `--status` and `--format` flags are confirmed on `bills`. JSON output makes it straightforward to parse programmatically.

**Step 3 - Pipe into `jq` or another tool:**

Inspect the raw JSON output once to confirm the exact field names available on your version, then build your `jq` filter against those keys. For example, after inspecting the output:

```bash theme={null}
dualentry bills list --status posted --format json | jq '.[] | {id, vendor: .vendor_name, amount: .amount_due, due_date: .due_date}'
```

This extracts just the fields you care about from each bill.

**Step 4 - Add to a scheduled job:**

Wire the same commands into a scheduled CI workflow. The example below runs each weekday morning in GitHub Actions:

```yaml theme={null}
name: Check posted bills
on:
  schedule:
    - cron: '0 9 * * 1-5'  # weekdays at 9am

jobs:
  check-bills:
    runs-on: ubuntu-latest
    steps:
      - name: Install DualEntry CLI
        run: curl -fsSL https://raw.githubusercontent.com/dualentry/dualentry-cli/main/install.sh | sh

      - name: List posted bills
        env:
          X_API_KEY: ${{ secrets.DUALENTRY_API_KEY }}
        run: dualentry bills list --status posted --format json > bills.json

      - name: Process results
        run: |
          # your notification or reconciliation logic here
          cat bills.json | jq length
```

<Warning>
  The install script method shown here requires Python 3.11+ on the CI runner. Add a setup step (e.g., `actions/setup-python` with `python-version: '3.11'`) if your runner image doesn't include it.
</Warning>

**Result:** A scheduled CI/CD job runs on the cadence you choose, pulls posted bills as JSON, and hands them to your notification or reconciliation logic.

## Tips for all workflows

The tips below apply across every workflow on this page and will save time as you build your own.

* **Start with `--help`** - the CLI is evolving fast and flags may change between versions. `dualentry [resource] list --help` is your source of truth.
* **Use `--format json` for anything automated** - table output is great for humans but brittle for scripts.
* **Combine `--all` with JSON for complete exports** - don't assume the first page is everything.
* **The CLI is read-heavy today** - while `create` and `update` exist, the highest-value use cases right now tend to be listing, filtering, and exporting data.
