Skip to main content

Python SDK for building Overseer plugins

Project description

overseer-sdk (Python)

PyPI Python Tests

Python SDK for building external plugins for overseer — a personal developer CLI that unifies daily workflows.


What is an overseer plugin?

overseer supports external plugins: any executable named overseer-<name> on PATH or in brain/overseer/plugins/ is automatically registered as overseer <name>. Plugins can also hook into the daily briefing and status health-check commands.

This SDK gives you the context, helpers, and styling primitives to write those plugins in Python.


Install

pip install overseer-sdk

Or with uv:

uv add overseer-sdk

Quick start

#!/usr/bin/env python3
from overseer_sdk import PluginContext, StatusResult, run_main, section_header, ok_line

def daily(ctx: PluginContext) -> str:
    token = ctx.secret("myservice", "token")
    # ... fetch data using token ...
    lines = [str(section_header("My Service", "2 items"))]
    lines.append(str(ok_line("all good")))
    return "\n".join(lines)

def status(ctx: PluginContext) -> list[StatusResult]:
    return [StatusResult(name="myservice", ok=True, message="connected")]

if __name__ == "__main__":
    run_main(daily_fn=daily, status_fn=status)

Save it as overseer-myservice, make it executable, and drop it in brain/overseer/plugins/. Add a sidecar manifest:

// overseer-myservice.json
{
  "description": "My service integration",
  "secrets": ["myservice"],
  "hooks": ["daily", "status"]
}

API reference

PluginContext

Loaded from the OVERSEER_CONTEXT environment variable that overseer injects before calling your plugin.

from overseer_sdk import PluginContext

ctx = PluginContext.from_env()

ctx.version      # str — overseer version
ctx.config_path  # str — path to the active config.yaml
ctx.secrets      # dict[str, dict[str, str]] — resolved secrets

ctx.secret(ref, key) -> str

Return a resolved secret value by integration ref and key. Raises KeyError if the ref or key is not found — this usually means the secret wasn't declared in the plugin manifest.

token = ctx.secret("github.personal", "token")

run_main(daily_fn, status_fn)

Wire up your plugin's hooks from CLI arguments. Call this at the bottom of your script.

from overseer_sdk import run_main

run_main(daily_fn=my_daily, status_fn=my_status)
  • When called with daily: runs daily_fn(ctx), prints the returned string to stdout.
  • When called with status: runs status_fn(ctx), serialises the returned list to JSON on stdout.
  • Either argument can be omitted if your plugin only implements one hook.

StatusResult

from overseer_sdk import StatusResult

StatusResult(name="github", ok=True, message="authenticated as user@example.com")
StatusResult(name="jira", ok=False, message="token expired")

notify(title, message, subtitle="")

Fire a native desktop notification via overseer notify.

from overseer_sdk import notify

notify("Deploy done", "my-service v1.2.3 is live")
notify("Build failed", "see CI logs", subtitle="my-repo")

Styling

The SDK exposes the same colour palette and helpers used by the overseer CLI itself, built on rich.

from rich.console import Console
from overseer_sdk import (
    section_header,  # ▸ Label  ·  badge
    ok_line,         # ✓  label: message
    warn_line,       # ⚠  label: message
    error_line,      # ✗  label: message
    STYLE_HEADER, STYLE_ACCENT, STYLE_OK, STYLE_WARN,
    STYLE_ERROR, STYLE_MUTED, STYLE_DIM, STYLE_NORMAL,
)

console = Console()
console.print(section_header("GitHub", "3 open PRs"))
console.print(ok_line("auth", "user@example.com"))
console.print(warn_line("rate limit", "80% used"))
console.print(error_line("token", "expired"))

How overseer calls your plugin

overseer sets the OVERSEER_CONTEXT environment variable to a JSON object before invoking your plugin binary:

{
  "version": "1.2.3",
  "config_path": "/Users/you/brain/overseer/config.yaml",
  "secrets": {
    "myservice": {
      "token": "resolved-secret-value"
    }
  }
}

Secrets listed in the manifest are pre-resolved (including op:// 1Password references) before the plugin is called. Your plugin never needs to touch the op CLI directly.


Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overseer_sdk-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

overseer_sdk-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file overseer_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: overseer_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for overseer_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 29bda5a5f7d0443eba1c83b833d583903d67cf62c805e4d8b421fb572d2c7e4e
MD5 76009db2aa81c4318dfe5421a94448cc
BLAKE2b-256 1d43e0245140afc896f2f79b6da0b0c6280ee908fc2a82fe5f697529daf8ee64

See more details on using hashes here.

File details

Details for the file overseer_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: overseer_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for overseer_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56a2e93ed8e7b3aa6a31f05e9ae52e96267bcf1c897209154542f5ac03970950
MD5 3d8dcb1c76aac05bd06258afbb890f1a
BLAKE2b-256 86dbcb78b8d1b8037c9c557b22f5fd92d4ce373912df5313f0c36beb645d91f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page