Start it
screenjson serve --host 0.0.0.0 --port 8080
Optional flags:
| Flag | Description |
|---|---|
--workers | Worker pool size. Defaults to CPU cores. |
--gotenberg | Gotenberg URL for HTML→PDF. |
--tika | Apache Tika URL for content extraction. |
--llm | OpenAI-compatible LLM endpoint URL. |
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET | / | Queue status / metrics |
GET | /health | Liveness |
GET | /formats | Supported formats |
POST | /convert | Screenplay file → ScreenJSON |
POST | /export | ScreenJSON → screenplay file |
POST | /validate | ScreenJSON → { valid, errors[] } |
Convert via HTTP
Multipart (simplest for browsers):
curl -X POST http://localhost:8080/convert \
-F "[email protected]" \
-F "format=fdx" \
-F "lang=en"
Octet-stream (cleanest for bots):
curl -X POST http://localhost:8080/convert \
-H "Content-Type: application/octet-stream" \
-H "X-Input-Format: fdx" \
--data-binary @screenplay.fdx
Export via HTTP
curl -X POST http://localhost:8080/export \
-H "Content-Type: application/json" \
-H "X-Output-Format: fountain" \
-d @screenplay.json \
-o screenplay.fountain
Validate via HTTP
curl -X POST http://localhost:8080/validate \
-H "Content-Type: application/json" \
-d @screenplay.json
Returns:
{ "valid": true, "errors": [] }
In Docker
docker run --rm -p 8080:8080 screenjson/cli serve --port 8080