clinicaltrials-cli

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: Apache-2.0

README

clinicaltrials

Search ClinicalTrials.gov clinical studies from the command line.

clinicaltrials is a single pure-Go binary. It speaks to clinicaltrials.gov over plain HTTPS via the public REST API v2, shapes the responses into clean records, and pipes into the rest of your tools. No API key required.

Install

go install github.com/tamnd/clinicaltrials-cli/cmd/clinicaltrials@latest

Or grab a prebuilt binary from the releases, or run the container image:

docker run --rm ghcr.io/tamnd/clinicaltrials:latest --help

Usage

# Search by condition
clinicaltrials search --condition cancer --status RECRUITING

# Search by intervention
clinicaltrials search --intervention insulin --limit 5

# Search by free-text term
clinicaltrials search --term "phase 3 diabetes"

# Get full study details by NCT ID
clinicaltrials study NCT05608876

# Output as JSON
clinicaltrials search --condition cancer -o json

# Output as CSV
clinicaltrials search --condition cancer -o csv

Output formats

-o table (default on TTY), -o jsonl (default piped), -o json, -o csv, -o tsv, -o url

Development

cmd/clinicaltrials/   thin main, wires cli.NewApp into kit.Main
cli/                  kit app wiring: identity, defaults, domain registration
clinicaltrials/       the library: HTTP client, data models, kit Domain
docs/                 tago documentation site
make build      # ./bin/clinicaltrials
make test       # go test ./...
make vet        # go vet ./...

Releasing

Push a version tag and GitHub Actions runs GoReleaser, which builds the archives, Linux packages, the multi-arch GHCR image, checksums, SBOMs, and a cosign signature:

git tag v0.1.0
git push --tags

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
Package cli builds the clinicaltrials command tree on top of the clinicaltrials library and the any-cli/kit framework.
Package cli builds the clinicaltrials command tree on top of the clinicaltrials library and the any-cli/kit framework.
Package clinicaltrials is the library behind the clinicaltrials command: the HTTP client, request shaping, and the typed data models for the ClinicalTrials.gov REST API v2.
Package clinicaltrials is the library behind the clinicaltrials command: the HTTP client, request shaping, and the typed data models for the ClinicalTrials.gov REST API v2.
cmd
clinicaltrials command
Command clinicaltrials is a single-binary CLI for ClinicalTrials.gov.
Command clinicaltrials is a single-binary CLI for ClinicalTrials.gov.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL