CLI Reference

View as Markdown

This reference covers the nemo anonymizer commands exposed by the Anonymizer plugin. For end-to-end walkthroughs, see the tutorials.

Command Surface

CommandSourceDescription
nemo anonymizer validateManual Typer commandValidate an AnonymizerConfig (and optional model_configs).
nemo anonymizer preview runGenerated from NemoFunctionLocal streaming preview.
nemo anonymizer preview submitGenerated from NemoFunctionRemote streaming preview against the plugin service.
nemo anonymizer run runGenerated from NemoJobLocal job execution in the CLI process.
nemo anonymizer run submitGenerated from NemoJobSubmit an anonymizer.run job to the NeMo Platform Jobs worker.
nemo anonymizer run explainGenerated from NemoJobPrint the job key, submit endpoint, and JSON schemas.

nemo anonymizer validate

Validate an AnonymizerConfig YAML file against the model selection. Useful for catching Substitute-without-replacement_generator and similar misconfigurations before submitting a request.

$nemo anonymizer validate \
> --config /tmp/anonymizer-config.yaml \
> [--model-configs /tmp/anonymizer-model-configs.yaml]
FlagRequiredDescription
--configyesPath to the AnonymizerConfig YAML.
--model-configsnoOptional path to a model-configs YAML to validate alongside the config (same shape the library expects).

The command does not accept data.source. Input-source validation happens during preview or run.

nemo anonymizer preview

Both preview run and preview submit take a spec file matching PreviewRequest.

$nemo anonymizer preview run \
> --spec-file /tmp/anonymizer-preview.yaml \
> --workspace "${NMP_WORKSPACE:-default}"
$
$nemo anonymizer preview submit \
> --spec-file /tmp/anonymizer-preview.yaml \
> --workspace "${NMP_WORKSPACE:-default}" \
> --base-url "${NMP_BASE_URL:-http://localhost:8080}"
FlagDescription
--spec-filePath to the PreviewRequest YAML.
--workspaceNeMo Platform workspace. Used to resolve fileset references and Inference Gateway providers.
--base-urlOverride the platform base URL (typically auto-populated from the CLI config).

Preview source kinds

Formpreview runpreview submit
Local path (/tmp/input.csv)yesno
HTTP(S) URL (https://.../input.csv)yesyes
Fileset reference (fs#path)yesyes

Preview output

preview streams newline-delimited JSON frames to stdout. Filter with jq:

$nemo anonymizer preview run --spec-file /tmp/anonymizer-preview.yaml > /tmp/preview.ndjson
$
$jq -R 'fromjson? | select(.kind == "preview_dataset") | .records' /tmp/preview.ndjson

Frame kinds: log, preview_dataset, trace_dataset, failed_records, heartbeat, done, error. See the preview tutorial for details.

nemo anonymizer run

$nemo anonymizer run run --spec-file /tmp/anonymizer-run.yaml
$
$nemo anonymizer run submit \
> --spec-file /tmp/anonymizer-run.yaml \
> --workspace "${NMP_WORKSPACE:-default}" \
> --base-url "${NMP_BASE_URL:-http://localhost:8080}"
$
$nemo anonymizer run explain
FlagDescription
--spec-filePath to the AnonymizerRequest YAML.
--workspaceWorkspace used for fileset resolution, Inference Gateway providers, and job placement.

Run source kinds

Formrun runrun submit
Local path (/tmp/input.csv)yesno
HTTP(S) URL (https://.../input.csv)yesyes
Fileset reference (fs#path)yesyes

Run output

run run prints {"exit_code": 0} on success. The local job results manager logs the artifact directory to stderr:

Saved result 'artifacts' to file:///.../persistent/results/artifacts

The artifact directory contains:

FileDescription
dataset.parquetAnonymized output.
trace.parquetDetection trace.
metadata.jsonRun metadata (includes original text column).
failed_records.jsonPer-record failures. Only written when records failed.

run submit submits an anonymizer.run job to the Jobs service and prints the assigned job name and submit endpoint:

|-- job name: anonymizer-run-2026-05-12-abc123
|-- submit endpoint: /apis/anonymizer/v2/workspaces/default/jobs/run
{"name": "anonymizer-run-2026-05-12-abc123", ...}

Track and pull artifacts using either the standard nemo jobs ... commands or the Python SDK:

$nemo jobs get-status anonymizer-run-2026-05-12-abc123 --workspace "${NMP_WORKSPACE:-default}"
$nemo jobs get-logs anonymizer-run-2026-05-12-abc123 --workspace "${NMP_WORKSPACE:-default}"
1job = sdk.anonymizer.get_job_resource("anonymizer-run-2026-05-12-abc123")
2job.wait_until_done()
3results = job.download_artifacts()
4dataset = results.load_dataset()

See SDK Resources for the full AnonymizerJobResource / AnonymizerJobResults surface.

Compared to run run, run submit rejects local file paths in data.source (use a fileset reference or http(s) URL) and requires explicit model_configs because the job runs outside the CLI process.

Spec File Reference

Both preview and run specs use the shared AnonymizerRequest shape:

FieldTypeRequiredNotes
configAnonymizerConfigyesLibrary config. See the library docs.
data.sourcestringyesLocal path, http(s) URL, or fileset reference.
data.text_columnstringnoDefaults to text.
data.id_columnstringnoOptional record identifier column.
data.data_summarystringnoOptional short description of the data.
model_configslist of Data Designer ModelConfigdependsRequired for preview submit and run submit; optional for preview run and run run.
selected_modelsobject with detection / replace / rewritenoRole overrides on top of bundled defaults. Requires model_configs.

Preview-only:

FieldTypeRequiredNotes
num_recordsint ≥ 1noDefaults to 10. Capped by the service’s preview_num_records.max.

Fileset Reference Forms

The data.source field accepts three fileset forms; the workspace and fileset must already exist:

fileset://<workspace>/<fileset>#<path>
<workspace>/<fileset>#<path>
<fileset>#<path>

The #<path> fragment must resolve to a single .csv or .parquet file. The plugin downloads the file before constructing the Anonymizer library input.