Servicetitan pricebook

From mvanhorn/printing-press-library · View interactive version

Servicetitan pricebook is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. A focused per-module ServiceTitan CLI for the Pricebook — sync once, then audit markup, costs, vendor parts, and warranties the ST UI cannot. Trigger phrases: `use servicetitan-pricebook`, `run servicetitan-pricebook`, `sync the pricebook`, `check markup drift`, `reconcile a vendor quote`, `update p

How to use this skill

Skill file

ServiceTitan Pricebook — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the servicetitan-pricebook-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install servicetitan-pricebook --cli-only

```

  1. Verify: servicetitan-pricebook-pp-cli --version
  2. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/sales-and-crm/servicetitan-pricebook/cmd/servicetitan-pricebook-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

When to Use This CLI

Use this CLI when an agent or operator needs to inspect or maintain the ServiceTitan Pricebook — costs, prices, markup tiers, vendor part numbers, warranty text, category taxonomy — without loading the 600+-tool general ST MCP. It is the right choice for margin-discipline checks after vendor cost changes, vendor-quote reconciliation, and pricebook hygiene audits. Run sync first; the novel audit commands read the local store.

Unique Capabilities

These capabilities aren't available in any other tool for this API.

Margin discipline

_Reach for this after any vendor cost change to catch SKUs that are now mispriced for their tier before margin erodes._

```bash

servicetitan-pricebook-pp-cli markup-audit --tolerance 5 --agent

```

_Reach for this to see whether recent vendor cost increases were actually passed through to price._

```bash

servicetitan-pricebook-pp-cli cost-drift --since 2026-04-01 --agent

```

_Reach for this after markup-audit to apply hold-markup pricing in one pass instead of editing each SKU by hand._

```bash

servicetitan-pricebook-pp-cli reprice --tolerance 5 --agent

```

Pricebook hygiene

_Reach for this to enforce the 2M Part # discipline before a vendor-quote reconcile, which matches on vendor part._

```bash

servicetitan-pricebook-pp-cli vendor-part-gaps --kind material --agent

```

_Reach for this to keep warranty attribution honest — manufacturer warranties clearly labeled, JKA's own offering listed alongside._

```bash

servicetitan-pricebook-pp-cli warranty-lint --agent

```

_Reach for this during category taxonomy cleanup to find SKUs that fell out of the visible tree._

```bash

servicetitan-pricebook-pp-cli orphan-skus --agent

```

_Reach for this to find redundant parts before they multiply — duplicate SKUs scatter estimates and inventory across entries that should be one._

```bash

servicetitan-pricebook-pp-cli dedupe --kind material --min-score 0.8 --agent

```

_Reach for this to find pricebook entries that read like internal shorthand instead of customer-facing sales copy._

```bash

servicetitan-pricebook-pp-cli copy-audit --kind equipment --agent

```

Vendor quote workflow

_Reach for this when a vendor quote, order confirmation, or invoice lands; have Claude extract it to JSON, then reconcile against current costs before touching the pricebook._

```bash

servicetitan-pricebook-pp-cli quote-reconcile ./2m-quote-2026-05.csv --agent

```

_Reach for this to apply a batch of reconciled changes in one rate-limit-friendly call._

```bash

servicetitan-pricebook-pp-cli bulk-plan ./reviewed-changes.csv --agent

```

Agent-native plumbing

_Reach for this first in any pricebook session to see what needs attention before drilling into a specific audit._

```bash

servicetitan-pricebook-pp-cli health --agent

```

_Reach for this when a tech describes a part in plain words — it returns suggested SKUs with the code, price, vendor part, and category they need to pick one._

```bash

servicetitan-pricebook-pp-cli find "1 hp submersible pump motor" --agent

```

Command Reference

categories — Manage categories

clientspecificpricing — Manage clientspecificpricing

discounts-and-fees — Manage discounts and fees

equipment — Manage equipment

images — Manage images

materials — Manage materials

materialsmarkup — Manage materialsmarkup

pricebook — Manage pricebook

pricebook-export — Manage pricebook export

services — Manage services

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

servicetitan-pricebook-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Recipes

Post-vendor-quote margin check

servicetitan-pricebook-pp-cli markup-audit --tolerance 5 --agent

Sync the latest pricebook, then list every SKU whose markup drifted more than 5% off its tier.

Reconcile a 2M vendor quote

servicetitan-pricebook-pp-cli quote-reconcile ./2m-quote-2026-05.csv --agent

Match the quote's vendor part numbers against synced SKUs and print the proposed cost diff without writing.

Narrow a large material list for an agent

servicetitan-pricebook-pp-cli materials get-list 42 --active True --agent --select results.data.code,results.data.cost,results.data.primaryVendor.vendorPart

Materials responses are large and deeply nested; --select with dotted paths returns only the fields an agent needs to reason about cost and vendor part.

Pre-session pricebook triage

servicetitan-pricebook-pp-cli health --agent

One rollup of every audit count so an agent knows where to look before drilling in.

Find SKUs missing a 2M Part #

servicetitan-pricebook-pp-cli vendor-part-gaps --kind material --agent

List materials whose primary vendor part number is empty so they can be filled before the next reconcile.

Auth Setup

ServiceTitan uses composed auth: a static ST-App-Key header (set ST_APP_KEY) plus an OAuth2 client-credentials bearer token (set ST_CLIENT_ID and ST_CLIENT_SECRET). Run servicetitan-pricebook-pp-cli auth login to walk the credential setup, then set the three credentials plus ST_TENANT_ID (your numeric tenant ID) in your environment. The client mints and refreshes the bearer token automatically and attaches both headers to every call. Whitespace is stripped defensively from credentials — a known JKA gotcha where a trailing newline in an env file produced opaque invalid_client 400s.

Run servicetitan-pricebook-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

servicetitan-pricebook-pp-cli categories get mock-value mock-value --agent --select id,name,status

```

Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

servicetitan-pricebook-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
servicetitan-pricebook-pp-cli feedback --stdin < notes.txt
servicetitan-pricebook-pp-cli feedback list --json --limit 10

Entries are stored locally at ~/.servicetitan-pricebook-pp-cli/feedback.jsonl. They are never POSTed unless SERVICETITAN_PRICEBOOK_FEEDBACK_ENDPOINT is set AND either --send is passed or SERVICETITAN_PRICEBOOK_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

servicetitan-pricebook-pp-cli profile save briefing --json
servicetitan-pricebook-pp-cli --profile briefing categories get mock-value mock-value
servicetitan-pricebook-pp-cli profile list --json
servicetitan-pricebook-pp-cli profile show briefing
servicetitan-pricebook-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 4 | Authentication required |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show servicetitan-pricebook-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

claude mcp add servicetitan-pricebook-pp-mcp -- servicetitan-pricebook-pp-mcp

Verify: claude mcp list

Direct Use

  1. Check if installed: which servicetitan-pricebook-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

servicetitan-pricebook-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: servicetitan-pricebook-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.