Command-line interface for zad — connects AI agents to external services (Discord, Slack, Google Calendar, Spotify, Telegram, YouTube Music, 1Password) via scoped service configurations.
cargo install --path .
# 1. Register global Discord credentials (one-time). Interactive:
# zad opens your browser to the Developer Portal bot page,
# you hit "Reset Token" → "Copy", paste once.
zad service create discord --application-id 1234567890
# After create succeeds, zad also opens the OAuth install URL so you
# can add the bot to a guild.
# 2. Enable the service inside each project that should use it.
cd ~/code/my-project
zad service enable discord
# 3. Populate the name -> snowflake directory so you can use channel
# and user names instead of pasting 19-digit IDs.
zad discord discover
# 4. Drive the service at runtime.
zad discord send --channel general "deploy finished"
zad discord read --channel general --limit 20
zad discord channels --json
# 5. (Optional) DM yourself. `zad service create discord` offers to
# capture your user ID via Developer Mode; if skipped, set it later:
zad discord self set 1112223334445556
zad discord send --dm @me "reminder: file the time sheet"
zad service — Configure or inspect external serviceszad service create — Create credentials for a servicezad service create 1pass — Create 1Password (1pass) credentials (global by default, `--local` for project-scoped)zad service create discord — Create Discord credentials (global by default, `--local` for project-scoped)zad service create gcal — Create Google Calendar credentials (global by default, `--local` for project-scoped)zad service create spotify — Create Spotify credentials (global by default, `--local` for project-scoped)zad service create slack — Create Slack credentials (global by default, `--local` for project-scoped)zad service create telegram — Create Telegram credentials (global by default, `--local` for project-scoped)zad service create ymusic — Create YouTube Music credentials (global by default, `--local` for project-scoped)zad service enable — Enable a service in the current project (using existing credentials)zad service enable 1pass — Enable the 1Password service in the current projectzad service enable discord — Enable the Discord service in the current projectzad service enable gcal — Enable the Google Calendar service in the current projectzad service enable slack — Enable the Slack service in the current projectzad service enable spotify — Enable the Spotify service in the current projectzad service enable telegram — Enable the Telegram service in the current projectzad service enable ymusic — Enable the YouTube Music service in the current projectzad service disable — Disable a service in the current project (inverse of `enable`)zad service disable 1pass — Disable the 1Password service in the current projectzad service disable discord — Disable the Discord service in the current projectzad service disable gcal — Disable the Google Calendar service in the current projectzad service disable slack — Disable the Slack service in the current projectzad service disable spotify — Disable the Spotify service in the current projectzad service disable telegram — Disable the Telegram service in the current projectzad service disable ymusic — Disable the YouTube Music service in the current projectzad service list — List all services with credential and project-enablement statuszad service show — Show details for a configured servicezad service show 1pass — Show the 1Password service's effective configurationzad service show discord — Show the Discord service's effective configurationzad service show gcal — Show the Google Calendar service's effective configurationzad service show slack — Show the Slack service's effective configurationzad service show spotify — Show the Spotify service's effective configurationzad service show telegram — Show the Telegram service's effective configurationzad service show ymusic — Show the YouTube Music service's effective configurationzad service status — Check whether service credentials work by pinging the provider. Without `--service`, every configured service is pinged in parallelzad service delete — Delete credentials for a service (inverse of `create`)zad service delete 1pass — Delete 1Password credentials (global by default, `--local` for project-scoped)zad service delete discord — Delete Discord credentials (global by default, `--local` for project-scoped)zad service delete gcal — Delete Google Calendar credentials (global by default, `--local` for project-scoped)zad service delete slack — Delete Slack credentials (global by default, `--local` for project-scoped)zad service delete spotify — Delete Spotify credentials (global by default, `--local` for project-scoped)zad service delete telegram — Delete Telegram credentials (global by default, `--local` for project-scoped)zad service delete ymusic — Delete YouTube Music credentials (global by default, `--local` for project-scoped)zad 1pass — Operate the 1Password service (vaults, items, get, read, inject, create)zad 1pass vaults — List the vaults this account can see (filtered by policy)zad 1pass items — List items (filtered by vault, tags, category, and policy)zad 1pass tags — List distinct tags across visible itemszad 1pass get — Fetch metadata for one item. Fields are filtered by policy — labels/types stay visible, `value` on denied fields is droppedzad 1pass read — Resolve a single `op://vault/item/field` referencezad 1pass inject — Substitute every `op://…` reference in a template. Each ref is gated through the same policy as `read` before `op inject` runs, so the whole call aborts if any ref is hiddenzad 1pass create — Create a new item. Gated by the deny-by-default `[create]` block; the agent must be explicitly allowed in a vaultzad 1pass whoami — Confirm the stored credentials workzad 1pass permissions — Inspect or scaffold the permissions policyzad 1pass permissions show — Print the effective policy (both file paths + bodies)zad 1pass permissions path — Print the two candidate file paths, one per linezad 1pass permissions init — Write a starter policy to the selected scopezad 1pass permissions check — Dry-run a permissions check without hitting the networkzad 1pass permissions status — Print whether a pending policy exists at each scopezad 1pass permissions diff — Show the unified diff between live and pending (if any)zad 1pass permissions discard — Discard the pending policy without touching the live filezad 1pass permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad 1pass permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad 1pass permissions add — Queue an allow/deny pattern change. Writes to the pending filezad 1pass permissions remove — Queue an allow/deny pattern removalzad 1pass permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad 1pass permissions content add-deny-word — Append a case-insensitive deny-wordzad 1pass permissions content remove-deny-word — Remove a deny-wordzad 1pass permissions content add-deny-regex — Append a deny regexzad 1pass permissions content remove-deny-regex — Remove a deny regexzad 1pass permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad 1pass permissions time — Queue a time-window changezad 1pass permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad 1pass permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad discord — Operate the Discord service (send, read, channels, join, leave)zad discord send — Send a message to a channel or DMzad discord read — Read recent messages from a channelzad discord channels — List channels in a guildzad discord join — Join a thread channel (Discord only allows explicit joins on threads)zad discord leave — Leave a thread channelzad discord discover — Best-effort walk of the bot's visible guilds, channels, and members, writing a name -> snowflake map to this project's `directory.toml`. Safe to re-run; preserves hand-authored entrieszad discord directory — Inspect or hand-edit the name -> snowflake directoryzad discord directory set — Upsert a name -> snowflake mapping. `<kind>` is one of `guild`, `channel`, or `user`. Channel keys may include a `guild/channel` qualifierzad discord directory remove — Remove a single mapping. Silent no-op if the key is absentzad discord directory clear — Wipe every entry. Use with `--force`zad discord permissions — Inspect, scaffold, or dry-run the permissions policy that narrows what this service may actually dozad discord permissions show — Print the effective policy (global + local) for this projectzad discord permissions init — Write a starter `permissions.toml` at the selected scopezad discord permissions path — Print the paths considered for this project, in precedence orderzad discord permissions check — Dry-run: ask whether a proposed action would be admitted *without* hitting Discord. Useful for agents that want to pre-flightzad discord permissions status — Print whether a pending policy exists at each scopezad discord permissions diff — Show the unified diff between live and pending (if any)zad discord permissions discard — Discard the pending policy without touching the live filezad discord permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad discord permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad discord permissions add — Queue an allow/deny pattern change. Writes to the pending filezad discord permissions remove — Queue an allow/deny pattern removalzad discord permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad discord permissions content add-deny-word — Append a case-insensitive deny-wordzad discord permissions content remove-deny-word — Remove a deny-wordzad discord permissions content add-deny-regex — Append a deny regexzad discord permissions content remove-deny-regex — Remove a deny regexzad discord permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad discord permissions time — Queue a time-window changezad discord permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad discord permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad discord self — Manage the Discord user ID resolved from the literal `@me` in `--dm` targets. Show, set (with API validation), or clearzad discord self show — Print the stored self-user ID (or note that it's not set)zad discord self set — Validate the supplied snowflake against Discord and store itzad discord self clear — Clear the stored self-user IDzad gcal — Operate the Google Calendar service (calendars, events, permissions)zad gcal calendars — Calendar directory operations (list / show)zad gcal calendars list — List every calendar the authenticated user can seezad gcal calendars show — Show metadata for one calendarzad gcal events — Event read + write operationszad gcal events list — List events on a calendar, optionally filtered by time or free-text queryzad gcal events show — Show one eventzad gcal events create — Create a new eventzad gcal events update — Patch an existing event. `--add-attendee` and `--add-reminder-minutes` are additive; `--remove-attendee` is subtractivezad gcal events delete — Delete an eventzad gcal permissions — Inspect or scaffold the permissions policyzad gcal permissions show — Print the effective policy (both file paths + bodies)zad gcal permissions path — Print the two candidate file paths, one per linezad gcal permissions init — Write a starter policy to the selected scopezad gcal permissions check — Dry-run a permissions check without hitting the networkzad gcal permissions status — Print whether a pending policy exists at each scopezad gcal permissions diff — Show the unified diff between live and pending (if any)zad gcal permissions discard — Discard the pending policy without touching the live filezad gcal permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad gcal permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad gcal permissions add — Queue an allow/deny pattern change. Writes to the pending filezad gcal permissions remove — Queue an allow/deny pattern removalzad gcal permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad gcal permissions content add-deny-word — Append a case-insensitive deny-wordzad gcal permissions content remove-deny-word — Remove a deny-wordzad gcal permissions content add-deny-regex — Append a deny regexzad gcal permissions content remove-deny-regex — Remove a deny regexzad gcal permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad gcal permissions time — Queue a time-window changezad gcal permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad gcal permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad gcal self — Configure the `@me` alias that resolves to your own emailzad gcal self show — Print the currently configured self emailzad gcal self set — Set the self email (overwrites whatever's stored)zad gcal self clear — Clear the self emailzad slack — Operate the Slack service (send, read, channels, discover)zad slack send — Send a message to a channel or DMzad slack read — Read recent messages from a channelzad slack channels — List channels in the workspacezad slack discover — Best-effort walk of the workspace's channels and members, writing a name -> ID map to this project's `directory.toml`zad slack directory — Inspect or hand-edit the name -> ID directoryzad slack directory set — Upsert a name -> ID mapping. `<kind>` is one of `channel` or `user`zad slack directory remove — Remove a single mappingzad slack directory clear — Wipe every entry. Use with `--force`zad slack permissions — Inspect, scaffold, or dry-run the permissions policyzad slack permissions show — zad slack permissions init — zad slack permissions path — zad slack permissions check — zad slack permissions status — Print whether a pending policy exists at each scopezad slack permissions diff — Show the unified diff between live and pending (if any)zad slack permissions discard — Discard the pending policy without touching the live filezad slack permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad slack permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad slack permissions add — Queue an allow/deny pattern change. Writes to the pending filezad slack permissions remove — Queue an allow/deny pattern removalzad slack permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad slack permissions content add-deny-word — Append a case-insensitive deny-wordzad slack permissions content remove-deny-word — Remove a deny-wordzad slack permissions content add-deny-regex — Append a deny regexzad slack permissions content remove-deny-regex — Remove a deny regexzad slack permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad slack permissions time — Queue a time-window changezad slack permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad slack permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad slack self — Manage the Slack user ID resolved from the literal `@me` in targetszad slack self show — zad slack self set — zad slack self clear — zad spotify — Operate the Spotify service (search, playlists, library)zad spotify search — Search the Spotify catalogue (tracks, albums, artists, playlists)zad spotify playlists — Playlist management (list, show, create, rename, delete, add, remove)zad spotify playlists list — List the authenticated user's playlistszad spotify playlists show — Show one playlist's metadata and trackszad spotify playlists create — Create a new playlist owned by the authenticated userzad spotify playlists rename — Rename an existing playlistzad spotify playlists delete — Delete (i.e. unfollow) a playlist owned by the userzad spotify playlists add — Add one or more tracks to a playlistzad spotify playlists remove — Remove one or more tracks from a playlistzad spotify library — Library management (saved tracks and albums)zad spotify library tracks — Saved-tracks operationszad spotify library tracks list — List saved itemszad spotify library tracks save — Save (like) one or more itemszad spotify library tracks unsave — Unsave (unlike) one or more itemszad spotify library albums — Saved-albums operationszad spotify library albums list — List saved itemszad spotify library albums save — Save (like) one or more itemszad spotify library albums unsave — Unsave (unlike) one or more itemszad spotify permissions — Inspect or scaffold the permissions policyzad spotify permissions show — Print the effective policy (both file paths + bodies)zad spotify permissions path — Print the two candidate file paths, one per linezad spotify permissions init — Write a starter policy to the selected scopezad spotify permissions check — Dry-run a permissions check without hitting the networkzad spotify permissions status — Print whether a pending policy exists at each scopezad spotify permissions diff — Show the unified diff between live and pending (if any)zad spotify permissions discard — Discard the pending policy without touching the live filezad spotify permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad spotify permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad spotify permissions add — Queue an allow/deny pattern change. Writes to the pending filezad spotify permissions remove — Queue an allow/deny pattern removalzad spotify permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad spotify permissions content add-deny-word — Append a case-insensitive deny-wordzad spotify permissions content remove-deny-word — Remove a deny-wordzad spotify permissions content add-deny-regex — Append a deny regexzad spotify permissions content remove-deny-regex — Remove a deny regexzad spotify permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad spotify permissions time — Queue a time-window changezad spotify permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad spotify permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad telegram — Operate the Telegram service (send, read, chats, discover)zad telegram send — Send a message to a chat (private, group, supergroup, or channel)zad telegram read — Fetch recent messages the bot has buffered for a chatzad telegram chats — List chats the bot has seen (local directory + recent updates)zad telegram discover — Poll the Bot API for recent updates and upsert chat aliases into this project's `directory.toml`zad telegram directory — Inspect or hand-edit the name -> chat_id directoryzad telegram directory set — Upsert a name -> chat_id mappingzad telegram directory remove — Remove a single mapping. Silent no-op if the key is absentzad telegram directory clear — Wipe every entry. Use with `--force`zad telegram permissions — Inspect, scaffold, or dry-run the permissions policy that narrows what this service may actually dozad telegram permissions show — Print the effective policy (global + local) for this projectzad telegram permissions init — Write a starter `permissions.toml` at the selected scopezad telegram permissions path — Print the paths considered for this project, in precedence orderzad telegram permissions check — Dry-run: ask whether a proposed action would be admitted *without* hitting the Bot API. Useful for agents that want to pre-flightzad telegram permissions status — Print whether a pending policy exists at each scopezad telegram permissions diff — Show the unified diff between live and pending (if any)zad telegram permissions discard — Discard the pending policy without touching the live filezad telegram permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad telegram permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad telegram permissions add — Queue an allow/deny pattern change. Writes to the pending filezad telegram permissions remove — Queue an allow/deny pattern removalzad telegram permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad telegram permissions content add-deny-word — Append a case-insensitive deny-wordzad telegram permissions content remove-deny-word — Remove a deny-wordzad telegram permissions content add-deny-regex — Append a deny regexzad telegram permissions content remove-deny-regex — Remove a deny regexzad telegram permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad telegram permissions time — Queue a time-window changezad telegram permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad telegram permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad telegram self — Manage the private-chat ID resolved from the literal `@me` in send/read targets. Capture (by polling for your first message to the bot), show, set, or clearzad telegram self show — Print the stored self-chat ID (or note that it's not set)zad telegram self set — Set the self-chat ID directly. No validation — use `capture` for a validated setupzad telegram self clear — Clear the stored self-chat IDzad telegram self capture — Poll `getUpdates` for up to 60s waiting for your first message to the bot, then store that private-chat IDzad ymusic — Operate the YouTube Music service (search, playlists, library)zad ymusic search — Search YouTube (videos, playlists, channels). YouTube Music shares the Data API surface — songs are videos with the `topicId` set to `Music`, but vanilla `video` queries cover most caseszad ymusic playlists — Playlist management (list, show, create, rename, delete, add, remove)zad ymusic playlists list — List the authenticated user's playlistszad ymusic playlists show — Show one playlist's metadata and itemszad ymusic playlists create — Create a new playlist owned by the authenticated userzad ymusic playlists rename — Rename an existing playlistzad ymusic playlists delete — Delete a playlist owned by the userzad ymusic playlists add — Add one or more videos to a playlistzad ymusic playlists remove — Remove one or more items from a playlist (by playlistItem ID or by video ID — the latter is resolved by listing the playlist first)zad ymusic library — Library management — the user's liked videoszad ymusic library list — List the authenticated user's liked videoszad ymusic library like — Like (save) one or more videoszad ymusic library unlike — Unlike (unsave) one or more videoszad ymusic permissions — Inspect or scaffold the permissions policyzad ymusic permissions show — Print the effective policy (both file paths + bodies)zad ymusic permissions path — Print the two candidate file paths, one per linezad ymusic permissions init — Write a starter policy to the selected scopezad ymusic permissions check — Dry-run a permissions check without hitting the networkzad ymusic permissions status — Print whether a pending policy exists at each scopezad ymusic permissions diff — Show the unified diff between live and pending (if any)zad ymusic permissions discard — Discard the pending policy without touching the live filezad ymusic permissions commit — Promote the pending policy to live and upsert a trust-store entry signed with the keychain-held signing keyzad ymusic permissions sign — Sign the live file with the keychain-held signing key and upsert its entry in the per-machine trust store. Use this to trust a hand-edited file or a permissions file shipped from another machine. Requires `zad signing init` to have runzad ymusic permissions add — Queue an allow/deny pattern change. Writes to the pending filezad ymusic permissions remove — Queue an allow/deny pattern removalzad ymusic permissions content — Queue a content `deny_words` / `deny_patterns` / `max_length` changezad ymusic permissions content add-deny-word — Append a case-insensitive deny-wordzad ymusic permissions content remove-deny-word — Remove a deny-wordzad ymusic permissions content add-deny-regex — Append a deny regexzad ymusic permissions content remove-deny-regex — Remove a deny regexzad ymusic permissions content set-max-length — Set the `max_length` codepoint cap. Pass `--clear` to removezad ymusic permissions time — Queue a time-window changezad ymusic permissions time set-days — Replace the weekday allow-list. Comma-separated: `mon,tue,wed`zad ymusic permissions time set-windows — Replace the HH:MM-HH:MM window list. Comma-separatedzad signing — Manage the local signing key and trust storezad signing init — Bootstrap the local signing key. Mints a fresh Ed25519 keypair in the OS keychain and initializes an empty signed trust store. Safe to run on a machine that already has a key (idempotent without --force)zad signing show — Print the local signing key's fingerprint and the paths of the public-key cache and trust storezad commands — Enumerate CLI commands, flags, and realistic exampleszad docs — Print topic documentation embedded at build timezad man — Print reference manpages embedded at build timezad docs architecturezad docs configurationzad docs getting-startedzad docs permissionszad docs serviceszad docs troubleshooting