Skip to content

CLI commands ​

The package installs one command, sap-ui-automation. Without arguments it is the MCP server on stdio; with a command it does one job and exits.

sh
npx -y sap-ui-automation <command> [options]
# or, after npm i -g sap-ui-automation:
sap-ui-automation <command> [options]
CommandDoesExit code
(none)starts the stdio MCP server: what MCP clients runruns until the client closes it
setupsets up the coding agents found on this machine: the MCP server and the skills0; 1 when cancelled; 2 for an unknown agent or option
init, install, test, show-trace, agent CLIsee the table below
doctorchecks what the server can reach, and says what to change0 ready, 1 not ready
browseropens the SAP window (the Chrome the server starts for Web GUI and Fiori)0; 1 when Chrome could not start
extensioninstalls, pairs or removes the Chrome extension0
sessionslists the SAP sessions found now0; 1 when every surface failed
diag-routerthe network reader's router (SAP GUI without scripting): status, start, stop, run0; 1 when it cannot listen or answers an error; 2 for an unknown subcommand
replayruns recorded tests on an open session, with no model0 all passed, 1 otherwise
exportwrites a recorded test in another format0
--help, -h, helpthe usage and the main settings0
--version, -vthe version0

An unknown command prints the usage and exits with 2. An error (a missing file, a bad flag) prints its message and exits with 1.

Settings are environment variables, the same for the server and the commands: Configuration. doctor, sessions and replay use SAP_SURFACES, SAP_GUI_METHOD, SAP_CHROME_CDP, SAP_ALLOW_SYSTEMS and the other settings as the server would.

The following commands support project setup, testing, and interactive use:

CommandDoesGuide
init [--yes] [--force] [--dry-run]sets a project up: sap.config.ts, sap-tests/example.sap.ts, agent skills, MCP clients, .gitignoreWriting tests
install --skills [--target claude|codex|cursor|all] [--global] [--dry-run]copies the bundled agent skills into this project (default target claude)CLI for coding agents
test [files] [--config f] [--project p] [--reporter list,junit,json,html] [--grep re] [--var name=value] [--retries n] [--list] [--update-locks]runs *.sap.ts testsWriting tests
show-trace <file> [--out <file.html>] [--open]writes a recording or trace as one HTML pageTrace viewer
sessions, look, act, okcode, open, new-session, use, screenshot, record, daemonthe agent CLICLI for coding agents

The server ​

sh
sap-ui-automation

Starts the MCP server on stdin and stdout. MCP clients run this; you do not normally run it yourself. It reads its settings once, at start. It stops when the client closes stdin, or on SIGINT or SIGTERM, and then disconnects from Chrome without closing it.

setup ​

sh
sap-ui-automation setup [<agent>...] [--agent <ids>] [--yes] [--dry-run] [--verbose] [--no-skills] [--no-mcp] [--extension]

Sets up the coding agents on this machine, the way npx skills add does for skills, but with both parts:

  • the MCP server, as sap-ui-automation, in each agent's MCP config;
  • the skills sap-ui-automation, sap-ui-automation-cli, sap-ui-automation-setup and sap-ui-workflow-authoring, in each agent's skills folder, so the agent uses one when a task matches it.

In a terminal it asks which agents to set up: the ones found come first, ticked, then the others under "Not found" (↑/↓ move, space ticks, a ticks all, Enter confirms). Once answered, the list gives way to one line, such as "19 agents selected". With --yes, or when it does not run in a terminal, it prints the agents found on one line and sets up every one. Names given on the command line win over both.

OptionEffect
<agent>...these agents (ids from the table below), found or not
--agent <ids>, -a <ids>the same, comma-separated or repeated; '*' is every agent found
--yes, -yno question: every agent found
--dry-runsay what would change, change nothing (the same summary, with "would")
--verbose, -vone line per agent, with its config file and skills folder, instead of the grouped summary
--no-skillsthe MCP server only
--no-mcpthe skills only
--extensionthrough the Chrome extension: new entries get SAP_BROWSER=extension, an existing entry of ours is switched to it (see below), and the extension's helper is installed too

It prints a short summary, the agents grouped by what they got:

✓ Server and skills  Claude Code, Codex, Cursor, Windsurf, Copilot CLI, Gemini CLI, … (14)
✓ Skills only        Roo Code, Crush, Continue, Kilo Code, Trae
  Server added for 9 agents, already there for 2, switched to the extension for Codex, Cursor and Windsurf
  Skills installed in ~/.agents/skills, linked for 15 agents
✓ Chrome helper      installed

An agent it could not set up is under "Not set up", one it had nothing to do for under "Skipped". Then, only when there is something to do by hand, a "Needs your attention" block, one item per issue with the agents under it: an entry left under the server's old name, with the command that removes it; an entry without SAP_BROWSER=extension that setup does not change; a write or a helper install that failed, with what to do instead. Last, the next steps, numbered. --verbose prints one line per agent instead of the groups, with its config file and skills folder, and the skills' old names removed in each folder.

Colour (a green ✓, a yellow !, dim secondary text) is used only when the output is a terminal and NO_COLOR is not set; the text is the same without it.

--extension and an entry that is already there ​

With --extension, an existing sap-ui-automation entry in a JSON file or in Codex's config.toml gets SAP_BROWSER=extension added to its env and is reported as switched to the extension. Nothing else in the entry or the file changes: its command, its other variables and fields, the other servers. An entry that sets SAP_BROWSER to another value, Goose's YAML file, and an entry in a form setup does not read are left as they are and named under "Needs your attention", with what to add.

Claude Code's entry is read with claude mcp get sap-ui-automation. claude mcp cannot change an entry, and what it prints is not enough to re-add one faithfully, so setup does not touch it: when it lacks the variable, setup gives the command that re-adds it with its own variables kept, claude mcp remove ... && claude mcp add ... -e SAP_BROWSER=extension .... Check its arguments before you run it: an argument with a space reads as two.

The agents ​

AgentIdFound whenMCP serverSkills folder
Claude Codeclaude-codeclaude on the PATHclaude mcp add sap-ui-automation --scope user~/.claude/skills ($CLAUDE_CONFIG_DIR/skills)
Codexcodexcodex on the PATH, or ~/.codex[mcp_servers.sap-ui-automation] in ~/.codex/config.toml ($CODEX_HOME)~/.agents/skills
Claude Desktopclaude-desktopits folder (macOS ~/Library/Application Support/Claude, Windows %APPDATA%\Claude)mcpServers in claude_desktop_config.jsonnone
Cursorcursor~/.cursor, or .cursor/mcp.json in the projectmcpServers in the project's .cursor/mcp.json when it exists, else ~/.cursor/mcp.json~/.agents/skills
Windsurf (Devin Desktop)windsurf~/.config/devin (%APPDATA%\devin) or ~/.codeium/windsurfmcpServers in ~/.config/devin/mcp_config.json~/.agents/skills
VS Code (GitHub Copilot)vscode.vscode/mcp.json in the projectservers in the project's .vscode/mcp.json~/.copilot/skills
GitHub Copilot CLIcopilot-clicopilot on the PATH, or ~/.copilotmcpServers in ~/.copilot/mcp-config.json ($COPILOT_HOME)~/.copilot/skills
Gemini CLIgemini-cligemini on the PATH, or ~/.gemini/settings.jsonmcpServers in ~/.gemini/settings.json~/.gemini/skills
Antigravityantigravity~/.gemini/antigravitymcpServers in ~/.gemini/config/mcp_config.json~/.gemini/config/skills
OpenCodeopencodeopencode on the PATH, or ~/.config/opencodemcp.servers in ~/.config/opencode/opencode.json (or .jsonc)~/.config/opencode/skills
Clineclinecline on the PATH, or ~/.clinemcpServers in ~/.cline/data/settings/cline_mcp_settings.json~/.agents/skills
Roo Coderoo~/.roonot written (see below)~/.roo/skills
Kirokirokiro-cli on the PATH, or ~/.kiromcpServers in ~/.kiro/settings/mcp.json~/.kiro/skills
Zedzed~/.config/zed (Windows %APPDATA%\Zed)context_servers in its settings.json~/.agents/skills
Goosegoosegoose on the PATH, or ~/.config/goose (Windows %APPDATA%\Block\goose\config)an extensions: entry in config.yaml~/.config/goose/skills
Ampampamp on the PATH, or ~/.config/ampamp.mcpServers in ~/.config/amp/settings.json (or .jsonc)~/.config/agents/skills
Juniejuniejunie on the PATH, or ~/.juniemcpServers in ~/.junie/mcp/mcp.json~/.junie/skills
Warpwarp~/.warpmcpServers in ~/.warp/.mcp.json (not on Windows)~/.agents/skills
Qwen Codeqwen-codeqwen on the PATH, or ~/.qwenmcpServers in ~/.qwen/settings.json~/.qwen/skills
Factory Droiddroiddroid on the PATH, or ~/.factorymcpServers in ~/.factory/mcp.json~/.factory/skills
Crush, Augment, Continue, Kilo Code, Traecrush, augment, continue, kilo, traetheir folder in the home foldernot written~/.config/crush/skills, ~/.augment/skills, ~/.continue/skills, ~/.kilo/skills, ~/.trae/skills

~ is the home folder (%USERPROFILE% on Windows); ~/.config is $XDG_CONFIG_HOME when it is set. Each MCP format comes from the agent's own documentation. Where that documentation does not give the file (Roo Code keeps its in VS Code's storage) or the format (Crush now reads a crushrc file), setup installs the skills only: add the server in the agent's MCP settings with the command setup prints. The Cline file is the one its docs name for the Cline CLI; the VS Code extension may keep its own list.

How the skills are installed ​

One real copy goes to ~/.agents/skills/<name>, which Codex, Cursor, Windsurf, Cline, Zed and Warp read. Every other agent's folder gets a link to it (a junction on Windows). Where no link can be made, the folder gets a copy instead, and the summary says so. Agents that share a folder are written once. Running setup again updates the copy in place and leaves the links.

Each copy holds a .sap-ui-automation marker. A folder of the same name that is not from this package is never replaced or removed. Copies under the skills' old names (sap-gui-drive, sap-gui-cli) are removed only when they are this package's.

For an agent setup does not know, npx skills add DidroAI/sap-ui-mcp installs the same skills.

What it never does ​

  • It never replaces an existing sap-ui-automation entry; with --extension it only adds SAP_BROWSER=extension to its env (see above).
  • It keeps the rest of a config file as it was: other servers, settings, comments (in the JSON files that allow them) and layout.
  • It keeps a .bak copy of a config file before it first changes it.
  • A file it cannot read safely is left alone, with the entry to add by hand.
  • It names an entry left under the server's old names (sap-gui-mcp-server, sap-gui) and says how to remove it.
  • It adds no settings: the server starts with SAP_WRITE=on, the default. Add variables in the agent's configuration.

The command it writes depends on how it was started: npx -y sap-ui-automation when run through npx, sap-ui-automation when installed on the PATH, else Node with the path of the script. On Windows it is wrapped in cmd /c.

doctor ​

sh
sap-ui-automation doctor [--extension]

Checks what the server can reach on this machine: one block per area, one line per check (✓ passed, ✗ failed, – not checked), and under a failed check its fix after →. Then the Route block (the SAP window, your Chrome over CDP, the extension, SAP GUI scripting): one read of the current SAP screen puts each route at 1/4 installed, 2/4 waiting for sign-in, 3/4 attached or 4/4 first screen read (with the transaction, the title and the time it took). A route before 4/4 has one → next step under it; when a failed check holds it back, that check's fix is this step, said only there. Then the Writes block: SAP_WRITE as this shell sets it. Nothing is wrapped, and paths in your home folder start with ~. The last line is Ready. once a route has read a screen, else Not ready yet: do the → step above, then run doctor again. The exit code is 0 when the checks pass. Doctor opens nothing and never logs on. --extension checks the route setup --extension set up. setup ends with the same Route block, looked at without waiting (its next step is under Next), and a Writes block with the mode each agent's MCP entry gives.

AreaChecks
Chrome, launch (default)Chrome found; whether the SAP window runs; then its tabs
Chrome, extensionthe extension connected (it waits up to 35 s), paired; then the tabs it shares
SAP GUI for Windows, scripting (unless SAP_GUI_METHOD=diag)PowerShell may run the host; SAP GUI is running; scripting is on in SAP GUI; scripting is allowed on the SAP system; the two "notify" options are off
SAP GUI for Windows, network reader (unless SAP_GUI_METHOD=scripting)the local router listens; connections go through it; decoding (bytes lost, what was not read, SNC); the router's messages
Chrome, attach or SAP_CHROME_CDPChrome reachable, its version, SAP_ALLOW_ORIGINS, open tabs; the Web GUI and Fiori tabs found

With SAP_GUI_METHOD unset (auto), both ways of reading SAP GUI are checked, and either one that works is enough. On a machine other than Windows, SAP GUI for Windows is listed as not checked. In attach mode, if Chrome asks whether to allow remote debugging, click Allow.

Every failed check, its cause and its fix: FAQ and troubleshooting.

browser ​

sh
sap-ui-automation browser [--wait]

Opens the SAP window: the Chrome window the server starts for Web GUI and Fiori in the default browser mode (SAP_BROWSER=launch), with a profile of its own. Open your SAP address there and log on once. If the window is already open, it says so. The agent opens the same window by itself when it needs SAP, so this command is optional. See Chrome.

OptionEffect
--waitstay running with the SAP window until stopped (Ctrl+C, docker stop), serving its DevTools when SAP_CHROME_INSPECT is set: a container that keeps the logon between agent sessions. See Docker

With SAP_CHROME_HEADLESS=on the window has no screen: log on through chrome://inspect (Docker).

extension ​

sh
sap-ui-automation extension install [dir]
sap-ui-automation extension helper
sap-ui-automation extension pair
sap-ui-automation extension uninstall [dir]
CommandDoes
install [dir]copies the Chrome extension to dir (default ~/sap-ui-automation-extension) to load with Load unpacked, and installs its helper: the extension then pairs in one click and keeps saved SAP passwords in the keychain
helperinstalls only the helper, for the extension installed from the Chrome Web Store
pairprints the pairing code, to pair the extension by hand
uninstall [dir]removes the helper from every browser, the SAP passwords it saved, and the copied extension

Guide: Use your everyday Chrome with the extension.

sessions ​

sh
sap-ui-automation sessions

Lists the SAP sessions the server finds now, in the format of the sap_sessions tool (MCP tools), then exits. Problems of a surface (SAP GUI scripting off, no Chrome) go to stderr. It exits with 1 only when every surface failed: that is a setup problem, not "nothing open".

diag-router ​

sh
sap-ui-automation diag-router status|start|stop|run

The network reader's DIAG router: the local SAProuter on 127.0.0.1:3298 (SAP_DIAG_PORT) that a routed SAP Logon entry goes through. It is a background process of its own, one per user and port, shared by every server, the CLI daemon and doctor; the first of them that needs it starts it. See The router's lifetime.

SubcommandDoesExit code
statuswho owns the router (pid, version, start time, who started it), the readers attached, the transport (DIAG; SNC is relayed, not read), each connection with its system, client, user and sessions, how the decoding went, and the idle policy. With no router it says so, and on a Remote Desktop, Citrix or SSH session why servers do not start one0; 1 when the router answers an error
startstarts the router when none runs, with this shell's SAP_DIAG_PORT, SAP_DIAG_CAPTURE and SAP_DIAG_IDLE, then prints its status. On a Remote Desktop, Citrix or SSH session without SAP_DIAG_PORT it warns that other users' routed entries reach it0 when it listens; 1 when it cannot (the port is taken)
stopstops it: the SAP GUI logons through it drop. The next reader that needs a router starts a new one; then log on again0; 1 when the router answers an error
runruns the router in this terminal, its messages on stderr, until Ctrl+C0 when stopped, or when one runs already

SAP_DIAG_PORT names the router's port (default 3298): set it as the server that reads through it does. A port that is not a number, and an unknown subcommand, exit with 2.

replay ​

sh
sap-ui-automation replay <file>... [--var name=value]... [--session <ref>] [--loose] [--continue] [--stay] [--json] [--junit <file>]

Runs recorded tests (.saptest.json) on a session you have open, with no model, under the same guard as sap_act. It never logs on.

OptionEffect
<file>...one or more recordings. Several run in order on one session; each hands its variables, captured ones included, to the next. The run stops at the first test that fails
--var name=valuea value for a test variable; repeat for several. A name no test has is an error
--session <ref>the session: number, id, system, transaction or surface, as in sap_use. Omitted: the first one found. An unavailable explicit target fails; list sessions and verify the intended id before retrying
--looselanding on another screen than recorded is a note, not a failure
--continueon a screen with a choice the recording does not have (availability control), press its neutral Continue and say so
--stayafter a failure, stay on the failing screen. Default: leave the transaction with /n (unsaved input is dropped)
--jsonthe results as JSON
--junit <file>also write JUnit XML: one suite per test, one case per step

Under SAP_WRITE=off a step that may write is refused. Guide: Recording and replay.

export ​

sh
sap-ui-automation export <file> --to <target> [--out <file>] [--force]

Writes one recording in another format.

TargetFileFor
calm.calm.jsonSAP Cloud ALM manual test case, as the input of a Cloud ALM MCP server's calm_create_test_case tool
vbs.vbsSAP GUI scripting (VBScript), for SAP GUI for Windows
playwright.spec.tsPlaywright test for Web GUI (@playwright/test)
playwright-sap.psap.spec.tsPlaywright test with playwright-sap's locateSID
sap-ts.sap.tsa test for the SDK's test runner (Writing tests)
gherkin.featureGherkin feature (Given / When / Then step list)
OptionEffect
--to <target>required: one of the targets above
--out <file>where to write. - prints to stdout. Default: next to the recording, with the target's suffix in place of .saptest.json
--forcewrite over a file that is there (an earlier export, perhaps edited, or a workflow). Without it the export fails and the file is kept

It prints the path written.

MIT licence. Independent open-source project, not affiliated with, endorsed by or sponsored by SAP SE. SAP and SAP Cloud ALM are trademarks of SAP SE.