Skip to content

CLI Usage

This guide walks through every CLI command group with practical examples. For a quick start, see the CLI Quickstart. For flag-level detail, see the CLI Reference.

The interactive login validates your key against the API before saving:

Terminal window
chronary auth login

Save to a named profile:

Terminal window
chronary auth login --profile staging

Manage separate keys for test, live, and different environments:

Terminal window
# List profiles
chronary auth list
Profile Key
* default chr_sk_a1b2...
production chr_sk_x9y8...
Terminal window
# Switch profiles
chronary auth switch production
# Remove a profile
chronary auth remove staging
Terminal window
chronary auth status
Key: chr_sk_...a1b2
Base URL: https://api.chronary.ai
Terminal window
chronary agents list
ID Name Type Status Description Created
agt_a1b2c3d4 Sales Agent - Acme ai active Handles meeting scheduling 2026-04-04
Showing 1 of 1 agents

Filter by type or status:

Terminal window
chronary agents list --type ai --status active

Fetch all pages automatically:

Terminal window
chronary agents list --all

Registering an agent past your plan’s agent limit is refused; delete an agent first or move to a plan with more.

Terminal window
chronary agents create --name "Sales Agent" --type ai --description "Handles sales meetings"

Or from a JSON file:

Terminal window
chronary agents create @agent.json

Where agent.json contains:

{
"name": "Sales Agent",
"type": "ai",
"description": "Handles sales meetings",
"metadata": { "team": "sales", "region": "us-east" }
}
Terminal window
# Get full details
chronary agents get agt_a1b2c3d4
# Update fields
chronary agents update agt_a1b2c3d4 --name "Sales Agent v2" --status paused
# Delete (with confirmation prompt)
chronary agents delete agt_a1b2c3d4
# Skip confirmation
chronary agents delete agt_a1b2c3d4 --yes
Terminal window
# All calendars in your org
chronary calendars list
# Calendars for a specific agent
chronary calendars list --agent agt_a1b2c3d4

The three commands below are alternatives, not a sequence: Free includes 1 calendar in total, so pick one (or delete the first before creating the next).

Terminal window
# Org-level calendar
chronary calendars create --name "Conference Room B" --timezone "America/Chicago"
# Agent-owned calendar
chronary calendars create --agent agt_a1b2c3d4 --name "Sales Meetings" --timezone "America/New_York"
# With metadata
chronary calendars create \
--name "Conference Room B" \
--timezone "America/Chicago" \
--metadata '{"capacity": 12, "floor": 4}'

Or from a file:

Terminal window
chronary calendars create @calendar.json
Terminal window
chronary calendars get cal_x1y2z3
chronary calendars update cal_x1y2z3 --name "New Name" --timezone "Europe/London"
chronary calendars delete cal_x1y2z3 --yes

Events require either a --calendar or --agent scope:

Terminal window
# Events on a specific calendar
chronary events list --calendar cal_x1y2z3
# All events across an agent's calendars
chronary events list --agent agt_a1b2c3d4
# With date and status filters
chronary events list --calendar cal_x1y2z3 \
--start-after "2026-04-01T00:00:00Z" \
--start-before "2026-04-30T23:59:59Z" \
--status confirmed
Terminal window
chronary events create \
--calendar cal_x1y2z3 \
--title "Strategy sync" \
--start "2026-04-07T14:00:00Z" \
--end "2026-04-07T14:30:00Z" \
--description "Quarterly strategy alignment" \
--status confirmed

All-day events:

Terminal window
chronary events create \
--calendar cal_x1y2z3 \
--title "Company Holiday" \
--start "2026-07-04T00:00:00Z" \
--end "2026-07-05T00:00:00Z" \
--all-day

A recurring series in a local time zone (16:00 Los Angeles time every Tuesday, across daylight-saving changes):

Terminal window
chronary events create \
--calendar cal_x1y2z3 \
--title "Pottery class" \
--start "2026-11-17T16:00:00-08:00" \
--end "2026-11-17T17:30:00-08:00" \
--recurrence-rule "FREQ=WEEKLY;BYDAY=TU" \
--timezone America/Los_Angeles

From a file:

Terminal window
chronary events create @event.json --calendar cal_x1y2z3
Terminal window
chronary events get evt_m1n2o3 --calendar cal_x1y2z3
chronary events update evt_m1n2o3 --calendar cal_x1y2z3 --title "Updated title" --status cancelled
chronary events delete evt_m1n2o3 --calendar cal_x1y2z3 --yes

--timezone "" on events update returns a series to UTC. When an update moves a recurring series (--start, --recurrence-rule or --timezone), its cancelled occurrences stay on their local dates; any that no longer fall on the series are listed with the events delete --occurrence-start command to cancel the right one again.

Query free/busy slots for agents, calendars, or across multiple agents.

Terminal window
chronary availability agent agt_a1b2c3d4 \
--start "2026-04-07T09:00:00Z" \
--end "2026-04-07T17:00:00Z" \
--slot-duration 30m
Terminal window
chronary availability calendar cal_x1y2z3 \
--start "2026-04-07T09:00:00Z" \
--end "2026-04-07T17:00:00Z"

Find shared free time across multiple agents (needs Developer or Pro):

Terminal window
chronary availability cross \
--agents "agt_a1b2c3d4,agt_e5f6g7h8" \
--start "2026-04-07T09:00:00Z" \
--end "2026-04-07T17:00:00Z" \
--slot-duration 1h

Add --include-busy to see what’s blocking each time slot:

Terminal window
chronary availability agent agt_a1b2c3d4 \
--start "2026-04-07T09:00:00Z" \
--end "2026-04-07T17:00:00Z" \
--include-busy
Terminal window
chronary webhooks list
Terminal window
chronary webhooks create \
--url "https://example.com/webhooks/chronary" \
--events "event.created, event.updated"
Created webhook wh_a1b2c3d4
URL: https://example.com/webhooks/chronary
Events: event.created, event.updated
Secret: whsec_abc123...
(Save this secret — it won't be shown again)

Valid event types: agent.created, agent.updated, event.created, event.updated, event.deleted.

Terminal window
chronary webhooks get wh_a1b2c3d4
chronary webhooks update wh_a1b2c3d4 --events "event.created" --active=false
chronary webhooks delete wh_a1b2c3d4 --yes

Import external iCal feeds into a Chronary calendar. The API polls them approximately every 15 minutes. iCal subscriptions start on Developer or Pro: on Free, chronary ical create returns 429 quota_exceeded.

Terminal window
chronary ical list --agent agt_a1b2c3d4
Terminal window
chronary ical create \
--agent agt_a1b2c3d4 \
--calendar cal_x1y2z3 \
--url "https://calendar.google.com/calendar/ical/example%40gmail.com/public/basic.ics" \
--label "Google Calendar"
Terminal window
# Get details
chronary ical get ics_a1b2c3d4
# Update label or URL
chronary ical update ics_a1b2c3d4 --label "Personal Google Cal"
# Delete
chronary ical delete ics_a1b2c3d4 --yes
# Trigger an immediate sync
chronary ical sync ics_a1b2c3d4

Check your current plan usage:

Terminal window
chronary usage
Plan: free
Period: 2026-04-01 to 2026-04-30
Resource Used Limit Remaining
Agents 1 1 0
Calendars 1 1 0
Events 40 100 60
API Calls 250 1000 750
Webhooks 100 1000 900
Availability Queries 30 100 70
iCal Subscriptions 0 0 0

Verify the API is reachable:

Terminal window
chronary health
Status: ok
Time: 2026-04-07T12:00:00Z
Latency: 45ms

Any create command accepts a @file argument to read the request body from a JSON file instead of flags:

Terminal window
chronary agents create @agent.json
chronary calendars create @calendar.json
chronary events create @event.json --calendar cal_x1y2z3
chronary webhooks create @webhook.json

You can also pipe from stdin using @-:

Terminal window
echo '{"name":"Bot","type":"ai"}' | chronary agents create @-

List commands return a single page by default. Use --all to fetch every page automatically:

Terminal window
# Default: first page (50 results)
chronary events list --calendar cal_x1y2z3
# Manual pagination
chronary events list --calendar cal_x1y2z3 --limit 10 --offset 20
# Auto-paginate everything
chronary events list --calendar cal_x1y2z3 --all

Every command supports three output formats via the --output (or -o) flag:

Terminal window
# Table (default) — human-readable
chronary agents list
# JSON — for scripting and piping
chronary agents list -o json | jq '.data[].name'
# YAML — for readability in config contexts
chronary agents get agt_a1b2c3d4 -o yaml