devalender
v0.2.0
Published
Book, reschedule, and manage appointments from a terminal or an AI agent
Maintainers
Readme
devalender CLI
Book, reschedule, and manage appointments from a terminal or an AI agent. Every
API action is available, with --json output on every command.
Install
npm i -g devalender
devalender --helpBuild and run (from the monorepo)
pnpm exec nx build cli
node packages/cli/dist/main.mjs --help
pnpm exec nx run cli:check-pack # pack, install the tarball in a temp dir, smoke-testThe CLI is a single self-contained bundle (@devalender/client and
@devalender/contracts are bundled in, so the client is not published
separately). Publishing is a manual step for Emit:
pnpm publish --filter ./packages/cli.
Authentication
Run devalender login. It prints a short code and a URL (and opens your
browser on a terminal); approve it on devalender.com, signing in if needed, and
the CLI stores its own key in ~/.config/devalender/config.json (mode 0600).
- AI agents:
devalender login --no-browser --jsonprints the URL and code as its first JSON line ({"status":"pending","verificationUriComplete":..., "userCode":...}) so you can hand them to your human, then waits and finishes with themerecord. - CI: create a key in the dashboard (or
devalender keys create --name <label>) and rundevalender login --key dvl_... --api-url https://api.example.com, or setDEVALENDER_API_KEYandDEVALENDER_API_URL(agents may do this too). Environment variables take precedence over the config file.
Without a stored login, the CLI talks to https://devalender.com/api. Point it at a
local api with --api-url http://localhost:3051 or DEVALENDER_API_URL.
slots, book, and manage * are public and never send the key.
Agent usage
export DEVALENDER_API_URL=https://api.example.com
# find a slot, book it, move it, cancel it — no browser, no login
devalender slots alice/intro --from 2030-01-07 --to 2030-01-14 --json
devalender book alice/intro --start 2030-01-07T10:00:00Z --name "Bob" --email [email protected] --json
devalender manage reschedule --id <booking-id> --token <manageToken> --start 2030-01-08T10:00:00Z --json
devalender manage cancel --id <booking-id> --token <manageToken> --json--jsonprints exactly the API response to stdout (commands with no response body print{"ok":true}). Errors go to stderr as{"error","message"}.bookandmanage reschedulereturn amanageToken; keep the latest one.- Times: pass ISO 8601 with an offset (
2030-01-07T10:00:00Z), or a local time (2030-01-07T10:00) interpreted in--tz.--tz(IANA name, default: system timezone) also controls display.
Exit codes
| code | meaning | | ---- | ----------------------------------------- | | 0 | success | | 1 | generic error (network, server) | | 2 | usage error or invalid input | | 3 | not authenticated / bad API key | | 4 | conflict (slot taken, booking not active) | | 5 | not found |
Commands
| command | needs key |
| ---------------------------------------------------------------------------------- | --------- |
| login, logout, whoami | whoami |
| event-types list\|get\|create\|update\|delete | yes |
| availability get\|set-rules --file\|override add\|override remove | yes |
| bookings list\|get\|cancel\|reschedule | yes |
| keys list\|create\|revoke | yes |
| slots <handle>/<slug>, book <handle>/<slug>, manage view\|cancel\|reschedule | no |
Run any command with --help for options and examples.
Releasing
- Bump
versioninpackages/cli/package.json. pnpm nx build cli, thennpm pack --dry-runfrompackages/cli(expect onlydist/main.mjs,README.md,package.json).- Install the packed tarball in a clean directory and run
--version,--help,slots, andlogin --no-browser --json. npm publishfrompackages/cli(needsnpm loginand the account's one-time password or browser approval).npm view devalender versionandnpx -y devalender@<version> --versionfrom a temp dir.
