Skip to main content
AI Agents CLITimesheet
CLI and skill

Track Time with AI Agents and the Timesheet CLI

  • Works in any agent that can run shell commands
  • The Timesheet skill tells the agent which commands to use
  • `--json` output that agents and scripts can read
Start your 30-day trial

No credit card required. Cancel anytime.

The Timesheet CLI (@timesheet/cli) gives any agent with a shell access to your Timesheet account, and the Timesheet skill teaches the agent how to use it. The CLI works as the account you sign in with, so the agent only reaches what that account can see. Does your agent support MCP servers? Then see the Timesheet MCP server. For a ready-made setup, see Claude Code or Hermes Agent.

How do I give my agent the Timesheet CLI?

Paste the prompt below into your agent. It installs the CLI, starts the browser sign-in and adds the Timesheet skill. The skill follows the Agent Skills format (SKILL.md), which many agents load. On a machine without a browser, use an API key with Option 2.

Option 1 · about two minutes

Paste this into your agent

The agent runs the install and sign-in commands, adds the skill and checks the connection. You approve the sign-in in your browser.

New message to your agent

Set up the Timesheet CLI so you can track my time. 1. Run: npm install -g @timesheet/cli 2. Run: timesheet auth login and tell me to finish the sign-in in the browser. 3. Run: npx skills add timesheetIO/timesheet-plugin 4. Then run timesheet timer status --json and tell me what it shows.

If your agent does not use skills.sh, timesheet skill install writes the skill to ~/.claude/skills/timesheet, or to a folder of your choice with --path <dir>.

Option 2 · headless and CI

Sign in with an API key

Create a key in the Timesheet web app under Integrations > API Keys > New API Key. Store it in the CLI once, or set it as an environment variable in CI.

Terminal
npm install -g @timesheet/cli

# Store the key in the CLI
timesheet auth apikey --set <your-api-key>

# Or set it for this shell or CI job
export TIMESHEET_API_KEY=<your-api-key>

timesheet auth status

The key acts as your account. Keep it in your CI secrets, not in the repository.

Ask your agent to track time for you

You: Start the timer for Website redesign and note that I'm on the checkout flow.

AI Agents CLI: I looked up Website redesign with `timesheet projects list --search website --json` and started the timer at 09:14 with the description "checkout flow". Say stop when you're done and I'll run `timesheet timer stop`.

via Timesheet
Also try
  • What did I track today?
  • Log 90 minutes on the API refactor for yesterday
  • Export last month as a PDF

Step by step

  1. 1Install Node.js, then run npm install -g @timesheet/cli
  2. 2Sign in with timesheet auth login, or store an API key with timesheet auth apikey --set <key>
  3. 3Add the skill with npx skills add timesheetIO/timesheet-plugin or timesheet skill install
  4. 4Check the connection with timesheet auth status and timesheet timer status
  5. 5Ask your agent what to start, stop or log. The entries appear in every Timesheet app right away

CLI and skill vs MCP server: which one should my agent use?

Both reach the same Timesheet account. The CLI suits agents that live in a shell. The MCP server suits agents and apps that load tool servers.

QuestionCLI and skillMCP server
What the agent needsA shell and Node.jsMCP support
How it signs intimesheet auth login in the browser, or an API keyOAuth in the browser, or an API key as a bearer token
Where the sign-in is kept~/.timesheet-cli/, shared by every agent on the machineIn each client's own settings
How the agent finds a projecttimesheet projects list --search <name>, then the project IDBy name, in the same tool call
OutputTables, tab-separated text when piped, or --jsonTool results, and cards in clients that support MCP Apps
Works in scripts and CIYes, with exit codes and --jsonOnly through an MCP client
Best forTerminal agents, scripts and automationChat apps, IDEs and agents with MCP settings

Recommendation: Use the MCP server when your agent supports it. Use the CLI and skill for agents that only run commands, and for scripts. The skill uses the MCP tools when they are there and the CLI otherwise, so you can install both.

What can an agent do with the Timesheet CLI?

The CLI covers the same areas as the MCP server, from the timer to HR data. Every command takes --json and --help.

  • Timer

    timesheet timer start <project-id>, pause, resume, stop and status, with -d for a description.

  • Time entries

    List today's entries with timesheet tasks list --today, or add one with start and end times with timesheet tasks create.

  • Reports and exports

    timesheet reports summary --this-month, and exports as Excel, CSV or PDF with timesheet reports export, saved, linked or emailed.

  • JSON for scripts

    --json gives machine-readable output. Exit codes tell an auth error (3) from an API error (4) or a rate limit (5).

  • Absences and contracts

    List, request, approve and reject absences, and manage contracts, when your account has those rights.

  • One skill for many agents

    The skill follows the SKILL.md format, so Claude Code, Codex, Cursor, OpenCode, Hermes and other agents can load it.

How does the CLI talk to Timesheet?

The CLI calls the Timesheet API at api.timesheet.io with your sign-in. The skill is a SKILL.md file that lists the commands, so the agent knows which one to run for a request.

What happens after the prompt

  1. The agent installs @timesheet/cli with npm
  2. timesheet auth login opens the browser, and the CLI saves the sign-in in ~/.timesheet-cli/
  3. The skill tells the agent which commands fit a request such as starting a timer
  4. The agent runs the command, often with --json, and reads the result
  5. The entry is saved to your account and syncs to every Timesheet app
Timesheet CLI for agents
# Find a project and start the timer
timesheet projects list --search website --json
timesheet timer start <project-id> -d "checkout flow"
timesheet timer stop

# Log finished work
timesheet tasks create -p <project-id> \
  -s "2026-11-27 09:00" -e "2026-11-27 11:00"

# Hours and exports
timesheet reports summary --this-month --json
timesheet reports export --last-month -f pdf -o hours.pdf

# Optional: a default project for the timer
timesheet config set defaultProjectId <project-id>

Read more in the CLI on npm or the skill repository.

What can I ask my agent?

Anything you'd tell a colleague who keeps your timesheet. Name the project, the time and what you did.

  • From your repo

    Log the work from the commits

    “Look at my commits since 9am and log the time on Website redesign with a short description of what changed.”

  • Start of day

    Set a default project

    “Find my project Website redesign and set it as the default project for the timer.”

  • Scripts

    Write a daily check

    “Write a shell script that prints today's tracked hours from the Timesheet CLI as JSON and warns when the timer is still running at 18:00.”

  • Billing

    Prepare an export

    “Export last month's billable hours for Acme as a PDF and email it to me.”

Cost, security and troubleshooting

What does it cost?

The CLI and the skill cost nothing extra. They use the Timesheet API, which is part of the Pro plan and above. Every plan starts with a 30-day trial, no credit card required.

Compare plans →

How is access secured?

timesheet auth login uses OAuth 2.1 with PKCE, so no password goes into the agent's context. Every agent on the machine shares the sign-in in ~/.timesheet-cli/. Sign out with timesheet auth logout. An API key acts as your account: delete it under Integrations > API Keys to revoke it.

Something not working?

  • Command not found: check that the npm global folder is on your PATH, then run timesheet --version.
  • Authentication error (exit code 3): run timesheet auth status, then timesheet auth login again or store a new key.
  • "Project ID is required": timer start takes a project ID. Find it with timesheet projects list --search <name>, or set a default project.
  • The agent ignores the skill: check that it was installed for your agent, then start a new session.
  • A feature is refused: your plan may not include it. Compare the plans.

Frequently asked questions

Which agents can use the Timesheet CLI?

Any agent that can run shell commands, such as Claude Code, Codex, Cursor, OpenCode, Hermes Agent and OpenClaw. The skill helps, but the agent can also read timesheet --help.

How do I install the skill?

Run npx skills add timesheetIO/timesheet-plugin for agents that skills.sh supports, or timesheet skill install for Claude Code. Use timesheet skill install --path <dir> for another skills folder.

Do I need an API key?

No. timesheet auth login signs you in through the browser. Use an API key for CI and machines without a browser, with timesheet auth apikey --set <key> or the TIMESHEET_API_KEY variable.

How do agents read the output?

Add --json to any command for machine-readable output. When the output is piped, the CLI prints tab-separated text instead of tables.

Should I use the CLI or the MCP server?

Use the MCP server when your agent supports it, because it finds projects by name and needs nothing installed. Use the CLI for agents that only run commands and for scripts.

Which plan do I need?

The Pro plan or above, because the CLI uses the Timesheet API. Start with a 30-day trial, no credit card required.

Can I use the CLI in CI?

Yes. Set TIMESHEET_API_KEY as a secret in the job. The exit codes tell the job whether a command failed because of sign-in, the API, a rate limit or the network.

Give your agent the Timesheet CLI

One install, one sign-in, and any agent with a shell can keep your timesheet.

Start your 30-day trial

No credit card required. Cancel anytime.