@superrelay/cli
v3.0.0
Published
Command-line client for the Relay public API: conversations, contacts, companies, products, knowledge bases, and Crisp migration.
Maintainers
Readme
@superrelay/cli
Command-line client for the Relay public REST API (/v1/public). Manage
conversations, contacts, companies, products, and knowledge bases from your
terminal, sync a knowledge base with a folder of markdown files, and migrate
data from Crisp.
Every command supports --json for machine-readable output. Full documentation
lives in the docs site under API reference → CLI and Docs as code
(apps/app-docs/content/docs/api-reference/).
Install
npm install -g @superrelay/cli
relay --helpOr run it without installing:
npx @superrelay/cli --helpBoth relay and superrelay are installed as commands. Requires Node 20+.
Develop
From the repository root:
bun install
bun run apps/cli/index.ts --helpOr link it globally so relay is on your PATH:
cd apps/cli && bun linkPublish
cd apps/cli
bun run build # bundles index.ts + deps into dist/index.js (Node shebang)
npm publish # runs the build again via prepublishOnlyConfigure
relay config --api-key rl_live_xxxxxxxx
relay config --api-url http://localhost:4000 # optional, for a local API
relay config --showRELAY_API_KEY and RELAY_API_URL environment variables take precedence over
stored config, which is what CI and agents should use.
Knowledge base sync
relay kb pull docs --kb "Acme Help Center" # first time binds the folder
# edit the markdown files…
relay kb push docs --dry-run
relay kb push docsImages and files linked with relative paths () are
uploaded on push and mapped back to relative links on pull; relay kb upload
<file> uploads on its own and prints the URL.
The folder layout and conflict rules are in src/lib/kb-files.ts,
src/lib/kb-sync.ts, and src/lib/kb-assets.ts; the planning logic is pure
and covered by the tests next to it.
Layout
index.ts— command registrationsrc/commands/— one module per command groupsrc/lib/api.ts— HTTP client; response types come from@relay/api-types, the same package the API's serializers are typed withsrc/lib/format.ts— human-readable outputsrc/lib/config.ts— credential storage (conf)
Checks
bun run typecheck
bun test