Amy
Guides

Using the CLI

The amy CLI is the reference client for the Amy backend. Every command maps 1:1 to an SDK call. Every step waits for you to press enter before doing anything. Nothing happens by surprise.

If you've used claude (Anthropic's CLI) or gh (GitHub's), amy will feel familiar, but it's deliberately calmer. It never starts a side effect without telling you what it's about to do, and it never starts a side effect without your enter key.

Install

The CLI ships with the repo:

git clone https://github.com/yatendra2001/amy_health_assistant.git
cd amy_health_assistant
bun install
bun run amy

For one-shot use without an alias, bun run amy <command> works from the repo root. To make it feel like a real binary:

alias amy='bun /full/path/to/amy_health_assistant/src/cli.ts'

Add that to your ~/.zshrc / ~/.bashrc. From here on this page assumes amy is on your PATH.


Run it

Just type amy with no arguments:

amy

You'll get the guided experience, a deliberate walkthrough that introduces itself, signs you in, asks you to connect a wearable, backfills your history, optionally takes a lab report, surfaces a few questions worth asking, then drops you into chat.

I'm Amy   →   sign in   →   connect   →   history   →
bloodwork   →   a few things worth asking   →   ask

Every step prints what it's about to do, then waits for enter. If you don't want a step, escape, it skips cleanly. This is the calm-design philosophy: nothing happens until you decide.


Commands

Day to day

CommandWhat it does
amyThe guided experience. Signs in, connects, syncs, drops you in chat. Default if no command.
amy ask "<question>"One-shot: ask a question, get an answer, exit. No chat loop.
amy memoryPrint what Amy remembers about you across sessions.

Your data

CommandWhat it does
amy connect <provider>Open a browser to connect a wearable. <provider> is whoop, oura, garmin, fitbit, apple (case-insensitive).
amy upload-labs <file>Upload a blood / lab report. PDF or image. Returns immediately; parsing happens server-side and folds in automatically.
amy import [days]Pull more wearable history from Terra. Default 30 days; max 1460 (~4 years).
amy refreshRe-pull the latest snapshot from the cloud into your local SQLite.

Account

CommandWhat it does
amy whoamiWho you're signed in as, which cloud you're pointed at, what's connected.
amy whoami --print-keyPrint only the bearer token to stdout (no formatting). Use this to seed a mobile or web client during development: EXPO_PUBLIC_AMY_API_KEY=$(amy whoami --print-key).
amy loginSign in via browser. Stores a 30-day session token at ~/.amy/credentials.json under amy_token.
amy logoutClear the local session token. Cloud data is untouched.
amy resetFactory reset. Prompts for confirmation. --local-only keeps cloud data; --yes skips the prompt.
amy debugDump local + cloud state. Add --json to pipe. --user=<id> or --request=<id> to fetch remote turn traces.

Examples

# Sign in and connect a Whoop
amy login
amy connect whoop

# Pull a year of history once it's connected
amy import 365

# Upload a recent lab panel
amy upload-labs ~/Downloads/2026-05-panel.pdf

# Ask a one-shot question (skips chat)
amy ask "what's my average HRV over the last 90 days?"

# Drop into chat
amy

Inside chat

Once chat is open, just type. Press enter to send. The dropdown underneath your input shows live suggestions (after /suggest) or filters slash commands as you type /.

Slash commands

Slash commands are hidden until you type /. They're for things that aren't conversations, they manipulate state or surface metadata.

CommandWhat it does
/suggestGenerate ranked, proactive questions worth asking right now. The Hypothesis Investigator scans your data + memory + chat history.
/memoryPrint what Amy remembers across sessions. Same as amy memory from outside chat.
/traceDump the last turn's structured JSON trace, routing, agent outputs, validator verdicts, cost. Useful when something looks wrong.
/importTrigger a fresh wearable backfill without leaving chat.

The slash menu is intentionally minimal. Everything else is a real question to Amy.

Suggestions

/suggest populates the dropdown with 3-7 ranked questions, each labeled with the agents that would answer it (DS, DE, HC) and a tier chip (solo / duo / trio). Arrow-key down to pick one, or keep typing to ignore them and ask your own thing. Picking a suggestion or submitting your own message hides them, re-run /suggest to refresh.

Trace

/trace dumps the last turn as JSON. Inside you'll find the routing decision, every agent's input + output, every validator gate verdict, the Critic's review, the final Fact Sheet, and the cumulative cost. This is what the SDK's Turn object would look like, the chat UI just hides it behind a slash command so the default experience stays calm.


How the CLI talks to the backend

The CLI is just an HTTP client. Every command is a thin wrapper around the same API your mobile app would call.

CLI commandAPI call
amy loginPOST /v1/auth/cli/start + POST /v1/auth/cli/approve (device flow)
amy whoamiGET /v1/me
amy connect <p>POST /v1/connect → opens the returned widget_url
amy import [d]POST /v1/import → polls status
amy refreshGET /v1/data/sync
amy upload-labs <f>POST /v1/labs (multipart) → polls status
amy ask "…"POST /v1/turns with stream:false
chatPOST /v1/turns + GET /v1/turns/:id/events (SSE)
amy memoryGET /v1/memory
amy resetDELETE /v1/admin/users/:id (requires AMY_ADMIN_KEY)

The CLI uses the TypeScript SDK shape under the hood. Anything you can do from the CLI, you can do from the SDK, from curl, or from any other client. The CLI has no special powers.

Backend selection, direct Anthropic vs API key vs OpenRouter, is the same as for the Worker. See the backends table in the README.


Verbose logging

AMY_DEBUG=1 amy ask "…"

AMY_DEBUG=1:

  • Prints full stack traces on errors (instead of just the message).
  • Surfaces extra per-step diagnostics in chat.

Everything the CLI does also lands in ~/.amy/logs/YYYY-MM-DD.jsonl as structured JSON, regardless of AMY_DEBUG. To pull every error from today:

grep '"level":"error"' ~/.amy/logs/$(date +%F).jsonl | jq .

For deeper debugging, what state the CLI sees + what it fetched last from the cloud, run:

amy debug              # human-readable
amy debug --json       # machine-readable
amy debug --user=u_…   # fetch remote turn traces for a user
amy debug --request=req_…   # fetch a specific request's trace

Environment variables

VariableDefaultPurpose
AMY_CLOUD_URL(unset, required)Base URL of the Amy Worker, e.g. http://localhost:8787 or https://amy.heyamy.xyz
AMY_SKIP_ONBOARDING0Skip the guided onboarding (for scripted / non-interactive runs)
AMY_DEBUG0Print stack traces on errors; surface extra diagnostics
AMY_MODELopusHeavyweight reasoning model (DS plan, DE synthesis, HC coaching)
AMY_FAST_MODELsonnetFast classifications, routing, rephrase, gates, reflection
AMY_VALIDATOR_MODELopusValidator (Critic + Assessment + DS findings extraction)
AMY_DS_MODELclaude-sonnet-4-6Data Science Agent specifically
AMY_COST_WARN_USD3Per-turn cost ceiling (warning only, not a hard kill)
AMY_ADMIN_KEY(unset)Required for amy reset to wipe cloud data
ANTHROPIC_API_KEY(unset)Direct Anthropic auth. See README backends.
ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN(unset)OpenRouter auth

Where to next

On this page