The katch-mission-sdk package wraps the external mission API. It helps agents sign requests, preview mission shape, create drafts, inspect lifecycle state, fetch deliverables, and debug webhooks. Use the CLI when an agent needs reliable JSON steps. Use the SDK when you are building a product or workflow that embeds Katch mission creation. Install:
npm install -g katch-mission-sdk
The package exposes the katch and katch-signer binaries. Do not install the katch package from npm; it is unrelated to Katch missions.

Minimal CLI path

katch mission launch --mission ./mission.json
katch mission confirm draft_mabc1234_deadbeef
katch mission doctor draft_mabc1234_deadbeef
This path validates the mission, previews with Katch, creates the draft, returns the exact funding transaction, confirms funding, and diagnoses the next action. Launch output includes a rewardPolicy, fundingTransaction, and funding checklist. External missions support KATCH and USDC rewards, and the checklist shows the exact factory address, chain, calldata, total budget in base units, authorization expiry, and confirm command. Agents should fund only that returned transaction. Use --funding manual explicitly when you want to make the handoff obvious:
katch mission launch --mission ./mission.json --funding manual
Manual means the CLI does not sign or submit the on-chain transaction. Any creator wallet or smart-account workflow can use the returned fundingTransaction. The launch response includes a top-level next object. For pending funding, read next.summary, broadcast next.sendTransaction, then run next.commandAfterFunding after the transaction is mined.

Intent generation

Agents can generate mission JSON from plain English when OPENAI_API_KEY is available:
katch mission generate \
  --intent "Take a clear photo of a reusable coffee cup" \
  --mission-type object_photo
Use plan to generate and preview in one step:
katch mission plan \
  --intent "Film the front entrance of a specific coffee shop" \
  --mission-type place_video \
  --place-label "Ritual Coffee Roasters" \
  --lat 37.7765 \
  --lng -122.4241
Use launch to generate from intent, create the draft, and return the funding handoff in one command:
katch mission launch \
  --intent "Film the front entrance of a specific coffee shop" \
  --mission-type place_video \
  --place-label "Ritual Coffee Roasters" \
  --lat 37.7765 \
  --lng -122.4241
Use create-from-intent only when draft creation is intended:
katch mission create-from-intent \
  --intent "Take a photo of a reusable coffee cup" \
  --idempotency-key reusable-cup-001

Mission doctor

katch mission doctor draft_mabc1234_deadbeef
Doctor returns health, summary, blockers, actions, current draft state, and a deliverables readiness check.
HealthMeaning
blockedCreator, funder, or Katch operator action is required.
waitingThe mission is funded and waiting for review.
readyThe mission is published and can receive submissions.
rejectedThe draft cannot continue as-is.
Use --skip-deliverables for a faster status-only check.

Deliverables CLI

After publication and accepted submissions, fetch the creator manifest:
katch mission deliverables draft_mabc1234_deadbeef \
  --limit 50 \
  --media-url-ttl-seconds 600
For a human-readable report:
katch mission deliverables draft_mabc1234_deadbeef --markdown
The Markdown report keeps submission IDs, verification notes, GPS, and expiring media links together so downstream agent analysis remains traceable to Katch evidence.

SDK path

import { KatchMissionClient } from "katch-mission-sdk";

const client = new KatchMissionClient({
  signer,
  walletAddress: creatorWallet
});

const preview = await client.previewMission(mission);
const draft = await client.createDraft(mission, {
  idempotencyKey: "coffee-sf-001"
});
After sending the returned funding transaction, call:
await client.confirmFunding(draft.draftId);
const status = await client.getDraft(draft.draftId);

Common failures

SymptomFix
Missing signerConfigure KATCH_SIGNER_ADDRESS and KATCH_SIGNER_COMMAND, or use KATCH_PRIVATE_KEY only for local development.
GPS place mission rejectedProvide explicit --lat and --lng; Katch does not geocode.
Unsupported reward rejectedExternal missions only support reward.token = "KATCH" or "USDC".
Authorization expiredRefetch or recreate the draft before submitting the funding transaction. Do not submit stale calldata.
Funding confirmation failsSend the exact returned fundingTransaction; do not hand-encode calldata, change token, change amount, or fund from a different creator wallet.
Unsure what to do nextRun katch mission doctor <draftId>.