bus-inventory — manage inventory items and movements
bus-inventory — manage inventory items and movements
Synopsis
bus inventory init [-C <dir>] [global flags]
bus inventory add --item-id <id> --name <name> --unit <unit> --valuation-method <method> --inventory-account <account> --cogs-account <account> [--desc <text>] [--sku <sku>] [-C <dir>] [global flags]
bus inventory move --item-id <id> --date <date> --qty <number> --direction <in|out|adjust> [--unit-cost <amount>] [--desc <text>] [--voucher <id>] [-C <dir>] [global flags]
bus inventory valuation --as-of <YYYY-MM-DD> [--item-id <id>] [-C <dir>] [-o <file>] [-f <format>] [global flags]
Description
Command names follow CLI command naming.
bus inventory maintains item master data and stock movement ledgers as schema-validated repository data.
It produces valuation output for accounting and reporting.
Movements are append-only; corrections are new records.
Commands
init creates the baseline inventory datasets and schemas. If they already exist in full, init warns and exits 0 without changing anything. If they exist only partially, init fails and does not modify files.
add inserts an item into item master data. move appends stock movement records (in, out, or adjust). valuation computes valuation output as of the selected date.
Options
For add, required flags are --item-id, --name, --unit, --valuation-method, --inventory-account, and --cogs-account. Optional flags are --desc and --sku.
For move, required flags are --item-id, --date, --qty, and --direction <in|out|adjust>. Optional flags are --unit-cost, --desc, and --voucher.
For valuation, --as-of <YYYY-MM-DD> is required and --item-id is optional.
Global flags are defined in Standard global flags. For command-specific help, run bus inventory --help.
Files
Inventory item and movement datasets and their beside-the-table schemas in the inventory area. Master data for this module is stored in the workspace root only; the module does not use subdirectories (for example, no inventory/ folder). Path resolution is owned by this module; other tools obtain the path via this module’s API (see Data path contract).
Examples
bus inventory init
bus inventory add \
--item-id ITEM-001 \
--name "Notebook" \
--unit pcs \
--valuation-method fifo \
--inventory-account 1460 \
--cogs-account 4100
bus inventory move --item-id ITEM-001 --date 2026-01-10 --qty 100 --direction in --unit-cost 2.40
bus inventory move --item-id ITEM-001 --date 2026-01-20 --qty 35 --direction out
bus inventory valuation --as-of 2026-01-31 --format tsv --output ./out/inventory-valuation-2026-01.tsv
Exit status
0 on success. Non-zero on errors, including invalid usage or schema violations.
Using from .bus files
Inside a .bus file, write this module target without the bus prefix.
# same as: bus inventory add --item-id SKU-100 --name "Widget A" --unit pcs --valuation-method fifo --inventory-account 1460 --cogs-account 4100
inventory add --item-id SKU-100 --name "Widget A" --unit pcs --valuation-method fifo --inventory-account 1460 --cogs-account 4100
# same as: bus inventory move --item-id SKU-100 --date 2026-02-15 --qty 20 --direction in --unit-cost 3.10
inventory move --item-id SKU-100 --date 2026-02-15 --qty 20 --direction in --unit-cost 3.10
# same as: bus inventory valuation --as-of 2026-02-28 --item-id SKU-100 --format json
inventory valuation --as-of 2026-02-28 --item-id SKU-100 --format json
Development state
Value promise: Manage inventory items and movements so valuation and COGS can feed bus-reports and the workspace has a single source for stock and movements.
Use cases: Inventory valuation and COGS postings.
Completeness: Init, add, move, valuation, validate, and status are implemented; workspace-root layout and path API are in place. Behavior is validated by unit and e2e tests.
Use case readiness: Inventory valuation and COGS postings: core workflow implemented and test-covered; remaining work focuses on incremental SDD alignment and broader integration confidence.
Current: Core command behavior, validation diagnostics, deterministic outputs, and global-flag handling are test-verified. Detailed test matrix and implementation notes are maintained in Module SDD: bus-inventory.
Planned next: Next priorities: further SDD alignment, additional tests, or integration with bus-reports. Root layout, init, add, move, and valuation are implemented and no longer planned.
Blockers: None known.
Depends on: None.
Used by: Inventory data feeds COGS and valuation in bus-reports.
See Development status.