| name | pp-fedex |
| description | REST-native FedEx CLI for small business shippers, with rate-shopping, bulk CSV labels, an address book, and a local SQLite ledger no other tool has. Trigger phrases: `ship a package via FedEx`, `rate-shop FedEx services`, `bulk-print FedEx labels from CSV`, `save a FedEx recipient`, `issue a FedEx return label`, `FedEx spend this month`, `track a FedEx shipment`, `use fedex-pp-cli`, `run fedex`. |
| author | Trevin Chow |
| license | Apache-2.0 |
| argument-hint | <command> [args] | install cli|mcp |
| allowed-tools | Read Bash |
| metadata | {"openclaw":{"requires":{"bins":["fedex-pp-cli"]},"install":[{"kind":"go","bins":["fedex-pp-cli"],"module":"github.com/mvanhorn/printing-press-library/library/commerce/fedex/cmd/fedex-pp-cli"}]}} |
FedEx โ Printing Press CLI
Prerequisites: Install the CLI
This skill drives the fedex-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
- Install via the Printing Press installer. It defaults binaries to
$HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:
npx -y @mvanhorn/printing-press-library install fedex --cli-only
- Verify:
fedex-pp-cli --version
- 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.5 or newer):
go install github.com/mvanhorn/printing-press-library/library/commerce/fedex/cmd/fedex-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 fedex-pp-cli when you run a small-to-medium shipping operation and want to programmatically interact with the FedEx REST API. Right fit for: e-commerce stores creating labels from order CSVs, customer-service teams generating return labels, ops teams tracking in-flight shipments, and SMB owners who want a local ledger of every shipment and rate quote for accounting. The local SQLite archive makes it the right tool for analytical queries over historical shipments. Choose this CLI over multi-carrier SaaS (ShipStation, Shippo) when you only need FedEx, want to own your data, and prefer terminal/agent automation over web UIs.
Unique Capabilities
These capabilities aren't available in any other tool for this API.
Save money, save time
-
rate shop โ Quote rates across every applicable service type in parallel and rank by cost, transit days, or cost-per-day.
When picking the cheapest viable service for a shipment, this collapses 6+ API calls into one ranked answer. The headline cost-saving command for SMB shippers.
fedex rate shop --from 90210 --to 10001 --weight 5lb --json --select rates.serviceType,rates.totalNetCharge,rates.transitTime
-
ship bulk โ Create labels for a CSV of orders with adaptive rate limiting, per-row PASS/FAIL accounting, and resume-from-last-success.
The 'I ship 30 packages a day' workflow. Replaces clicking through FedEx Ship Manager one label at a time.
fedex ship bulk --csv orders.csv --service GROUND --output labels/ --resume
-
return create โ Generate a Ground Call Tag (return label) against an existing tracking number with one command, optionally emailing it to the recipient.
E-commerce customer-service workflow. Issuing a return label is the most common post-sale interaction.
fedex return create --tracking 794633071234 --reason damaged --email customer@example.com
-
address validate โ SHA-256-keyed local cache prevents re-billing the FedEx Address Validation API for repeat lookups.
Direct cost savings โ the only feature with a quantifiable per-call $ impact.
fedex address validate --street '1600 Amphitheatre Pkwy' --city 'Mountain View' --state CA --zip 94043 --country US --cache
-
ship etd โ Single-command Electronic Trade Documents shipping: uploads commercial invoice, captures docId, and stitches it into the shipment create call.
International shipments require ETD; this collapses an error-prone multi-step into one atomic action.
fedex ship etd --invoice invoice.pdf --orig CN --dest US --recipient-name 'Acme' --weight 2kg --service FEDEX_INTERNATIONAL_PRIORITY
Local state that compounds
-
address save โ Save frequently-used recipients to a local address book; reference them by name in ship commands.
Ergonomic parity with paid SaaS competitors. Eliminates retyping addresses for repeat customers.
fedex address save acme --street '500 Main St' --city Denver --state CO --zip 80202 --country US
-
track diff โ Show only the tracking events that have appeared since the last poll for each tracking number in the local store.
Replaces tracking-poll dedupe glue agents would otherwise write.
fedex track diff --since 1h --json
-
track watch โ Continuously poll a set of tracking numbers and emit new events to stdout, a webhook, or a file as they arrive. Polling alternative to FedEx push notifications.
Most SMBs don't have provisioned push webhooks. Polling daemon is the universal alternative.
fedex track watch --tracking 794633071234 --interval 10m --webhook https://example.com/hook
-
archive โ SQLite FTS5 search across every shipment in the local archive โ recipient name, address, reference, tracking number, service.
'Did we ship to ACME last week?' โ a question SMBs ask constantly.
fedex archive 'warehouse 47' --service GROUND --json
-
spend report โ Sum of net charges per service type, lane, or account from the local rate-quote and shipment ledger.
'How much did I spend on FedEx last month?' โ the question every SMB owner asks.
fedex spend report --since 30d --by service --json
-
export โ Dump shipments + charges + tracking events as CSV or JSON for QuickBooks/Xero reconciliation.
Closes the loop on accounting reconciliation without manual data entry.
fedex export --format csv --since 30d --output fedex-april.csv
-
manifest โ Generate a printable PDF/text summary of every shipment created today from the local archive, optionally invoking the Ground EOD close API.
Setup smoothness
-
doctor โ Verifies OAuth auth, sandbox/prod routing, account-number format, label-format compatibility, and surfaces BAG (Bar Code Analysis Group) approval status.
Avoids the most common 'why won't my labels print' failure mode for first-time users.
fedex doctor
Command Reference
addresses โ Address validation
fedex-pp-cli addresses โ Validate one or more addresses (resolved/standardized form, classification, optional resolved coordinates)
availability โ Service availability, special-service options, and transit times
fedex-pp-cli availability services โ Get available services for an origin/destination pair
fedex-pp-cli availability special_services โ Get available special-service options (alcohol, dangerous goods, signature requirements, etc.)
fedex-pp-cli availability transit_times โ Get transit times for an origin/destination pair across services
consolidations โ Consolidate multiple shipments into one fulfillment (advanced; for high-volume 3PLs)
fedex-pp-cli consolidations add_shipment โ Add shipments to a consolidation
fedex-pp-cli consolidations confirm โ Confirm a consolidation (locks rates and triggers shipping)
fedex-pp-cli consolidations confirm_results โ Get results of a consolidation confirmation
fedex-pp-cli consolidations create โ Create a consolidation
fedex-pp-cli consolidations delete โ Delete a consolidation
fedex-pp-cli consolidations delete_shipment โ Remove a shipment from a consolidation
fedex-pp-cli consolidations modify โ Modify a consolidation
fedex-pp-cli consolidations results โ Get consolidation results
fedex-pp-cli consolidations retrieve โ Retrieve a consolidation
endofday โ Submit and modify Ground end-of-day close (daily manifest)
fedex-pp-cli endofday close โ Submit Ground end-of-day close (manifest packages shipped today)
fedex-pp-cli endofday modify โ Re-submit or modify a previous end-of-day close
freight_pickups โ Schedule, check, and cancel freight (LTL) pickups
fedex-pp-cli freight_pickups availability โ Check freight pickup availability
fedex-pp-cli freight_pickups cancel โ Cancel a freight pickup
fedex-pp-cli freight_pickups create โ Schedule a freight (LTL) pickup
freight_shipments โ Create freight (LTL) shipments (for industrial shippers)
fedex-pp-cli freight_shipments โ Create a freight (LTL) shipment
globaltrade โ Global trade regulatory details (HS codes, restrictions)
fedex-pp-cli globaltrade โ Get regulatory details (HS codes, harmonized system, country restrictions)
locations โ Find FedEx Office, dropoff, and pickup locations
fedex-pp-cli locations โ Find FedEx locations near an address or postal code
openship โ Build multi-piece shipments progressively before confirming (advanced; not needed for typical SMB workflows)
fedex-pp-cli openship add_package โ Add a package to an open shipment
fedex-pp-cli openship create โ Create an open (uncommitted) multi-piece shipment
fedex-pp-cli openship delete โ Delete an open shipment
fedex-pp-cli openship delete_package โ Delete a package from an open shipment
fedex-pp-cli openship modify โ Modify an open shipment
fedex-pp-cli openship modify_package โ Modify a package in an open shipment
fedex-pp-cli openship results โ Get results of a confirmed open shipment
fedex-pp-cli openship retrieve โ Retrieve an open shipment by index
fedex-pp-cli openship retrieve_package โ Retrieve a specific package from an open shipment
pickups โ Schedule, check availability, and cancel Express/Ground pickups
fedex-pp-cli pickups availability โ Check whether pickup is available for a postal code on a date
fedex-pp-cli pickups cancel โ Cancel a previously-scheduled Express/Ground pickup
fedex-pp-cli pickups create โ Schedule an Express or Ground pickup at a specified address
postal โ Postal code validation and country servicing
fedex-pp-cli postal โ Validate that FedEx services a postal code in a country
rates โ Rate quotes for Express, Ground, Home, Ground Economy, and freight
fedex-pp-cli rates quote โ Quote rates for a shipment (Express/Ground/Home/Ground Economy)
fedex-pp-cli rates quote_freight โ Quote rates for freight (LTL) shipments
shipments โ Create, validate, cancel, and retrieve shipments
fedex-pp-cli shipments cancel โ Cancel a shipment by tracking number
fedex-pp-cli shipments create โ Create a shipment and generate label(s)
fedex-pp-cli shipments results โ Retrieve results of an asynchronous shipment job
fedex-pp-cli shipments tag โ Create a Ground Call Tag (return label) for an existing shipment
fedex-pp-cli shipments tag_cancel โ Cancel a Ground Call Tag
fedex-pp-cli shipments validate โ Validate a shipment package without creating a label (catches rejections before billing)
track โ Track shipments by tracking number, reference, TCN, or associated shipment; retrieve documents and configure notifications
fedex-pp-cli track associated โ Track shipments associated with a master tracking number (multi-piece)
fedex-pp-cli track documents โ Retrieve tracking documents (signature proof of delivery, etc.)
fedex-pp-cli track notifications โ Configure tracking notifications (email/SMS) for a shipment
fedex-pp-cli track number โ Track up to 30 tracking numbers in one call (returns full event timeline per shipment)
fedex-pp-cli track reference โ Track by reference number (PO/customer ref/RMA)
fedex-pp-cli track tcn โ Track by Transportation Control Number (military/government use)
Hand-written commands
fedex-pp-cli auth login [--client-id <id>] [--client-secret <secret>] [--env sandbox|prod] โ Mint an OAuth2 bearer token via client_credentials and cache it on disk
fedex-pp-cli auth logout โ Clear the cached bearer token
fedex-pp-cli auth status โ Show the cached token's expiry and which env vars were detected
fedex-pp-cli rate shop --from <zip> --to <zip> --weight <n>[lb|kg] โ Quote rates across every applicable service type in parallel and rank by cost or transit
fedex-pp-cli ship bulk --csv <path> --service <type> [--output <dir>] [--resume] [--concurrency N] โ Create labels for a CSV of orders with adaptive rate limiting and resumable on partial failure
fedex-pp-cli ship etd --invoice <pdf> --orig <country> --dest <country> ... โ Single-command Electronic Trade Documents shipping (upload + reference + ship in one call)
fedex-pp-cli address save <name> --street <s> --city <c> --state <s> --zip <z> --country <c> โ Save a recipient to the local address book
fedex-pp-cli address list โ List saved recipients in the local address book
fedex-pp-cli address delete <name> โ Delete a saved recipient from the local address book
fedex-pp-cli track diff [--since <duration>] [--tracking <num>...] โ Show only tracking events that have appeared since the last poll
fedex-pp-cli track watch --tracking <num> [--interval <duration>] [--webhook <url>] โ Long-poll daemon: continuously poll tracking and emit new events
fedex-pp-cli return create --tracking <orig-tracking> [--reason <reason>] [--email <addr>] โ Generate a return label (Ground Call Tag) for an existing shipment
fedex-pp-cli spend report [--since <duration>] [--by service|account|lane] โ Sum net charges per service type from the local shipment ledger
fedex-pp-cli archive <query> โ FTS5 search across shipments in the local archive
fedex-pp-cli export [--format csv|json] [--since <duration>] [--output <file>] โ Export shipment history for accounting reconciliation
fedex-pp-cli manifest [--date YYYY-MM-DD] [--close] [--output <file>] โ Generate end-of-day manifest report from local archive; optionally fire Ground EOD close
fedex-pp-cli doctor โ Verify auth, sandbox/prod routing, account-number format, label-format compatibility, BAG approval status
Finding the right command
When you know what you want to do but not which command does it, ask the CLI directly:
fedex-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
Rate-shop and select cheapest service
fedex rate shop --from 90210 --to 10001 --weight 5lb --json --select rates.serviceType,rates.totalNetCharge,rates.transitTime
Returns every applicable service type with cost and transit time so the agent (or human) picks the right balance.
Bulk ship with resume
fedex ship bulk --csv orders.csv --service GROUND --output labels/ --resume --concurrency 2
Creates labels for every row in orders.csv, respects the FedEx 1 req/s burst limit via cliutil.AdaptiveLimiter, and resumes from the last successful row if interrupted.
Save a recipient and ship to them
fedex address save acme --street '500 Main St' --city Denver --state CO --zip 80202 --country US
Address book lookup avoids retyping recipient details across every shipment.
Issue a return label
fedex return create --tracking 794633071234 --reason damaged --json
Generates a Ground Call Tag against the original tracking; PDF/ZPL label is emitted for the customer.
Monthly spend report by service
fedex spend report --since 30d --by service --json --select service,total_net_charge,shipment_count
Joins shipments + rate quotes from the local ledger; answers 'where did I spend money on FedEx this month'.
Auth Setup
FedEx uses OAuth2 client_credentials. Run fedex auth login once with your sandbox or production Client ID and Client Secret; the CLI mints a 1-hour bearer token, caches it on disk, and refreshes proactively before expiry. Production label printing requires per-project Bar Code Analysis Group (BAG) approval from FedEx โ fedex doctor surfaces approval status before you hit it.
Run fedex-pp-cli doctor to verify setup.
Agent Mode
Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.
-
Pipeable โ JSON on stdout, errors on stderr
-
Filterable โ --select keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
fedex-pp-cli addresses --agent --select id,name,status
-
Previewable โ --dry-run shows the request without sending
-
Non-interactive โ never prompts, every input is a flag
Agent Feedback
When you (or the agent) notice something off about this CLI, record it:
fedex-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
fedex-pp-cli feedback --stdin < notes.txt
fedex-pp-cli feedback list --json --limit 10
Entries are stored locally at ~/.fedex-pp-cli/feedback.jsonl. They are never POSTed unless FEDEX_FEEDBACK_ENDPOINT is set AND either --send is passed or FEDEX_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.
fedex-pp-cli profile save briefing --json
fedex-pp-cli --profile briefing addresses
fedex-pp-cli profile list --json
fedex-pp-cli profile show briefing
fedex-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:
- Empty,
help, or --help โ show fedex-pp-cli --help output
- Starts with
install โ ends with mcp โ MCP installation; otherwise โ see Prerequisites above
- Anything else โ Direct Use (execute as CLI command with
--agent)
MCP Server Installation
- Install the MCP server:
go install github.com/mvanhorn/printing-press-library/library/commerce/fedex/cmd/fedex-pp-mcp@latest
- Register with Claude Code:
claude mcp add fedex-pp-mcp -- fedex-pp-mcp
- Verify:
claude mcp list
Direct Use
- Check if installed:
which fedex-pp-cli
If not found, offer to install (see Prerequisites at the top of this skill).
- Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the
--agent flag:
fedex-pp-cli <command> [subcommand] [args] --agent
- If ambiguous, drill into subcommand help:
fedex-pp-cli <command> --help.