Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计异常

excel-cliExcel CLI 搜索

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

14,786

周安装

604

GitHub Stars

146

下载量

4,735
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:excel-cli(Excel CLI 搜索)
来源仓库:https://github.com/sbroenne/mcp-server-excel
仓库路径:skills/excel-cli
安装命令:
npx skills add https://github.com/sbroenne/mcp-server-excel --skill excel-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sbroenne/mcp-server-excel --skill excel-cli

简介

通过 CLI 使用 50 多个工作簿、表格、图表和 Power Pivot 命令在 Windows 上自动化 Microsoft Excel。

  • 使用 COM 互操作的仅限 Windows 的工具;需要安装 Excel 2016+;通过 dotnet tool install --global Sbroenne.ExcelMcp.CLI 安装
  • 支持 10 多个命令类别:工作表、范围、表格、图表、数据透视表、Power Query、数据模型/DAX、VBA 和条件格式
  • 批处理模式可在单个会话中处理 10 多个命令,并自动捕获会话 ID,从而消除每个命令的开销
  • 内置会话生命周期管理、批量写入的计算模式控制以及用于可视化验证的屏幕截图

SKILL.md

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

StepCommandWhen
1. Sessionsession create/openAlways first
2. Sheetsworksheet create/renameIf needed
3. Write dataSee belowIf writing values
4. Save & closesession close --saveAlways 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 ASKDO 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:

# 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.

# 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:

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

# Step 1: Create/open a session and capture the session ID
$session = excelcli -q session create C:\path\file.xlsx | ConvertFrom-Json
$sessionId = $session.sessionId

# Step 2: Test M code without persisting (catches errors early)
excelcli -q powerquery evaluate --session $sessionId --m-code-file query.m

# Step 3: Create permanent query with validated code
excelcli -q powerquery create --session $sessionId --query-name Q1 --m-code-file query.m

# Step 4: Load data to destination
excelcli -q powerquery refresh --session $sessionId --query-name Q1

# Step 5: Close session
excelcli -q session close --session $sessionId --save

Rule 6: Report File Errors Immediately

If you see "File not found" or "Path not found" - STOP and report to user. Don't retry.

Rule 7: Use Calculation Mode for Bulk Writes

When writing many values/formulas (10+ cells), disable auto-recalc for performance:

# 1. Create/open a session and capture the session ID
$session = excelcli -q session create C:\path\file.xlsx | ConvertFrom-Json
$sessionId = $session.sessionId

# 2. Set manual mode
excelcli -q calculationmode set-mode --session $sessionId --mode manual

# 3. Write data row by row for reliability
excelcli -q range set-values --session $sessionId --sheet-name Sheet1 --range-address A1:B1 --values '[["Name","Amount"]]'
excelcli -q range set-values --session $sessionId --sheet-name Sheet1 --range-address A2:B2 --values '[["Salary",5000]]'

# 4. Recalculate once at end
excelcli -q calculationmode calculate --session $sessionId --scope workbook

# 5. Restore automatic mode
excelcli -q calculationmode set-mode --session $sessionId --mode automatic

# 6. Close session
excelcli -q session close --session $sessionId --save

Rule 8: Use Batch Mode for Bulk Operations (10+ commands)

When executing 10+ commands on the same file, use excelcli batch to send all commands in a single process launch. This avoids per-process startup overhead and terminal buffer saturation.

# Create a JSON file with all commands
@'
[
  {"command": "session.open", "args": {"filePath": "C:\\path\\file.xlsx"}},
  {"command": "range.set-values", "args": {"sheetName": "Sheet1", "rangeAddress": "A1", "values": [["Hello"]]}},
  {"command": "range.set-values", "args": {"sheetName": "Sheet1", "rangeAddress": "A2", "values": [["World"]]}},
  {"command": "session.close", "args": {"save": true}}
]
'@ | Set-Content commands.json

# Execute all commands at once
excelcli -q batch --input commands.json

Key features:

  • Session auto-capture: session.open/create result sessionId auto-injected into subsequent commands — no need to parse and pass session IDs
  • NDJSON output: One JSON result per line: {"index": 0, "command": "...", "success": true, "result": {...}}
  • --stop-on-error: Exit on first failure (default: continue all)
  • --session <id>: Pre-set session ID for all commands (skip session.open)

Input formats:

  • JSON array from file: excelcli -q batch --input commands.json
  • NDJSON from stdin: Get-Content commands.ndjson | excelcli -q batch

CLI Command Reference

Full reference: See CLI command reference and common pitfalls, or run excelcli <command> --help for live help from the installed runtime.

Syntax rule: CLI commands use excelcli -q <command> <action> --session <id> --kebab-case-flags.... Do not use MCP call syntax such as range(action:...), snake_case parameters, or underscore tool names. The CLI command names remove MCP underscores: calculation_mode becomes calculationmode, range_format becomes rangeformat, chart_config becomes chartconfig, and data_model becomes datamodel.

Available command groups:

session, batch, service, calculationmode, chart, chartconfig, conditionalformat, connection, datamodel, datamodelrelationship, diag, namedrange, pivottable, pivottablecalc, pivottablefield, powerquery, range, rangeedit, rangeformat, rangelink, screenshot, sheet, worksheetstyle, slicer, table, tablecolumn, vba, window

Common Pitfalls

See CLI command reference and common pitfalls for examples. Key issues:

  • --values-file expects a path to an existing file; use --values for inline JSON.
  • --timeout must be a positive integer; omit it to use the default timeout.
  • --values takes a 2D JSON array such as '[["Name","Age"],["Alice",30]]'.
  • List parameters such as --selected-items require JSON arrays.
  • Power Query operations can take 30+ seconds; use generous timeouts.

Reference Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.87%
按下载量换算1,698

Claude

31.34%
按下载量换算1,484

Cursor

18.92%
按下载量换算896

Gemini CLI

9.38%
按下载量换算444

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/sbroenne/mcp-server-excel --skill excel-cli 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills