operation-ghostwriter
v0.1.0
Published
Extract OpenAPI specs from running HTTP APIs
Maintainers
Readme
Operation Ghostwriter 🚀
One-command OpenAPI spec extractor for any running HTTP API.
Features
- 🔍 Automatic API spec discovery
- 🐍 Python ASGI/WSGI app support
- 🔄 Proxy-based traffic capture
- 🎯 Smart crawling & request generation
- ✨ Post-processing & linting
Requirements
- Node.js 18 or later
- Docker (for proxy-based traffic capture)
- Python 3.7+ (for Python app support)
Installation
npm install -g operation-ghostwriterQuick Start
# Extract from remote API
grab-api https://api.example.com
# Extract from local Python app
grab-api --app "myproj.main:app"
# Run tests to capture API usage
grab-api https://api.example.com --run "pytest tests/"The OpenAPI spec will be saved to dist/openapi.yaml.
How It Works
- Probe: Tries common OpenAPI spec endpoints
- Python: Extracts from ASGI/WSGI apps if available
- Proxy: Captures traffic through mitmproxy
- Process: Lints and formats the spec
Security
- 🔒 TLS interception requires CA cert installation
- 🚫 Sensitive data is redacted from the spec
- 🧹 CA cert is automatically removed after use
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Run tests
npm testContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT © Anthony Azrak
Support
If you find this tool helpful, please consider:
- Starring the repository
- Opening issues for bugs or feature requests
- Contributing code or documentation improvements
