Skip to content

Python SDK

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

Source: sdk/python/

Install

pip install overseer-sdk

Reading context

from overseer_sdk import PluginContext

ctx = PluginContext.from_env()

print(ctx.version)      # overseer version string
print(ctx.config_path)  # path to merged config file

# Retrieve a resolved secret declared in the sidecar manifest
token = ctx.secret("github.personal", "token")

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

Styling

from overseer_sdk import styles

# Section header
print(styles.section_header("Deployments", "production"))
# → ▸ Deployments  ·  production

# Warning line
print(styles.warn_line("auth", "token expired"))
# → ⚠  auth: token expired

Color tokens

TokenCodeColorUsage
STYLE_HEADER99PurpleSection titles (bold)
STYLE_ACCENT212PinkKeys, channels, usernames
STYLE_OK82GreenSuccess states (bold)
STYLE_WARN214AmberWarnings (bold)
STYLE_ERROR196RedErrors (bold)
STYLE_MUTED240Dark greyHints, empty state
STYLE_DIM245GreySecondary info
STYLE_NORMAL252LightBody text

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

Example plugin

#!/usr/bin/env python3
from overseer_sdk import PluginContext, styles

ctx = PluginContext.from_env()
print(styles.section_header("My Plugin", ctx.version))
# ... your plugin logic

Make the file executable and name it overseer-myplugin, then drop it in brain/overseer/plugins/.