CLI Config-as-Code
Use the CLI with a TypeScript config file to manage relays, schedules, and relay rules idempotently.
Create beeps.config.ts
Section titled “Create beeps.config.ts”import type { OncallConfig } from "@beepsdev/sdk";
const config = { version: 1, relays: [ { externalKey: "myco::relay::primary", name: "Primary", description: "Primary rotation", }, ], schedules: [ { externalKey: "myco::schedule::primary-weekly", relayExternalKey: "myco::relay::primary", name: "Primary Schedule", type: "weekly", startDay: "monday", startTime: "00:00", members: [{ email: "dev1@myco.com" }, { email: "dev2@myco.com" }], }, ], relayRules: [ { externalKey: "myco::rule::primary-notify", relayExternalKey: "myco::relay::primary", group: "default", order: 1, name: "Notify Primary", ruleType: "schedule_notify", enabled: true, config: { scheduleExternalKey: "myco::schedule::primary-weekly", }, }, ],} satisfies OncallConfig;
export default config;Validate and Plan
Section titled “Validate and Plan”beeps config lint -f beeps.config.tsbeeps relay plan -f beeps.config.tsFor CI:
beeps config lint -f beeps.config.ts --jsonbeeps relay plan -f beeps.config.ts --jsonApply Changes
Section titled “Apply Changes”beeps relay apply -f beeps.config.tsTo remove relay rules that are not in the config:
beeps relay apply -f beeps.config.ts --pruneExport From Remote
Section titled “Export From Remote”beeps relay export -o beeps.config.tsCLI Auth
Section titled “CLI Auth”export BEEPS_API_KEY="bk_your_key_here"export BEEPS_BASE_URL="https://api.beeps.dev/v0"Config File
Section titled “Config File”{ "apiKey": "bk_your_key_here", "baseUrl": "https://api.beeps.dev/v0"}beeps relay plan --config ./beeps.cli.jsonexport ONCALL_CLI_CONFIG="./beeps.cli.json"