Skip to main content

Preship: FastAPI 스테이징 URL을 퍼징해 터지는 입력과 패턴별 AI 수정 프롬프트를 내주는 출시 전 진단 CLI.

Project description

Preship

Hammer your FastAPI staging app before launch — find the inputs that crash it, and get a fix for each.

Give it one staging URL. Preship fuzzes every endpoint and tells you:

  • What breaks — unhandled 500s (the inputs that crash it), undocumented responses, and schema mismatches, grouped by pattern.
  • How to fix it — one copy-paste fix prompt per pattern, ready to drop into whichever AI you use (ChatGPT, Claude, Gemini, anything).

No API key required. Finding the issues and getting the fix prompts works entirely without one.


1. Install

Requires Python 3.10+.

pip install preship

This adds the preship command:

preship --help

2. Point it at a staging URL + add an ownership-check route

Preship only scans URLs you own, so it can't be pointed at someone else's server. Before the first scan you prove the URL is yours — once — by adding a single verification route to your app.

Run a scan once and Preship prints your token and the exact route code to paste. Drop the token into the snippet below, add it to your app, and redeploy.

# Add this one route to your FastAPI app (anywhere below app = FastAPI())
from fastapi.responses import PlainTextResponse

@app.get("/.well-known/preflight-verify")
def preflight_verify():
    return PlainTextResponse("paste the token that scan printed here")

The first scan tells you the exact token and prints the route code too — no guessing, just copy what it shows. The token is fixed per URL, so you only add this once.

3. Run the scan

preship scan https://your-staging.example.com

If your staging is behind auth, pass headers along:

preship scan https://your-staging.example.com --header "Authorization: Bearer <token>"

4. Reading the results

The output has two parts.

(1) Findings report — same-kind problems are grouped into patterns and tagged by severity: [HIGH] (the server crashes with a 500) or [LOW] (response-contract mismatch). Each pattern lists the affected endpoints and the actual request → response Preship observed.

(2) AI fix prompts — one prompt block per pattern. Copy a block whole and paste it into whichever AI you use, and you get a likely cause, a FastAPI fix, and an explanation. The prompts contain only what the scanner observed (never your source code) and aren't tied to any specific AI.

Beta: the AI fix prompts are free during beta. Features and policy may change at general availability.

Apply a fix and run preship scan again to confirm the pattern is gone.


Advanced (optional): auto-generated patch drafts

Want auto-generated patch drafts too? Put your own Anthropic API key in your own environment and scan. Without it, the fix prompts above still work — the key is entirely optional.

export ANTHROPIC_API_KEY="sk-ant-..."   # your key. The default beta path needs no key — the prompts alone are enough.
preship scan https://your-staging.example.com

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

preship-0.1.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preship-0.1.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file preship-0.1.1.tar.gz.

File metadata

  • Download URL: preship-0.1.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for preship-0.1.1.tar.gz
Algorithm Hash digest
SHA256 07b181d0e98c04ef54750060bb6dc82b7863973ed7f7e8d95d320a59335fec7b
MD5 228459e1a7623c3222818c2020328eec
BLAKE2b-256 87edad2daa796b31e6ecbe7318da72fb6f4bd2b5e9c7fb35161ff8046fbc9b66

See more details on using hashes here.

File details

Details for the file preship-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: preship-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for preship-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ace562e6e3bee3abd8b75e3cd48efe002f0d4dc94d9700eb912c17b85f1df91
MD5 be5c98148b61c7f04fe943ecb8b7e73d
BLAKE2b-256 9d4d2adf7d3a06c7cadc50ee44f4f5336fc0c70882b47a7f0f028909d687ebef

See more details on using hashes here.

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