Skip to content

CLI reference

This page is generated from the same argparse definitions used by the installed parsehawk command. Change CLI help in code, run just references-export, and commit the updated page.

Code Meaning
0 Command completed successfully.
1 Runtime, API, configuration, validation, or local-environment failure.
2 Command-line usage error reported by argparse.

Errors are written to standard error. API failures include the HTTP status and response body; connection failures include the target API URL.

Run and operate the local-first ParseHawk document extraction platform.

Terminal window
$ parsehawk [-h] {start,dev,restart,stop,status,migrate,doctor,config,runtime,extract,files,schemas,extractors,providers,jobs} ...
Terminal window
$ parsehawk --help
Argument Description Required Default
-h, --help show this help message and exit No

Start ParseHawk and its bundled services.

Terminal window
$ parsehawk start [-h] [--host HOST] [--port PORT] [--data-dir DATA_DIR] [--runtime-host RUNTIME_HOST] [--runtime-port RUNTIME_PORT] [--model MODEL] [-x COMPONENT] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS] [--web-host WEB_HOST] [--web-port WEB_PORT] [--no-web]
Terminal window
$ parsehawk start
Argument Description Required Default
-h, --help show this help message and exit No
--host HOST API bind address. No 127.0.0.1
--port PORT API port. No 8000
--data-dir DATA_DIR Directory for the database, uploaded files, logs, and runtime state. No
--runtime-host RUNTIME_HOST Bundled model runtime bind address. No 127.0.0.1
--runtime-port RUNTIME_PORT Model runtime port. No 8080
--model MODEL Model identifier for the bundled runtime. No
-x COMPONENT, --exclude COMPONENT Skip a start-time component. Repeatable. Supports: migrate (database migrations), runtime (the bundled model runtime; use this to run against a configured cloud/remote provider instead), and phoenix (the bundled Phoenix tracing backend; also turns off LM request tracing unless OTEL_SDK_DISABLED is set explicitly). Choices: migrate, runtime, phoenix. No
--log-level LOG_LEVEL Set the log level for all ParseHawk services. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL. No
--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS Unload the model runtime after this many idle seconds. Use 0 to keep it loaded. No
--web-host WEB_HOST Web UI bind address. No 127.0.0.1
--web-port WEB_PORT Web UI port. No 5173
--no-web Do not start the web UI. No false

Run ParseHawk from the local source checkout.

Terminal window
$ parsehawk dev [-h] [--host HOST] [--port PORT] [--data-dir DATA_DIR] [--runtime-host RUNTIME_HOST] [--runtime-port RUNTIME_PORT] [--model MODEL] [-x COMPONENT] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS] [--reload] [--web-host WEB_HOST] [--web-port WEB_PORT] [--no-web]
Terminal window
$ parsehawk dev --reload
Argument Description Required Default
-h, --help show this help message and exit No
--host HOST API bind address. No 127.0.0.1
--port PORT API port. No 8000
--data-dir DATA_DIR Directory for the database, uploaded files, logs, and runtime state. No
--runtime-host RUNTIME_HOST Bundled model runtime bind address. No 127.0.0.1
--runtime-port RUNTIME_PORT Model runtime port. No 8080
--model MODEL Model identifier for the bundled runtime. No
-x COMPONENT, --exclude COMPONENT Skip a start-time component. Repeatable. Supports: migrate (database migrations), runtime (the bundled model runtime; use this to run against a configured cloud/remote provider instead), and phoenix (the bundled Phoenix tracing backend; also turns off LM request tracing unless OTEL_SDK_DISABLED is set explicitly). Choices: migrate, runtime, phoenix. No
--log-level LOG_LEVEL Set the log level for all ParseHawk services. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL. No
--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS Unload the model runtime after this many idle seconds. Use 0 to keep it loaded. No
--reload Reload the API when Python source changes. No false
--web-host WEB_HOST Web UI bind address. No 127.0.0.1
--web-port WEB_PORT Web UI port. No 5173
--no-web Do not start the web UI. No false

Restart ParseHawk and its bundled services.

Terminal window
$ parsehawk restart [-h] [--host HOST] [--port PORT] [--data-dir DATA_DIR] [--runtime-host RUNTIME_HOST] [--runtime-port RUNTIME_PORT] [--model MODEL] [-x COMPONENT] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS] [--web-host WEB_HOST] [--web-port WEB_PORT] [--no-web]
Terminal window
$ parsehawk restart
Argument Description Required Default
-h, --help show this help message and exit No
--host HOST API bind address. No 127.0.0.1
--port PORT API port. No 8000
--data-dir DATA_DIR Directory for the database, uploaded files, logs, and runtime state. No
--runtime-host RUNTIME_HOST Bundled model runtime bind address. No 127.0.0.1
--runtime-port RUNTIME_PORT Model runtime port. No 8080
--model MODEL Model identifier for the bundled runtime. No
-x COMPONENT, --exclude COMPONENT Skip a start-time component. Repeatable. Supports: migrate (database migrations), runtime (the bundled model runtime; use this to run against a configured cloud/remote provider instead), and phoenix (the bundled Phoenix tracing backend; also turns off LM request tracing unless OTEL_SDK_DISABLED is set explicitly). Choices: migrate, runtime, phoenix. No
--log-level LOG_LEVEL Set the log level for all ParseHawk services. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL. No
--runtime-keep-alive-seconds RUNTIME_KEEP_ALIVE_SECONDS Unload the model runtime after this many idle seconds. Use 0 to keep it loaded. No
--web-host WEB_HOST Web UI bind address. No 127.0.0.1
--web-port WEB_PORT Web UI port. No 5173
--no-web Do not start the web UI. No false

Stop managed ParseHawk services.

Terminal window
$ parsehawk stop [-h] [--data-dir DATA_DIR]
Terminal window
$ parsehawk stop
Argument Description Required Default
-h, --help show this help message and exit No
--data-dir DATA_DIR Data directory containing the managed process state. No

Show the status and URLs of managed ParseHawk services.

Terminal window
$ parsehawk status [-h] [--data-dir DATA_DIR]
Terminal window
$ parsehawk status
Argument Description Required Default
-h, --help show this help message and exit No
--data-dir DATA_DIR Data directory containing the managed process state. No

Apply pending database migrations or show their status.

Terminal window
$ parsehawk migrate [-h] [--data-dir DATA_DIR] [--json] [{status}]
Terminal window
$ parsehawk migrate status
Argument Description Required Default
-h, --help show this help message and exit No
[migrate_command] Use ‘status’ to show applied/pending migrations instead of applying them. Choices: status. No
--data-dir DATA_DIR Data directory containing the database. No
--json Print machine-readable migration status. No false

Check the local ParseHawk installation and services.

Terminal window
$ parsehawk doctor [-h] [--json] [--api-url API_URL] [--web-url WEB_URL] [--runtime-url RUNTIME_URL] [--data-dir DATA_DIR]
Terminal window
$ parsehawk doctor --json
Argument Description Required Default
-h, --help show this help message and exit No
--json Print machine-readable check results. No false
--api-url API_URL API URL to check. No
--web-url WEB_URL Web UI URL to check. No
--runtime-url RUNTIME_URL Model runtime URL to check. No
--data-dir DATA_DIR Data directory to inspect. No

Inspect or update persistent ParseHawk CLI configuration.

Terminal window
$ parsehawk config [-h] {list,set} ...
Terminal window
$ parsehawk config --help
Argument Description Required Default
-h, --help show this help message and exit No

List effective CLI configuration values.

Terminal window
$ parsehawk config list [-h] [--json]
Terminal window
$ parsehawk config list --json
Argument Description Required Default
-h, --help show this help message and exit No
--json Print configuration as JSON. No false

Persist one CLI configuration value.

Terminal window
$ parsehawk config set [-h] key value
Terminal window
$ parsehawk config set log.level DEBUG
Argument Description Required Default
-h, --help show this help message and exit No
key Configuration key to update. Yes
value String value to persist. Yes

Inspect and test the configured model runtime.

Terminal window
$ parsehawk runtime [-h] {info,test,doctor} ...
Terminal window
$ parsehawk runtime --help
Argument Description Required Default
-h, --help show this help message and exit No

Show the effective model runtime URL and model.

Terminal window
$ parsehawk runtime info [-h] [--runtime-url RUNTIME_URL] [--model MODEL] [--json]
Terminal window
$ parsehawk runtime info --json
Argument Description Required Default
-h, --help show this help message and exit No
--runtime-url RUNTIME_URL Override the configured runtime URL. No
--model MODEL Override the configured model identifier. No
--json Print runtime information as JSON. No false

Send a minimal chat completion to the model runtime.

Terminal window
$ parsehawk runtime test [-h] [--runtime-url RUNTIME_URL] [--model MODEL] [--json]
Terminal window
$ parsehawk runtime test
Argument Description Required Default
-h, --help show this help message and exit No
--runtime-url RUNTIME_URL Override the configured runtime URL. No
--model MODEL Override the configured model identifier. No
--json Print the runtime response as JSON. No false

Run model-runtime connectivity and model checks.

Terminal window
$ parsehawk runtime doctor [-h] [--runtime-url RUNTIME_URL] [--model MODEL] [--json]
Terminal window
$ parsehawk runtime doctor --json
Argument Description Required Default
-h, --help show this help message and exit No
--runtime-url RUNTIME_URL Override the configured runtime URL. No
--model MODEL Override the configured model identifier. No
--json Print machine-readable check results. No false

Run a one-shot extraction and optionally wait for its result.

Terminal window
$ parsehawk extract [-h] [--extractor EXTRACTOR] [--schema SCHEMA] [--instructions INSTRUCTIONS] [--name NAME] [--reasoning-effort {default,none,minimal,low,medium,high,xhigh}] [--file-id FILE_ID | --text TEXT | --text-file TEXT_FILE] [--wait] [--poll-seconds POLL_SECONDS] [--timeout-seconds TIMEOUT_SECONDS] [--output OUTPUT] [--api-url API_URL] [source]
Terminal window
$ parsehawk extract tests/fixtures/receipt/receipt.jpg --extractor receipt --wait
Argument Description Required Default
-h, --help show this help message and exit No
[source] Local document path, @path, file ID, or inline text. No
--extractor EXTRACTOR Extractor ID or stable name. Required unless –schema is used. No
--schema SCHEMA JSON Schema path for an ad hoc extractor. No
--instructions INSTRUCTIONS Inline instructions or a path used with an ad hoc extractor. No
--name NAME Display name for the ad hoc extractor. No
--reasoning-effort REASONING_EFFORT Reasoning effort for the ad hoc extractor; ‘default’ clears the override. Choices: default, none, minimal, low, medium, high, xhigh. No
--file-id FILE_ID Use an already uploaded file ID. No
--text TEXT Extract from this inline text. No
--text-file TEXT_FILE Extract from the contents of this text file. No
--wait Wait for completion and print the extraction result. No false
--poll-seconds POLL_SECONDS Polling interval while waiting. No 1.0
--timeout-seconds TIMEOUT_SECONDS Maximum wait time. No 600.0
--output OUTPUT Write the result JSON to this path. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Upload, inspect, list, and delete source files.

Terminal window
$ parsehawk files [-h] {list,get,upload,create,delete} ...
Terminal window
$ parsehawk files --help
Argument Description Required Default
-h, --help show this help message and exit No

List uploaded files.

Terminal window
$ parsehawk files list [-h] [--api-url API_URL]
Terminal window
$ parsehawk files list
Argument Description Required Default
-h, --help show this help message and exit No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Get file metadata by ID.

Terminal window
$ parsehawk files get [-h] [--api-url API_URL] file_id
Terminal window
$ parsehawk files get file_...
Argument Description Required Default
-h, --help show this help message and exit No
file_id File ID. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Upload a local source file.

Aliases: create

Terminal window
$ parsehawk files upload [-h] [--file FILE_PATH] [--api-url API_URL] [path]
Terminal window
$ parsehawk files upload document.pdf
Argument Description Required Default
-h, --help show this help message and exit No
[path] Local file path; an optional leading @ is ignored. No
--file FILE_PATH Local file path, equivalent to the positional path. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Delete a file and its stored content.

Terminal window
$ parsehawk files delete [-h] [--api-url API_URL] file_id
Terminal window
$ parsehawk files delete file_...
Argument Description Required Default
-h, --help show this help message and exit No
file_id File ID. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Validate extraction JSON Schema drafts.

Terminal window
$ parsehawk schemas [-h] {validate} ...
Terminal window
$ parsehawk schemas --help
Argument Description Required Default
-h, --help show this help message and exit No

Validate an extraction schema before saving it.

Terminal window
$ parsehawk schemas validate [-h] [--api-url API_URL] schema_path
Terminal window
$ parsehawk schemas validate invoice.schema.json
Argument Description Required Default
-h, --help show this help message and exit No
schema_path Path to the JSON Schema file. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Create, inspect, update, and delete reusable extractors.

Terminal window
$ parsehawk extractors [-h] {list,get,create,put,update,delete} ...
Terminal window
$ parsehawk extractors --help
Argument Description Required Default
-h, --help show this help message and exit No

List reusable extractors.

Terminal window
$ parsehawk extractors list [-h] [--api-url API_URL]
Terminal window
$ parsehawk extractors list
Argument Description Required Default
-h, --help show this help message and exit No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Get an extractor by ID or stable name.

Terminal window
$ parsehawk extractors get [-h] [--api-url API_URL] extractor_ref
Terminal window
$ parsehawk extractors get invoice_v1
Argument Description Required Default
-h, --help show this help message and exit No
extractor_ref Extractor ID or stable name. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Create a reusable extractor.

Terminal window
$ parsehawk extractors create [-h] [--name NAME] [--display-name DISPLAY_NAME] --instructions INSTRUCTIONS --schema SCHEMA [--examples EXAMPLES] [--reasoning-effort {default,none,minimal,low,medium,high,xhigh}] [--provider {openai,microsoft_foundry,openai_compatible_api}] [--model MODEL] [--api-url API_URL]
Terminal window
$ parsehawk extractors create --name invoice_v1 --display-name "Invoice extractor" --instructions instructions.txt --schema invoice.schema.json
Argument Description Required Default
-h, --help show this help message and exit No
--name NAME Optional stable extractor name. No
--display-name DISPLAY_NAME Human-readable extractor name. No
--instructions INSTRUCTIONS Inline instructions or a text-file path. Yes
--schema SCHEMA Path to the extraction JSON Schema. Yes
--examples EXAMPLES Path to a JSON array of input/output examples. No
--reasoning-effort REASONING_EFFORT Reasoning effort override; ‘default’ clears the override. Choices: default, none, minimal, low, medium, high, xhigh. No
--provider PROVIDER_NAME Provider override for this extractor. Choices: openai, microsoft_foundry, openai_compatible_api. No
--model MODEL Provider model override. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Create or fully replace an extractor by reference.

Terminal window
$ parsehawk extractors put [-h] [--name NAME] --display-name DISPLAY_NAME --instructions INSTRUCTIONS --schema SCHEMA [--examples EXAMPLES] [--reasoning-effort {default,none,minimal,low,medium,high,xhigh}] [--provider {openai,microsoft_foundry,openai_compatible_api}] [--model MODEL] [--api-url API_URL] extractor_ref
Terminal window
$ parsehawk extractors put invoice_v1 --display-name "Invoice extractor" --instructions instructions.txt --schema invoice.schema.json
Argument Description Required Default
-h, --help show this help message and exit No
extractor_ref Extractor ID or stable name. Yes
--name NAME Stable extractor name. No
--display-name DISPLAY_NAME Human-readable extractor name. Yes
--instructions INSTRUCTIONS Inline instructions or a text-file path. Yes
--schema SCHEMA Path to the extraction JSON Schema. Yes
--examples EXAMPLES Path to a JSON array of input/output examples. No
--reasoning-effort REASONING_EFFORT Reasoning effort override; ‘default’ clears the override. Choices: default, none, minimal, low, medium, high, xhigh. No
--provider PROVIDER_NAME Provider override for this extractor. Choices: openai, microsoft_foundry, openai_compatible_api. No
--model MODEL Provider model override. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Update selected fields on an extractor.

Terminal window
$ parsehawk extractors update [-h] [--display-name DISPLAY_NAME] [--instructions INSTRUCTIONS] [--schema SCHEMA] [--examples EXAMPLES] [--provider {openai,microsoft_foundry,openai_compatible_api}] [--model MODEL] [--reasoning-effort {default,none,minimal,low,medium,high,xhigh}] [--api-url API_URL] extractor_ref
Terminal window
$ parsehawk extractors update invoice_v1 --display-name "Invoices"
Argument Description Required Default
-h, --help show this help message and exit No
extractor_ref Extractor ID or stable name. Yes
--display-name DISPLAY_NAME Human-readable extractor name. No
--instructions INSTRUCTIONS Inline instructions or a text-file path. No
--schema SCHEMA Path to the extraction JSON Schema. No
--examples EXAMPLES Path to a JSON array of input/output examples. No
--provider PROVIDER_NAME Provider override for this extractor. Choices: openai, microsoft_foundry, openai_compatible_api. No
--model MODEL Provider model override. No
--reasoning-effort REASONING_EFFORT Reasoning effort override; ‘default’ clears the override. Choices: default, none, minimal, low, medium, high, xhigh. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Delete an extractor by ID or stable name.

Terminal window
$ parsehawk extractors delete [-h] [--api-url API_URL] extractor_ref
Terminal window
$ parsehawk extractors delete invoice_v1
Argument Description Required Default
-h, --help show this help message and exit No
extractor_ref Extractor ID or stable name. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Inspect and configure model providers.

Terminal window
$ parsehawk providers [-h] {list,get,configure,models} ...
Terminal window
$ parsehawk providers --help
Argument Description Required Default
-h, --help show this help message and exit No

List configured model providers.

Terminal window
$ parsehawk providers list [-h] [--api-url API_URL]
Terminal window
$ parsehawk providers list
Argument Description Required Default
-h, --help show this help message and exit No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Get one provider configuration.

Terminal window
$ parsehawk providers get [-h] [--api-url API_URL] {openai,microsoft_foundry,openai_compatible_api}
Terminal window
$ parsehawk providers get openai_compatible_api
Argument Description Required Default
-h, --help show this help message and exit No
name Provider name. Choices: openai, microsoft_foundry, openai_compatible_api. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Set a provider base URL, provider configuration, or API key.

Terminal window
$ parsehawk providers configure [-h] [--base-url BASE_URL] [--project-url PROJECT_URL] [--api-key API_KEY] [--api-key-env API_KEY_ENV] [--api-url API_URL] {openai,microsoft_foundry,openai_compatible_api}
Terminal window
$ parsehawk providers configure openai --api-key-env OPENAI_API_KEY
Argument Description Required Default
-h, --help show this help message and exit No
name Provider name. Choices: openai, microsoft_foundry, openai_compatible_api. Yes
--base-url BASE_URL Provider API base URL; use an empty value to clear it. No
--project-url PROJECT_URL Microsoft Foundry project URL for deployment discovery. No
--api-key API_KEY API key to encrypt and store; use an empty value to clear it. No
--api-key-env API_KEY_ENV Read the API key from this environment variable and store it. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

List models currently offered by a provider.

Terminal window
$ parsehawk providers models [-h] [--api-url API_URL] {openai,microsoft_foundry,openai_compatible_api}
Terminal window
$ parsehawk providers models openai_compatible_api
Argument Description Required Default
-h, --help show this help message and exit No
name Provider name. Choices: openai, microsoft_foundry, openai_compatible_api. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Create, inspect, list, and delete extraction jobs.

Terminal window
$ parsehawk jobs [-h] {create,list,get,delete} ...
Terminal window
$ parsehawk jobs --help
Argument Description Required Default
-h, --help show this help message and exit No

Create an asynchronous extraction job.

Terminal window
$ parsehawk jobs create [-h] [--extractor EXTRACTOR_ID_OPTION] (--file-id FILE_ID | --text TEXT | --text-file TEXT_FILE) [--api-url API_URL] [extractor_id]
Terminal window
$ parsehawk jobs create invoice_v1 --text "Invoice A-204 · Total EUR 128.40"
Argument Description Required Default
-h, --help show this help message and exit No
[extractor_id] Extractor ID or stable name. No
--extractor EXTRACTOR_ID_OPTION Extractor ID or stable name. No
--file-id FILE_ID, --file FILE_ID Previously uploaded file ID. One of group
--text TEXT Inline source text. One of group
--text-file TEXT_FILE Path to a source text file. One of group
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

List extraction jobs.

Terminal window
$ parsehawk jobs list [-h] [--extractor-id EXTRACTOR_ID] [--api-url API_URL]
Terminal window
$ parsehawk jobs list --extractor invoice_v1
Argument Description Required Default
-h, --help show this help message and exit No
--extractor-id EXTRACTOR_ID, --extractor EXTRACTOR_ID Filter by extractor ID or stable name. No
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Get an extraction job by ID.

Terminal window
$ parsehawk jobs get [-h] [--api-url API_URL] job_id
Terminal window
$ parsehawk jobs get job_...
Argument Description Required Default
-h, --help show this help message and exit No
job_id Job ID. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000

Cancel a pending job or delete a finished job.

Terminal window
$ parsehawk jobs delete [-h] [--api-url API_URL] job_id
Terminal window
$ parsehawk jobs delete job_...
Argument Description Required Default
-h, --help show this help message and exit No
job_id Job ID. Yes
--api-url API_URL ParseHawk API URL; defaults to PARSEHAWK_API_URL when set. No http://127.0.0.1:8000