Skip to content

Recipes

Real-world workflows that chain the CLI with jq, the shell, and LLMs. Every command prints JSON by default, so it composes cleanly.

Build a target landscape

bash
# One-line competitive landscape for a target, most-advanced first
gosset drugs --target TL1A --limit 100 \
  | jq -r '.[] | "\(.latest_phase)\t\(.name)\t\(.developers|join(", "))"' \
  | column -t -s $'\t'

Count assets by phase:

bash
gosset drugs --target TROP2 --limit 500 \
  | jq 'group_by(.latest_phase) | map({phase: .[0].latest_phase, n: length}) | sort_by(-.n)'

Find the Phase 3 competitors in a disease

bash
gosset drugs --disease "ulcerative colitis" --phase 3 \
  | jq -r '.[] | "\(.name)  [\(.targets|join(", "))]  ·  \(.developers|join(", "))"'

Trial readouts to watch for a drug

bash
# Ongoing Phase 3 trials for a drug, with predicted completion dates
for nct in $(gosset trials --drug tulisokibart --phase 3 --registry all | jq -r '.[].nct_id'); do
  d=$(gosset timeline "$nct" | jq -r '.expected_completion_date // "n/a"')
  echo "$nct  ->  $d"
done

Deal comps for a modality or target

bash
# Recent ADC licensing deals with disclosed upfronts, sorted by size
gosset deals --target HER2 --deal-type Licensing --since 2022-01-01 --limit 50 \
  | jq -r '.[] | select(.upfront_payment_usd != null)
            | "\(.publication_date)\t$\(.upfront_payment_usd)\t\(.buyer_names|join(","))"' \
  | sort -k2 -rn

A company's pipeline snapshot

bash
gosset drugs --company "Daiichi Sankyo" --limit 200 \
  | jq -r 'group_by(.latest_phase)[] | "\(.[0].latest_phase): \(length)"'

Feed results to an LLM / agent

Because output is clean JSON with meaningful exit codes, the CLI is easy to call from an agent or script:

bash
gosset drugs --target "KRAS G12C" --phase 2,3 --fields name,latest_phase,developers,diseases \
  | llm "Summarize this KRAS G12C late-stage landscape and flag the two most differentiated assets."
python
import json, subprocess

def gosset(*args):
    out = subprocess.run(["gosset", *args], capture_output=True, text=True)
    if out.returncode != 0:          # 1 = API/auth error, 2 = unresolved name
        raise RuntimeError(out.stderr.strip())
    return json.loads(out.stdout)

drugs = gosset("drugs", "--target", "TROP2", "--phase", "3", "--fields", "name,developers")
print(len(drugs), "Phase 3 TROP2 assets")

Watch a space (cron-friendly)

bash
# New deals in a target space since yesterday → Slack/email
gosset deals --target TL1A --since "$(date -d yesterday +%F)" \
  | jq -e 'length > 0' >/dev/null && echo "New TL1A deal activity, check gosset deals --target TL1A"

Tips

  • Prefer names, not IDs. --target PD-1, --disease "atopic dermatitis", --company Merck. Resolution is automatic. Use --debug to see what got resolved.
  • --sort=-field (with the =) for descending, e.g. --sort=-latest_phase.
  • Exit codes matter in scripts: 2 means a name didn't resolve (empty result), distinct from 1 (API/auth error).
  • For range filters, financials, and bulk work, use the Python SDK directly.

Gosset Documentation