Skip to main content

beancount-io

bea is the command-line interface for Beancount.io. Create and edit plain-text Beancount ledgers, import bank exports, validate accounts, run BQL queries, and generate financial reports. Local bookkeeping needs no Beancount.io account. Optional AI assistance and hosted ledger management use your Beancount.io credentials.

The Python distribution is beancount-io; its executable is bea. Run bea --version and bea COMMAND --help to check the version and options you have installed.

Contents

Install

# Installs software; needs Homebrew or uv plus network.
brew install bex-co/tap/bea      # macOS and Linuxbrew
uv tool install beancount-io     # anywhere with uv and Python 3.12+

The default installation omits AI dependencies. For bea ask, install the extra (or run it without replacing your bea):

# Installs software; needs uv plus network.
uv tool install 'beancount-io[ask]'
uvx --from 'beancount-io[ask]' bea ask --help

Quick start

bea --no-input init books --currency USD --date 2026-08-01 \
  --opening-balance "Assets:Checking 1000"
cd books
bea add transaction "Coffee" --date 2026-08-02 \
  --posting "Expenses:Dining 12.50" --posting "Assets:Checking"
bea check
bea list transaction --limit 10
bea report balance-sheet

The purchase leaves 987.50 USD in checking: the currency comes from the account and Beancount fills in the balancing posting. For a bank export, see the import guide; for your first month end to end, follow the tutorial.

Command map

Command Purpose
bea init [DIRECTORY] Create a local ledger with common accounts
bea add TYPE Append one of eleven directive types
bea import SOURCE Preview or apply a bank CSV (--csv) or importer (--config)
bea list TYPE Inspect directives and filter transactions
bea check Validate the complete ledger
bea format [PATH] Format a file or recursively format a directory
bea query [BQL] Run a query or start the interactive BQL shell
bea report TYPE Overview, income statement, balance sheet, or trial balance
bea balance [ACCOUNT…] Trial-balance subtrees for matching accounts
bea ask [QUESTION] Ask about a local ledger through the hosted AI service
bea cloud … Sign in and manage hosted ledgers
bea upgrade [--check] Check for an update or invoke the owning package manager

Global options come before the command; --file selects the root ledger:

bea --file main.bean check
bea --json list transaction --limit 100

Every flag, default, and help string is listed in the generated command reference.

Exit codes

Code Meaning
0 Success, including previews and intentional duplicate skips
1 Ledger, schema, formatting-check, or other runtime failure
2 Bad arguments, missing file or input, missing optional dependencies
3 Authentication or permission failure, including a read-only destination
4 Conflict: concurrent change, import review required, or uncertain remote write

The usage guide documents the full contract: JSON error shape, cloud HTTP mapping, prompts, and output exceptions.

Learn more

  • Tutorial: your first month, from init to a month-end report.
  • Usage: the contract — targets, JSON envelope, exit codes, prompts, environment.
  • Importing: no-code CSV import, rules, and Python importers.
  • Reference: every command's usage, arguments, and options, generated from the code.

Development

# Clones the repo and syncs dependencies; needs git and network.
git clone https://github.com/bex-co/beancount-io.git
cd beancount-io/cli
uv sync --all-groups
uv run bea --help
make check-all

Python 3.12+, Typer, Beancount v3, Beanquery, Pydantic, and a vendored Fava reporting subset (it does not start the Fava web interface). src/cli/ holds command UX; src/fava/ the vendored library (retain NOTICE.fava attribution); tests/ the pytest suite; docs/ the guides above; openapi/v1.json the pinned contract for hosted commands. make check-all is the handoff gate: lint, deadcode, format-check, typecheck, test, spec-check, and docs-check. Do not hand-edit generated API clients, command stubs, docs/REFERENCE.md, or lockfiles; keep scratch files under tmp/. See the package guide for architecture boundaries and contribution rules.

Releases

Releases ship to PyPI and Homebrew from cli-vX.Y.Z tags; the release guide holds the tagging procedure and one-time credentials setup.

License

MIT © Beancount.io. Vendored Fava attribution is preserved in NOTICE.fava.

Metadata

Release files for beancount-io 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beancount-io 0.1.0
File Size Uploaded
beancount_io-0.1.0.tar.gz 481.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beancount-io 0.1.0
File Interpreter ABI Platform
beancount_io-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 953.9 kB

Release files / beancount_io-0.1.0.tar.gz

Download URL beancount_io-0.1.0.tar.gz
Size 481.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5ca75fd0a3effa7f21b04694dd50f7589417771b09e3581758e5dbca359c062c
BLAKE2b-256 checksum
How to use checksums
d2dd72fded0400ff4757779ac6d2213323b70ba23d2b0c26937e5a93cdae54e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / beancount_io-0.1.0-py3-none-any.whl

Download URL beancount_io-0.1.0-py3-none-any.whl
Size 472.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ca96e2c7375cacfec8917797c61c781d91fe1f030589dfbe447aebd897e2950
BLAKE2b-256 checksum
How to use checksums
3d521b06ab491f05da0429dd59f4bf9dce6b4bb7d4c5a8324932bd2320aee46f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page