xlsx
by BiteFoundry
README.md
# `@bitefoundry/xlsx`
**ISO/IEC 29500 (`.xlsx` / `.xlsm`) terminal spreadsheet workspace** — read workbooks, edit one cell
losslessly, and see every dependent formula recalculate. One engine
([`bitefoundry-xlsx`](https://github.com/BiteFoundry/bitefoundry-ooxml)) behind four interfaces:
CLI, TUI, HTTP API and MCP.
## Install
```sh
npm install -g @bitefoundry/xlsx
```
The npm package ships a prebuilt binary for Windows, macOS and Linux (x64 / arm64).
## Commands
| Command | What it does |
| :--- | :--- |
| `xlsx <file>` / `xlsx open <file>` | Interactive grid |
| `xlsx info <file> [--json]` | Sheets, dimensions, formula counts, date1904 and signature status |
| `xlsx get <file> <address> [--values\|--formulas] [--json]` | Read one cell or a range |
| `xlsx set <file> <address> <value> [-o <output>] [--json]` | Edit one existing cell, recalculate, save atomically |
| `xlsx mcp [--read-only] [--root <dir>]` | MCP server on stdio |
| `xlsx serve [--host 127.0.0.1] [--port 0] [--read-only] [--root <dir>]` | HTTP API + `/mcp` |
Addresses: `"/예산/A1:C11"`, `"예산!B2"`, or `"B11"` (first sheet).
Values: a number, `TRUE` / `FALSE`, or text.
```console
$ xlsx get budget.xlsx 예산!B11 --formulas
=SUM(B2:B10)
$ xlsx set budget.xlsx 예산!B2 1500 -o out.xlsx
예산!B2 1000 → 1500 (saved out.xlsx)
예산!B11 4000 → 4500
요약!B2 4400 → 4950
```
Every failure exits `1`. With `--json`, errors are printed to stdout as
`{"ok": false, "error": {"code": ..., "message": ...}}`.
## TUI
Formula bar on top, grid in the middle, sheet tabs and key hints at the bottom.
| Key | Action |
| :--- | :--- |
| Arrows / `h j k l`, `PgUp` `PgDn` `Home` `End` | Move |
| `Enter` / `F2` | Edit the cell (`Enter` saves and recalculates, `Esc` cancels) |
| `Tab` / `Shift+Tab` | Next / previous sheet |
| `f` | Show formulas |
| `?` | Help |
| `q` / `Esc` | Quit |
Mouse: click a cell or sheet tab, scroll with the wheel, drag a column divider to resize.
Hotkeys also work while the Korean 2-beolsik input mode is on.
## MCP
```json
{
"mcpServers": {
"xlsx": { "command": "xlsx", "args": ["mcp", "--root", "/path/to/workbooks"] }
}
}
```
| Tool | Arguments |
| :--- | :--- |
| `xlsx_info` | `path` |
| `xlsx_list_sheets` | `path` |
| `xlsx_get` | `path`, `address`, `mode` (`"values"` \| `"formulas"`) |
| `xlsx_set` | `path`, `address`, `value`, `output_path` (optional) — not offered with `--read-only` |
With `--root`, every `path` / `output_path` is resolved inside that directory; paths that escape it
are refused.
## HTTP API
`xlsx serve` binds to loopback and prints its address and bearer token on stderr. Send the token as
`Authorization: Bearer <token>`.
| Route | Input |
| :--- | :--- |
| `GET /api/info` | `?path=` |
| `GET /api/get` | `?path=&address=&mode=values\|formulas` |
| `POST /api/set` | JSON `{ "path", "address", "value", "output_path"? }` — `403` with `--read-only` |
| `POST /mcp` | Streamable HTTP MCP, same tools as `xlsx mcp` |
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues