Hammer your FastAPI staging app before launch — find the inputs that crash it and get a copy-paste AI fix prompt for each. No API key needed.
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 scanagain 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
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 preship-0.1.2.tar.gz.
File metadata
- Download URL: preship-0.1.2.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71e69598d7feb109148f11c287d88df2d988f068773d818f7e72b4611ed3850b
|
|
| MD5 |
0f0f7dde2b1cc74fe5ef51b8cbb1518d
|
|
| BLAKE2b-256 |
ed9d6cf53470d00c6dec8ada5f26aa9758385c974e8363908579bfe6088e14d7
|
File details
Details for the file preship-0.1.2-py3-none-any.whl.
File metadata
- Download URL: preship-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06120b9e66a8ebd879897afd44564a105c6171d573348827cc8324f7af0cfcbd
|
|
| MD5 |
0c8abaf5e0d9a8338b3e2ec5cfd0764e
|
|
| BLAKE2b-256 |
f851936b45d7f642c909f37bf0632c0eaaefe16a96f4a4d7ec45a3bf335682fc
|