
Excel Cli
Automate Windows Excel workbooks from the command line or PowerShell for batch edits, CI jobs, and low-token agent-driven excelcli sessions.
Overview
Excel CLI is an agent skill most often used in Build (also Operate) that automates Windows Excel workbooks via excelcli for scripting, batch jobs, and unattended agent workflows.
Install
npx skills add https://github.com/sbroenne/mcp-server-excel --skill excel-cliWhat is this skill?
- Four-step workflow checklist: session create/open → worksheets → write data → session close --save
- Supports Power Query, DAX, PivotTables, Tables, Ranges, Charts, VBA, Data Models, screenshots, formatting
- Reliable writes: one row at a time via --values JSON 2D arrays
- Rule 8: 10+ commands → excelcli -q batch --input commands.json for single-process runs
- Windows + Excel 2016+ only; Copilot plugin can auto-download runtime, else excelcli.exe on PATH
- 4-step workflow checklist (session → sheets → write → close)
- Batch mode recommended for 10+ commands (Rule 8)
Adoption & trust: 702 installs on skills.sh; 186 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need repeatable Excel changes at scale but GUI macros or fat MCP transcripts burn time, tokens, and attention.
Who is it for?
Windows-based solo builders automating reports, imports, or bulk workbook surgery with excelcli, PowerShell, or CI schedules.
Skip if: macOS/Linux hosts, machines without licensed Excel 2016+, or purely manual one-cell edits faster in the UI.
When should I use this skill?
Token-efficient scriptable or unattended Excel automation via excelcli—CI/CD, scheduled jobs, PowerShell, bulk edits; triggers include excelcli, batch, automation, coding agent workbook processing.
What do I get? / Deliverables
Saved workbooks after a disciplined session/batch command sequence suitable for PowerShell, CI, or agent scripts on Windows.
- Saved .xlsx (or related) workbook after session close --save
- Optional batch commands.json for multi-step runs
- Updated sheets, tables, pivots, charts, or captures per command script
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Primary shelf is Build when you integrate excelcli into scripts, agents, or pipelines that create and mutate workbooks programmatically. Integrations captures COM-based excelcli as the external automation surface distinct from hand-editing in the Excel UI.
Where it fits
Agent opens a session, adds worksheets, writes header rows via --values, and closes with --save for a deliverable xlsx.
Refresh Power Query and DAX measures in a model workbook as part of a data pipeline handoff.
Nightly scheduled job runs excelcli -q batch against commands.json to update pivot reports.
Batch-format charts and screenshots for recurring stakeholder decks exported from templates.
How it compares
Command-line excelcli batching for agents—not spreadsheet MCP chat for every cell on non-Windows platforms.
Common Questions / FAQ
Who is excel-cli for?
Coding agents and developers on Windows who need scriptable Excel automation for batch processing, PowerShell, or CI/CD.
When should I use excel-cli?
In Build when integrating workbook automation into apps or agent scripts, and in Operate when running scheduled or unattended excelcli batch jobs; also when you have 10+ commands and want commands.json batch mode.
Is excel-cli safe to install?
It executes COM automation against local workbooks; review the Security Audits panel on this page and restrict which files and VBA macros the agent can touch.
SKILL.md
READMESKILL.md - Excel Cli
# Excel Automation with excelcli ## Preconditions - Windows host with Microsoft Excel installed (2016+) - Uses COM interop — does NOT work on macOS or Linux - GitHub Copilot `excel-cli` plugin auto-downloads the latest Windows runtime on first use - Direct skill-only installs require `excelcli.exe` on PATH ## Workflow Checklist | Step | Command | When | |------|---------|------| | 1. Session | `session create/open` | Always first | | 2. Sheets | `worksheet create/rename` | If needed | | 3. Write data | See below | If writing values | | 4. Save & close | `session close --save` | Always last | > **10+ commands?** Use `excelcli -q batch --input commands.json` — sends all commands in one process with automatic session management. See Rule 8. **Writing Data (Step 3):** - `--values` takes a JSON 2D array string: `--values '[["Header1","Header2"],[1,2]]'` - Write **one row at a time** for reliability: `--range-address A1:B1 --values '[["Name","Age"]]'` - Strings MUST be double-quoted in JSON: `"text"`. Numbers are bare: `42` - Always wrap the entire JSON value in single quotes to protect special characters ## CRITICAL RULES (MUST FOLLOW) > **⚡ Building dashboards or bulk operations?** Skip to **Rule 8: Batch Mode** — it eliminates per-command process overhead and auto-manages session IDs. ### Rule 1: NEVER Ask Clarifying Questions Execute commands to discover the answer instead: | DON'T ASK | DO THIS INSTEAD | |-----------|-----------------| | "Which file should I use?" | `excelcli -q session list` | | "What table should I use?" | `excelcli -q table list --session <id>` | | "Which sheet has the data?" | `excelcli -q worksheet list --session <id>` | **You have commands to answer your own questions. USE THEM.** ### Rule 2: Always End With a Text Summary **NEVER end your turn with only a command execution.** After completing all operations, always provide a brief text message confirming what was done. Silent command-only responses are incomplete. ### Rule 3: Session Lifecycle **Creating vs Opening Files:** ```powershell # NEW file - use session create excelcli -q session create C:\path\newfile.xlsx # Creates file + returns session ID # EXISTING file - use session open excelcli -q session open C:\path\existing.xlsx # Opens file + returns session ID ``` **CRITICAL: Use `session create` for new files. `session open` on non-existent files will fail!** **CRITICAL: ALWAYS use the session ID returned by `session create` or `session open` in subsequent commands. NEVER guess or hardcode session IDs. The session ID is in the JSON output (e.g., `{"sessionId":"abc123"}`). Parse it and use it.** ```powershell # Example: capture session ID from output, then use it excelcli -q session create C:\path\file.xlsx # Returns JSON with sessionId excelcli -q range set-values --session <returned-session-id> ... excelcli -q session close --session <returned-session-id> --save ``` **Unclosed sessions leave Excel processes running, locking files.** ### Rule 4: Data Model Prerequisites DAX operations require tables in the Data Model: ```powershell excelcli -q table add-to-data-model --session <id> --table-name Sales # Step 1 excelcli -q datamodel create-measure --session <id> ... # Step 2 - NOW works ``` ### Rule 5: Power Query Development Lifecycle **BEST PRACTICE: Test M code before creating permanent queries** ```powershell # Step 1: Create/open a se