Skip to main content

Synopsis

screenjson-export -i <file> [options]

Flags

Flag (short / long)DefaultDescription
-i · --input <path>Input file. Required. Extension determines format unless -f is set.
-o · --output <path>stdoutOutput file path.
-f · --format <name>autoForce fdx, fountain, or fadein.
--lang <tag>enBCP 47 primary language tag. Written to the output’s lang field and becomes the key for every extracted text map.
--prettytruePretty-print the JSON output with two-space indentation.
-v · --versionPrint version and exit.
-h · --helpPrint help and exit.

Format detection

Auto-detected from extension:
ExtensionFormat
.fdxfdx
.fountain, .spmdfountain
.fadeinfadein
Unrecognised extensions require -f.

Examples

# FDX → ScreenJSON (stdout)
screenjson-export -i screenplay.fdx

# Write to file
screenjson-export -i screenplay.fdx -o screenplay.json

# Fountain, auto-detected
screenjson-export -i draft.fountain -o draft.json

# FadeIn, auto-detected
screenjson-export -i episode.fadein -o episode.json

# Force format on a renamed file
screenjson-export -i script.txt --format fountain -o script.json

# Pipe into jq
screenjson-export -i screenplay.fdx | jq '.title.en'

# French as primary language
screenjson-export -i script.fdx --lang fr -o script.json

# Minified JSON (no pretty-print)
screenjson-export -i screenplay.fdx --pretty=false -o screenplay.min.json

Docker

# Single conversion, current directory mounted
docker run --rm -v "$PWD:/data" screenjson/export \
  -i /data/screenplay.fdx -o /data/screenplay.json

# Pipe through jq
docker run --rm -v "$PWD:/data" screenjson/export -i /data/script.fdx \
  | jq '.document.scenes | length'

Exit codes

CodeMeaning
0Success.
1Runtime error (unreadable file, parse error, unsupported format).
2Usage error (missing -i, bad flag).

Output shape

The output is a ScreenJSON document with generator set to:
{
  "generator": { "name": "screenjson-export", "version": "v1.0.0" }
}