CLI Reference

The HMS4all CLI provides command-line access to the platform API for scripting, automation, and development workflows.

Coming Soon

The HMS4all CLI is under development. In the meantime, you can interact with the API using curl or any HTTP client.


Planned Features

Installation

npm install -g @hms4all/cli

Authentication

# Interactive login
hms4all login

# Or set API key directly
hms4all config set-key hms4all_sk_your_api_key

# Verify connection
hms4all whoami

Patient Commands

# Search patients
hms4all patients search "John Doe"

# Get patient details
hms4all patients get <patient-id>

# Register patient
hms4all patients register --first-name John --last-name Doe --phone 9876543210

Appointment Commands

# List today's appointments
hms4all appointments list --date today

# Book appointment
hms4all appointments book --patient <id> --doctor <id> --time "2026-03-04T09:00"

# Cancel appointment
hms4all appointments cancel <appointment-id>

Agent Commands

# Call an MCP tool
hms4all agent call suggest-departments --type general --beds 200

# Send an A2A task
hms4all agent task "Analyze these lab results: CBC Hb 10.2"

# Check pending HITL actions
hms4all agent actions --status pending

# Approve an action
hms4all agent approve <action-id>

Admin Commands

# View API keys
hms4all keys list

# Create API key
hms4all keys create --name "CI Pipeline" --scopes agents:clinical:read

# View audit logs
hms4all audit list --protocol MCP --limit 50

Current Alternative: curl

Until the CLI is available, use curl with your API key:

# Set your API key
export HMS4ALL_KEY="hms4all_sk_your_api_key"
export HMS4ALL_API="https://your-api.hms4all.com"

# Search patients
curl "$HMS4ALL_API/patients?search=John" \
  -H "Authorization: Bearer $HMS4ALL_KEY"

# Call MCP tool metadata
curl "$HMS4ALL_API/agenty/meta/tools"

# Send A2A task
curl -X POST "$HMS4ALL_API/a2a" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $HMS4ALL_KEY" \
  -d '{"jsonrpc":"2.0","method":"tasks/send","id":"1","params":{"id":"t1","message":{"role":"user","parts":[{"type":"text","text":"Check bed availability"}]}}}'