Skip to content

Your first timesheet from the terminal

Tutorial

In this tutorial you run the tool from a terminal: you sign in, list the days of the month, preview a booking, write it, and check the result. You need Node.js 20 or newer (node --version tells you) and a company account on the SAP portal.

We use npx, which downloads and runs the published package without installing anything permanently. Every command below therefore starts with npx -y -p sap-fiori-timesheet-mcp. If you would rather have a plain xflow-timesheet command on your PATH, see Install the CLI first and drop that prefix.

  1. Run:

    Terminal window
    npx -y -p sap-fiori-timesheet-mcp xflow-timesheet sso
  2. The first run downloads a headless browser (about 150 MB). Then a browser window opens with your company’s sign-in page. Type your email and password there, answer the two-factor prompt, and answer Yes to “Stay signed in?” if asked.

  3. When the SAP launchpad loads, the window closes and the command prints something like:

    Signed in (interactive: signed in in the browser window). 3 cookie(s) saved to ~/.config/xflow-timesheet/session.json; identity kept in ~/.config/xflow-timesheet/profile

Check that the session works:

Terminal window
npx -y -p sap-fiori-timesheet-mcp xflow-timesheet whoami

It prints your SAP user, name, client and the host it talked to.

Terminal window
npx -y -p sap-fiori-timesheet-mcp xflow-timesheet std days

Every working day of the current month is listed as filled or MISSING, with target, booked and missing hours and the entries already there:

date state target booked missing entries
2026-09-01 filled 8 8 0 8h AI Incubator - NovaLabs (900140) · NCH-Order BAP (0081)
2026-09-02 MISSING 8 4 4 4h Administration (0077)
2026-09-03 MISSING 8 0 8
1 filled, 21 missing (172h)

Pick a day marked MISSING.

std set makes a day contain exactly one item. With --dry-run it only prints the plan:

Terminal window
npx -y -p sap-fiori-timesheet-mcp xflow-timesheet std set 2026-09-15 --attendance-type 0077 --hours 8 --dry-run

The output shows what would be removed on that day and what would be created. Nothing is written.

Run the same command without --dry-run:

Terminal window
npx -y -p sap-fiori-timesheet-mcp xflow-timesheet std set 2026-09-15 --attendance-type 0077 --hours 8

The per-day result is printed with the new entry’s counter and status. Exit code 0 means everything was accepted.

Terminal window
npx -y -p sap-fiori-timesheet-mcp xflow-timesheet std days

The day now shows as filled.

  • sso signs you in once; later commands renew the session silently.
  • std days is the overview; std set writes; --dry-run previews.
  • Put xflow-timesheet on your PATH and register the MCP server for your editor: Install the CLI and Other MCP clients.
  • All commands, options and defaults: CLI reference.
  • Run npx -y -p sap-fiori-timesheet-mcp xflow-timesheet doctor whenever something looks off; it checks Node, the session, the browser and the MCP registrations.