Skip to content

Docs

CLI

Markdown version

tk is Hourfinch's command line, built for people and coding agents. It covers every resource in the REST API, prints a table in a terminal and JSON when piped, and has a built-in --jq. It has no dependencies (Node's standard library only) and needs Node 22.12 or newer. Version 0.1.0.

Install

It isn't on the npm registry yet: install the package built from the repository, with npm. Never pipe a script into a shell.

node tools/cli/pack.mjs                                # in the repository: writes apps/cli/dist/timetracking-cli-0.1.0.tgz
npm install -g ./apps/cli/dist/timetracking-cli-0.1.0.tgz
tk --version

Sign in

tk login --host https://api.hourfinch.com

It shows a short code; approve it in your browser (OAuth device flow, nothing to paste). For scripts, use a key from Settings → API keys instead, read from a variable rather than typed on the command line: printf %s "$TK_API_KEY" | tk auth login --host https://api.hourfinch.com --with-key. In CI, set TK_HOST and TK_API_KEY. tk auth status shows who you are; tk auth logout forgets the profile.

Common commands

tk api GET "/v1/work/people?q=sample"
tk api GET /v1/work/people
tk api GET /v1/work/projects
tk api GET /v1/approvals?status=pending
  • Deleting needs --force; --dry-run prints the request instead of sending it.
  • tk agent-context prints, as JSON, what the CLI and your credential can do.

Filter with --jq

tk agents list --jq '.data[] | select(.state == "live") | {id, name}'

The built-in jq covers paths, select, map, comparisons, object and array construction, string interpolation, if/reduce/try, sort_by/group_by/unique_by, to_entries/with_entries, regular expressions and formats such as @csv and @json. It only reads: no assignment, no def, no environment access.

Set up Claude Code

tk install claude-code

It adds the MCP server to the project's .mcp.json and a skill for Claude Code. They reference ${TK_API_KEY}, never the key itself, so set TK_API_KEY to a key from Settings → API keys (the browser sign-in doesn't make one). tk install codex prints the block for Codex's config instead. Quickstarts for other clients: Quickstarts.

Every command

From tk help (version 0.1.0):

tk 0.1.0: the Hourfinch CLI

  tk login --host <api url> [--scope "agents:read …"]  sign in in your browser with a short code (no key to paste)
  tk auth login --host <api url> --key <tk_live_…>     sign in with an API key (or --with-key to read it from stdin)
  tk auth login --host <api url> --client-id <id>      sign in with OAuth (an owner registers the app with
                                                       redirect http://127.0.0.1:8765/callback; --port to change)
  tk auth status | tk auth logout
  tk sandbox create --host <api url> [--agent-name <name>] [--claim-email <person's email>]
                                                       for agents: a sandbox organization and a limited
                                                       key (7 days, no outbound until a person claims it), saved as a profile
  tk api <GET|POST|PATCH|PUT|DELETE> <path> [--field k=v] [--raw-field k=<json>] [--body <json>|@file|-] [--query k=v]
  tk <resource> list [--query k=v] [--limit n] [--all]
  tk <resource> get <id> | create [--field …] | update <id> [--field …] | delete <id> --force
  tk bulk-create <resource> --input <file.json|file.jsonl|-> [--batch <id>]   25 per request; exits 1 if any row fails
  tk runs start <agent> [--input <json>] [--wait]
  tk agent-context                                     what this CLI and your credential can do, as JSON
  tk install claude-code [--dir .]                     add the MCP server (.mcp.json) and a skill for Claude Code
  tk install codex                                     print the Codex config block (writes nothing)

  Output: a table in a terminal, JSON when piped. --json, --output table|json|toon, --fields a,b.c, --jq <program> (a built-in jq).
  --dry-run prints the request instead of sending it. --profile <name>, --host <url>. CI: TK_HOST, TK_API_KEY.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.