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.
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:
GITHUB_TOKENenvironment variablegh 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa88dec642e749060e8c0d1baa323a52157a9f1b735d61576688fcfa88c562e4
|
|
| MD5 |
a15d261ad8843db3a26dadd635afb995
|
|
| BLAKE2b-256 |
63c966215ec17526deeaf4be35ee023c661e2c1424532a6e97c63b396d619fd1
|
Provenance
The following attestation bundles were made for gh_sops-1.0.1.tar.gz:
Publisher:
publish.yml on danwiltshire/gh-sops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_sops-1.0.1.tar.gz -
Subject digest:
aa88dec642e749060e8c0d1baa323a52157a9f1b735d61576688fcfa88c562e4 - Sigstore transparency entry: 1340790653
- Sigstore integration time:
-
Permalink:
danwiltshire/gh-sops@3a29deda0f9dff6a1da0df6e42233e15969c5822 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/danwiltshire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a29deda0f9dff6a1da0df6e42233e15969c5822 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5b2c74c7e3d6ab7e2fcf197f0929990445c6369b45bbf7f0178583f50c57210
|
|
| MD5 |
8f93145f4b1522370219c801a77aa959
|
|
| BLAKE2b-256 |
81e9c23244d8d1e0dbcd55d8d0a845c433fddd8dca04548bacb91f62c991c42b
|
Provenance
The following attestation bundles were made for gh_sops-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on danwiltshire/gh-sops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_sops-1.0.1-py3-none-any.whl -
Subject digest:
d5b2c74c7e3d6ab7e2fcf197f0929990445c6369b45bbf7f0178583f50c57210 - Sigstore transparency entry: 1340790661
- Sigstore integration time:
-
Permalink:
danwiltshire/gh-sops@3a29deda0f9dff6a1da0df6e42233e15969c5822 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/danwiltshire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a29deda0f9dff6a1da0df6e42233e15969c5822 -
Trigger Event:
release
-
Statement type: