wb CLI for .xlsx files.

Read workbook ranges, edit cells, create files, trace dependencies, and recalculate formulas from the command line. Output defaults to readable text; switch to JSON, Markdown, or CSV when you need a machine or table-friendly format.

Install

Install one binary and use it in scripts, CI, or other tools.

single binary
go install github.com/jpoz/werkbook/cmd/wb@latest
Output
Text default
Modes
default / agent
Formula engine
Built in
Commands
info / read / dep
wb structured output
$ wb read --range A1:D5 --format json report.xlsx

{
  "ok": true,
  "command": "read",
  "data": {
    "sheet": "Summary",
    "range": "A1:D5",
    "rows": [ ... ]
  },
  "meta": { "schema_version": "wb.v1" }
}

$ wb edit --format json --patch '[{"cell":"B2","value":150000}]' report.xlsx

{
  "ok": true,
  "command": "edit",
  "data": { "applied": 1, "failed": 0, "saved": true }
}
Response contract
ok
command
data
error.hint
meta
Formats
Text by default for terminal use.
JSON, Markdown, or CSV when you want structured output, readable tables, or simple downstream exports.

Commands for common workbook tasks.

The CLI reads workbook data, edits files, creates new workbooks, recalculates formulas, traces dependencies, and can return structured results when you need them.

MODES terminal + tooling

Readable text by default, JSON when needed

Default mode stays readable for terminal use. Switch to --format json or --mode agent when scripts need a stable envelope.

FILES workbook ops

Read, edit, create, recalculate, and trace

The command set covers the normal workbook lifecycle and formula graph inspection without handing work off to another spreadsheet app.

ERRORS recoverable

Errors include a code and hint

Error output includes a code, message, and hint so it is easier to recover in scripts.

FORMAT output formats

Choose text, JSON, Markdown, or CSV

Use text for terminal work, JSON for tools, Markdown for readable tables, or CSV for simple downstream processing.

Common workbook tasks are direct commands

Inspect files, patch cells, trace formula graphs, and recalculate workbooks from one binary.

Inspect
$ wb info budget.xlsx
// discover sheets, ranges, dimensions
Patch
$ wb edit \
  --patch '[{"cell":"B2","value":150000}]' budget.xlsx
Trace
$ wb dep --cell D15 --depth -1 budget.xlsx
// trace precedents and dependents

Commands return structured results

Use --format json or --mode agent when scripts should read top-level fields directly instead of parsing human prose.

{
  "ok": true,
  "command": "read",
  "data": { ... },
  "meta": { ... }
}

Choose the output format you need

default text
Readable output for terminal work
--format json
Structured machine output
--format markdown
Readable tables for humans
--format csv
Simple output for downstream tools

Formula recalculation is built in

Reads and writes are not wrappers over another spreadsheet app. The binary includes the same formula engine as the Go library.

math
statistics
text
date
logic
lookup

Single binary, no external runtime

One binary, no office runtime, no Python dependency, and no sidecar services.

runtime: none
dependencies: 0 external
target: macOS / Linux / Windows

Use the CLI in three steps.

Install wb, inspect or edit a workbook, then recalculate and return the result.

01

Install the binary

Pull the CLI into your Go toolchain with a single command.

go install github.com/jpoz/werkbook/cmd/wb@latest
02

Inspect or edit workbook ranges

Read cells for context, then patch only the fields you need to change.

03

Recalculate and return results

Run the built-in formula engine and emit readable text, JSON, Markdown, or CSV.

shell session 4 commands
$ go install github.com/jpoz/werkbook/cmd/wb@latest

$ wb read --range A1:D5 --format markdown budget.xlsx

$ wb edit --patch '[{"cell":"B2","value":150000}]' budget.xlsx

$ wb calc --range D15 --format json budget.xlsx