Skip to main content

CLI-driven SOP generator powered by GitHub Copilot SDK

Project description

sops

CLI-driven SOP manager powered by the GitHub Copilot SDK.

Write a symptom and resolution, and sops generates a structured SOP document and raises a pull request against your SOP repository — all from the terminal.

CI

Installation

pip install sops

Requires Python 3.11+. Authenticate with GitHub before first use:

gh auth login

Quick start

Point sops at your SOP repository, then record your first entry:

sops config set sop-repository owner/repo

sops edit payments --service refunds

Your editor opens with a template. Fill in the symptom and the steps to resolve it, save, and sops generates the SOP and raises a PR.

Commands

sops edit <app> [--service <service>]

Record a new SOP entry for an application (and optionally a specific service). Opens your editor twice — once for the problem, once for the resolution — then raises a PR against the configured repository.

sops edit datadog --service api

sops context <app> [--service <service>]

Add or update background context for an application. This context is stored as CONTEXT.md in the app directory and is read by the ask command to provide more accurate answers.

sops context datadog

sops ask <app> <question>

Ask a question about an application using its SOP content. The model reads all SOP and context files for the app from the repository and answers based solely on that content.

sops ask datadog "Why am I getting rate limited on /v1/metrics?"

sops list

List all SOPs available in the configured repository.

sops list

sops config set <key> <value> / sops config get <key>

Read and write sops configuration. Config is stored at ~/.config/sops/config.json.

sops config set sop-repository owner/repo
sops config get sop-repository

Configuration keys

Key Description
sop-repository GitHub repository (owner/repo) where SOPs are stored. Required by all commands except config.

Repository structure

sops expects (and maintains) this layout in the SOP repository:

{app}/
  SOP.md          ← used when no --service is provided
  {service}.md    ← used when --service is provided
  CONTEXT.md      ← background context written by `sops context`

Authentication

sops reads a GitHub token in the following order:

  1. GITHUB_TOKEN environment variable
  2. gh auth token (GitHub CLI)

The token must have permission to read and write to the SOP repository.

Developing

Prerequisites

  • Python 3.11+
  • uv

Setup

uv sync
uv run pre-commit install

Running tests

uv run pytest tests/ -v

Linting

Ruff is configured in pyproject.toml. Pre-commit runs it automatically on every commit.

To run manually:

uv run pre-commit run --all-files

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

gh_sops-1.0.1.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

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

gh_sops-1.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file gh_sops-1.0.1.tar.gz.

File metadata

  • Download URL: gh_sops-1.0.1.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gh_sops-1.0.1.tar.gz
Algorithm Hash digest
SHA256 aa88dec642e749060e8c0d1baa323a52157a9f1b735d61576688fcfa88c562e4
MD5 a15d261ad8843db3a26dadd635afb995
BLAKE2b-256 63c966215ec17526deeaf4be35ee023c661e2c1424532a6e97c63b396d619fd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_sops-1.0.1.tar.gz:

Publisher: publish.yml on danwiltshire/gh-sops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gh_sops-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gh_sops-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gh_sops-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b2c74c7e3d6ab7e2fcf197f0929990445c6369b45bbf7f0178583f50c57210
MD5 8f93145f4b1522370219c801a77aa959
BLAKE2b-256 81e9c23244d8d1e0dbcd55d8d0a845c433fddd8dca04548bacb91f62c991c42b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_sops-1.0.1-py3-none-any.whl:

Publisher: publish.yml on danwiltshire/gh-sops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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