This guide walks through the steps required to surface new Domainator tools in the server UI. It covers generating schemas from existing CLIs, crafting schemas manually, and developing tool entry points that work with the server's executors.
Most Domainator CLIs already expose a main(argv) entry point that the server can introspect. The scripts/generate_tool_schemas.py helper captures each CLI's argument parser and emits a JSON schema compatible with the web app.
- A Python environment with Domainator (and its optional extras) installed.
- Access to the project
pyproject.tomlthat declares the CLI entry points under[project.scripts].
Run the generator from the repository root:
python scripts/server/generate_tool_schemas.py --pyproject pyproject.toml --output-dir src/domainator/server/schemas/generated/
Key options:
--pyproject: path to the Domainatorpyproject.tomlcontaining the CLI script definitions.--output-dir: destination folder that will receive one<tool-id>.jsonschema per CLI.--include: optional whitelist of script names (matching[project.scripts]keys) when you only need a subset.
Generated schemas can be committed directly or used as a starting point for manual edits.
Schemas live under src/domainator/server/schemas/ and have the following shape:
{
"id": "tool-id",
"display_name": "Tool Display Name",
"category": "Domainator",
"description": "One or more lines describing the tool.",
"runner": "module",
"entry_point": "domainator.some_cli",
"parameters": [ ... ],
"advanced_parameters": [ ... ]
}
parameters: primary inputs shown immediately in the UI.advanced_parameters: optional or niche inputs. These render inside a collapsed "Advanced Parameters" panel.
Each parameter entry supports:
name: human-friendly label.parameter: the key passed to the CLI when the job runs (defaults tonameif omitted).type:string,integer,number,float,boolean,file, oroutput. Usenumberfor non-integer values;floatis accepted as a synonym for backward compatibility.help: short tip displayed inline in the form.required: mark required inputs.multiple: accept a list of values (UI renders a multi-select or collects repeated values).choices: restrict to specific values.default: pre-populated default.min/max: numeric bounds applied tonumber,float, andintegerparameters. Values outside the range trigger client-side validation and are rejected before submission.step: increment for numeric inputs. Use whole numbers for integers, decimals such as0.01for fractional steps, or the stringanywhen arbitrary precision (e.g., 0.85) should be accepted.flags: optional list of CLI flags (for reference only).file_types: optional list of MIME-like extensions that filter the file picker whentypeisfile.
Scientific notation (for example, 1e-10) is accepted by number/float controls and is converted transparently to a Python float before execution.
- Keep descriptions concise—the first line is used in the tool list; subsequent lines appear in the detail pane with preserved formatting.
- When introducing advanced options, prefer copying the generator's output and moving the relevant entries into
advanced_parameters. - Verify the JSON with
python -m json.tool path/to/schema.jsonbefore committing.
The runner field determines how the server launches the tool. Supported values are:
| Runner | Behavior | Entry Point Expectations |
|---|---|---|
module |
Invokes python -m <entry_point> --config=<args.json> |
<entry_point> must be an importable module that processes a --config file. All Domainator CLIs expose _entrypoint/main helpers that accept this flag via jsonargparse. |
python |
Executes python <entry_point> --config=<args.json> |
Use when the CLI is a Python script rather than a module. Ensure it accepts the --config argument. |
shell |
Runs /bin/sh -c "<entry_point> --config=<args.json>" |
Provide a shell command string. Useful for wrappers around non-Python binaries. |
binary (default) |
Launches <entry_point> --config=<args.json> directly |
For standalone executables already on PATH. |
-
Accept configuration via JSON:
- The server writes the collected parameters to a JSON file and passes
--config=/path/to/filewhen launching the tool. - Domainator CLIs typically use
jsonargparseordomainator.utils.configure_clito load this config automatically.
- The server writes the collected parameters to a JSON file and passes
-
Emit outputs into the working directory:
- The executor creates a per-job workspace (
$DATA_DIR/outputs/<job-id>). Write derived files there. - Any produced files are offered to the user. For convenience, call the shared file manager APIs when you want artifacts to appear in the "Stored Files" list immediately.
- The executor creates a per-job workspace (
-
Log to stdout/stderr:
- All console output is captured in
<job-id>.log. Avoid using interactive prompts.
- All console output is captured in
-
Exit codes matter:
- Return
0on success. Non-zero codes mark the job as failed and surface the log to the user.
- Return
- Create or update the schema.
- Restart the development server or call the tool registry refresh endpoint if available.
- Visit the web UI, locate the tool (verify alphabetical sorting), and inspect the parameters.
- Run a test job. Confirm:
- Required and advanced parameters behave correctly.
- Outputs appear in the job results and optional file manager.
- Logs contain helpful information on failure.
- Schema not appearing: Ensure the
.jsonfile resides under one of the schema directories configured inServerConfig.schema_dirs. - Missing parameter UI control: Confirm
typematches one of the supported values and thatparameter/nameare present. - Job fails instantly: Check the job log in the UI. Validate the runner/entry point combination and confirm the CLI handles
--config. - Output file not listed: Verify the tool wrote files to the job workspace and that they are not temporary JSON configs.
With these steps, you can confidently add and maintain tools accessible through the Domainator Server interface.