Skip to main content

OPI — Open Prompt Initiative

Track, redact, and share your AI coding tool usage across a team.

OPI extracts prompt sessions from tools like Claude Code, Codex CLI, and Gemini CLI, strips sensitive data, and exports them as JSON to a shared directory in your git repo. A pre-commit hook keeps everything in sync automatically.

Why

AI coding tools generate thousands of prompts, but that usage data stays siloed on each developer's machine. OPI makes it visible:

  • See what models your team is using — shields.io badges in your README show token counts per model
  • Share prompt history — exported sessions live in opi-prompts/ alongside your code
  • Keep secrets out of git — built-in redaction strips API keys, PII, file paths, and URLs before export

Install

# With uv (recommended)
uv tool install opi-cli

# Or with pip
pip install opi-cli

Or run without installing:

uvx opi-cli init

Quick start

cd your-repo

# Set up pre-commit hook and opi-prompts/ directory
opi init

# Run the pipeline: extract, redact, export, generate badges
opi update

That's it. On every commit, the pre-commit hook runs opi update to keep your prompt exports current.

Commands

Command Purpose
opi init Set up pre-commit hook in current git repo
opi update Extract, redact, export sessions, and generate README with badges
opi config Manage redaction settings
opi sources Show detected AI coding tools

Multi-user

Each developer runs opi update independently. Sessions export to opi-prompts/ which is committed to git. The generated README aggregates token usage from all users' exports, so badges reflect the full team's usage.

Redaction

By default, OPI redacts:

  • API keys and tokens (OpenAI, GitHub, AWS, etc.)
  • PII (email addresses)
  • File paths
  • URLs with credentials

Configure via opi config --edit or ~/.opi/config.toml:

[redact]
secrets = true
pii = true
file_paths = true
urls = true
org_terms = ["acme-corp", "internal-project"]

Supported tools

License

MIT

Metadata

Release files for opi-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opi-cli 0.1.1
File Size Uploaded Provenance
opi_cli-0.1.1.tar.gz 29.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for opi-cli 0.1.1
File Interpreter ABI Platform
opi_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 52.0 kB

Release files / opi_cli-0.1.1.tar.gz

Download URL opi_cli-0.1.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
616322dda06721a426e78a3ff5b2e0e009222ee9b4fcde10c9aa2aa9c58af206
BLAKE2b-256 checksum
How to use checksums
0fb313435b2e5c60962182bd5f681382e6839ebb5941244004e5eafe88caf99f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / opi_cli-0.1.1-py3-none-any.whl

Download URL opi_cli-0.1.1-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfa089c07d6a3bb21e728c4899195b2e7cafc74f2d8678092a1a227e9a085569
BLAKE2b-256 checksum
How to use checksums
0f042b142f3c801a6ad353c22e875075146496ed5fed27f0bfffcb3c7a1120dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Security for opi-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opi_cli-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page