CLI tool for ProdSensor production readiness analysis
Project description
ProdSensor CLI
Command-line tool for running ProdSensor production readiness analysis in CI/CD pipelines.
Installation
pip install prodsensor-cli
Quick Start
- Get an API key from prodsensor.com/app
- Set up authentication:
# Option 1: Environment variable (recommended for CI/CD)
export PRODSENSOR_API_KEY=ps_live_your_key_here
# Option 2: Save to config file
prodsensor config set-key ps_live_your_key_here
- Run an analysis:
prodsensor analyze https://github.com/your-org/your-repo
Commands
analyze
Analyze a repository for production readiness.
# Basic usage
prodsensor analyze https://github.com/owner/repo
# With JSON output
prodsensor analyze https://github.com/owner/repo --format json
# Start analysis without waiting
prodsensor analyze https://github.com/owner/repo --no-wait
# Custom timeout (10 minutes)
prodsensor analyze https://github.com/owner/repo --timeout 600
# Only fail on blockers (not warnings)
prodsensor analyze https://github.com/owner/repo --fail-on blockers
status
Check the status of an analysis run.
prodsensor status <run-id>
prodsensor status <run-id> --format json
report
Get the full analysis report.
prodsensor report <run-id>
prodsensor report <run-id> --format json
prodsensor report <run-id> --format markdown
prodsensor report <run-id> --format json -o report.json
config
Manage CLI configuration.
# Save API key
prodsensor config set-key ps_live_your_key
# Remove saved API key
prodsensor config clear-key
# Show current configuration
prodsensor config show
Exit Codes
The CLI uses exit codes that work with CI/CD pipelines:
| Code | Meaning |
|---|---|
| 0 | PRODUCTION_READY |
| 1 | NOT_PRODUCTION_READY |
| 2 | CONDITIONALLY_READY |
| 3 | API/Network error |
| 4 | Authentication error |
| 5 | Timeout |
CI/CD Integration
GitHub Actions
- name: Run ProdSensor Analysis
env:
PRODSENSOR_API_KEY: ${{ secrets.PRODSENSOR_API_KEY }}
run: |
pip install prodsensor-cli
prodsensor analyze https://github.com/${{ github.repository }}
Or use the dedicated GitHub Action:
- uses: prodsensor/action@v1
with:
api-key: ${{ secrets.PRODSENSOR_API_KEY }}
GitLab CI
production-readiness:
script:
- pip install prodsensor-cli
- prodsensor analyze https://gitlab.com/$CI_PROJECT_PATH
variables:
PRODSENSOR_API_KEY: $PRODSENSOR_API_KEY
Jenkins
pipeline {
environment {
PRODSENSOR_API_KEY = credentials('prodsensor-api-key')
}
stages {
stage('Production Readiness') {
steps {
sh 'pip install prodsensor-cli'
sh 'prodsensor analyze ${GIT_URL}'
}
}
}
}
Environment Variables
| Variable | Description |
|---|---|
PRODSENSOR_API_KEY |
API key for authentication |
PRODSENSOR_API_URL |
Custom API URL (for self-hosted) |
Output Formats
Summary (default)
Human-readable summary with verdict, score, and findings count.
JSON
Full report data as JSON, suitable for parsing in scripts.
Markdown
Report formatted as markdown, suitable for PR comments.
License
MIT
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 prodsensor_cli-1.0.1.tar.gz.
File metadata
- Download URL: prodsensor_cli-1.0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad764c6bc29499f3498427f0afe325618dc7853101769fb87fb3c1b9636e0f13
|
|
| MD5 |
d24e681995e035db7d395e9c14a6df7a
|
|
| BLAKE2b-256 |
03336205bc4ae90dc08d7c3a21d9cf5b52a84c1993c907d9bce0618ac464a236
|
File details
Details for the file prodsensor_cli-1.0.1-py3-none-any.whl.
File metadata
- Download URL: prodsensor_cli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b459a6fa5e952700db16ddd85e83ad470d66d07a97ce6c144a675adda8ff9521
|
|
| MD5 |
02eb52aa45a6402edc39d83087c97e7c
|
|
| BLAKE2b-256 |
8aba14ca1a4461bbe61594b69c46566d6b08f47b715966c37b098c054aaa3d98
|