CLI Application
Python CLI for source extraction, detector execution, and batched output delivery.
Setup
cd /unstructured/apps/cli
uv sync
# Optional if you want an activated shell instead of `uv run ...`:
source .venv/bin/activate
Optional detector groups:
uv sync --group detectors
# or specific groups: --group secrets --group pii --group threat ...
Command Syntax
Use the thin wrapper:
uv run main.py <command> <recipe.json> [options]
Or direct module entrypoint:
uv run python -m src.main <command> <recipe.json> [options]
Commands:
test- test source connection.discover- discover source resources.extract- run extraction and emit batched output.sandbox- run sandbox parsing/detectors for a local file.
Extract Output Model
Extraction always emits in batches.
Recipes do not contain output configuration; output is controlled by CLI flags and environment variables.
Output types:
console- emits NDJSON envelopes to stdout.file- appends NDJSON envelopes to a file.rest- pushes batches to API endpoints and finalizes run.
Default behavior:
- If
source_idis present (--source-idorSOURCE_IDenv), default output isrest. - Otherwise default output is
console. - Default batch size is
20.
CLI Options
Global/common:
--debug- enable debug logging.--detectors-file <path>- sandbox only.
Extract output options:
--output-type rest|file|console--output-batch-size <int>--output-rest-url <url>--output-file-path <path>--source-id <uuid>--runner-id <uuid>--managed-runner(REST only; runner lifecycle managed by API orchestrator)
Environment fallbacks:
SOURCE_ID,RUNNER_IDCLASSIFYRE_OUTPUT_TYPE,CLASSIFYRE_OUTPUT_BATCH_SIZECLASSIFYRE_OUTPUT_REST_URL,CLASSIFYRE_OUTPUT_REST_TIMEOUT_SECCLASSIFYRE_OUTPUT_FILE_PATHAPI_URL(fallback base URL for REST output)
Practical Examples
1) Console output (quick local test)
uv run main.py extract ./wordpress-recipe.json --output-type console --output-batch-size 1
You will see NDJSON lines like:
{"event":"batch", ...}{"event":"finish", ...}
2) File output
uv run main.py extract ./wordpress-recipe.json \
--output-type file \
--output-file-path /tmp/classifyre-assets.ndjson \
--output-batch-size 20
3) REST output (manual CLI to backend)
uv run main.py extract ./wordpress-recipe.json \
--output-type rest \
--source-id <source_uuid>
Notes:
--runner-idoptional for manual runs. If omitted, CLI creates external runner automatically.--output-rest-urlis optional. If omitted, CLI usesCLASSIFYRE_OUTPUT_REST_URL, thenAPI_URL, thenhttp://localhost:8000.--managed-runnershould be used only for API-orchestrated runs where runner already exists.
4) REST output with explicit runner (managed/orchestrated style)
uv run main.py extract ./wordpress-recipe.json \
--output-type rest \
--source-id <source_uuid> \
--runner-id <runner_uuid> \
--managed-runner
5) Full extract command with all output flags
uv run main.py extract ./wordpress-recipe.json \
--output-type rest \
--output-batch-size 20 \
--output-rest-url http://localhost:8000 \
--output-file-path /tmp/classifyre-assets.ndjson \
--source-id <source_uuid> \
--runner-id <runner_uuid> \
--managed-runner
Use --output-file-path only when --output-type file.
Dev Scripts
bun run dev- run CLI quickly.bun run lint- ruff format/check.bun run check-types- mypy.bun run test- pytest suite.
Release files for classifyre-cli 0.4.53
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| classifyre_cli-0.4.53.tar.gz | 786.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| classifyre_cli-0.4.53-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / classifyre_cli-0.4.53.tar.gz
| Download URL | classifyre_cli-0.4.53.tar.gz |
|---|---|
| Size | 786.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5becaf29ac129509041363bdcbb35d8f1b1ef7ce997b592c4f68a4fc0b41ce5e
|
|
BLAKE2b-256 checksum How to use checksums |
a348a7d5ca13b845d5b787f3e37283b276df3f6489a921e30b76294f7a5c1cc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / classifyre_cli-0.4.53-py3-none-any.whl
| Download URL | classifyre_cli-0.4.53-py3-none-any.whl |
|---|---|
| Size | 363.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57e521beb42679ea651f796876613e43d1e5bcdc504101bc9a278718465cf89b
|
|
BLAKE2b-256 checksum How to use checksums |
86dc19b61157211b639a0be74964b79e7acfa783c4ada39b87beaf454d572ec8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|