Skip to content
TypeScript SDK

TypeScript SDK

The TypeScript SDK provides helpers for reading the overseer context and applying consistent terminal styling.

Source: sdk/typescript/

Install

npm install @arthurvasconcelos/overseer-sdk

Reading context

import { loadContext, getSecret } from "@arthurvasconcelos/overseer-sdk";

const ctx = loadContext();

console.log(ctx.version);     // overseer version string
console.log(ctx.configPath);  // path to merged config file

// Retrieve a resolved secret declared in the sidecar manifest
const token = getSecret(ctx, "github.personal", "token");

loadContext() reads and parses the OVERSEER_CONTEXT environment variable injected by overseer at runtime.

Styling

import { styles, sectionHeader, warnLine } from "@arthurvasconcelos/overseer-sdk";

// Section header
console.log(sectionHeader("Deployments", "production"));
// → ▸ Deployments  ·  production

// Warning line
console.log(warnLine("auth", "token expired"));
// → ⚠  auth: token expired

Color tokens

TokenCodeColorUsage
styles.header99PurpleSection titles (bold)
styles.accent212PinkKeys, channels, usernames
styles.ok82GreenSuccess states (bold)
styles.warn214AmberWarnings (bold)
styles.error196RedErrors (bold)
styles.muted240Dark greyHints, empty state
styles.dim245GreySecondary info
styles.normal252LightBody text

All color codes use the xterm 256-color palette, which works in any modern terminal.

Example plugin

#!/usr/bin/env ts-node
import { loadContext, sectionHeader } from "@arthurvasconcelos/overseer-sdk";

const ctx = loadContext();
console.log(sectionHeader("My Plugin", ctx.version));
// ... your plugin logic

Compile to a single executable (e.g. with esbuild or pkg), name it overseer-myplugin, and drop it in brain/overseer/plugins/.