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.0.tar.gz (60.9 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.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_sops-1.0.0.tar.gz
  • Upload date:
  • Size: 60.9 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.0.tar.gz
Algorithm Hash digest
SHA256 3a230792b08b4402e9338dfdbbd70955436073a48726936103c851aeee1d53ad
MD5 3c0d253d3a966976e55ab12afa470f0b
BLAKE2b-256 1f84d2e52cf6f7801afbb74b8140f6fd5cf4508a3e0088e492a339d6c370a31f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_sops-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: gh_sops-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e55f779bc203dcb055119681b504e66e508464cb3998b41cb89ce6ab82c6ed30
MD5 80b1a126db90c7d16ef6c5f45a6687c3
BLAKE2b-256 b9be06817be8f2cbc37619ade552e154c48f9e2dba45f42d9e25a78ded7adca9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_sops-1.0.0-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