relio-cli
Package relio-cli includes:
- CLI command (
relio)
- SDK modules:
relio-cli/client
relio-cli/server
relio-cli/core
Commands
relio login
relio whoami
relio auth test
relio logout
relio profiles list
relio profiles use <name>
relio login
-s, --server <url>: Relio server URL (defaults to RELIO_SERVER_URL or http://localhost:3000)
--profile <name>: Profile name to store credentials under (default: default)
--client-name <name>: Name shown on the approval screen
--token-name <name>: Name for the created workspace API key
--expires-in <seconds>: Device code expiry (60 to 900)
--no-open: Skip opening the browser automatically
relio whoami
Reads the current profile (or --profile) and prints identity/auth info from the API.
relio auth test
Validates that the current profile API key is accepted by the server.
relio logout
Removes credentials for the active profile (or --profile / --all).
relio profiles
relio profiles list: list all saved profiles
relio profiles use <name>: set active profile
Credentials are stored at:
~/.config/relio/config.json
SDK (relio-cli/client)
import { createRelioClient } from "relio-cli/client";
const relio = createRelioClient({
baseUrl: "http://localhost:3000",
apiKey: process.env.RELIO_API_KEY!,
});
const page = await relio.contacts.list({ limit: 50 });
const contact = await relio.contacts.create({
firstName: "Ada",
lastName: "Lovelace",
email: [{ address: "ada@example.com", isPrimary: true }],
});
await relio.contact.update(contact.id, { notes: "Imported from partner CRM" });
Contact sync helpers
await relio.ingestContacts(rows);
await relio.upsertContactByPrimaryEmail("ada@example.com", {
firstName: "Ada",
lastName: "Lovelace",
});
SDK (relio-cli/server)
import { createRelioServerClient, verifyRelioWebhookRequest } from "relio-cli/server";
const relio = createRelioServerClient({
baseUrl: "http://localhost:3000",
apiKey: process.env.RELIO_API_KEY!,
});
await relio.contact.create({
firstName: "Grace",
lastName: "Hopper",
});
export async function POST(req: Request) {
const verified = await verifyRelioWebhookRequest({
request: req,
secret: process.env.RELIO_WEBHOOK_SECRET!,
});
console.log(verified.event, verified.payload);
return new Response("ok");
}