feat: add Cyclopts-based CLI with run/preview/validate subcommands#63
Merged
Conversation
Contributor
|
All contributors have signed the DCO ✍️ ✅ |
35f060f to
57e6482
Compare
Collaborator
Author
|
I have read the DCO document and I hereby sign the DCO. |
Collaborator
Author
|
recheck |
mckornfield
approved these changes
Mar 23, 2026
Contributor
|
I have read the DCO document and I hereby sign the DCO. |
8df45a4 to
a223f66
Compare
lipikaramaswamy
approved these changes
Mar 27, 2026
Collaborator
lipikaramaswamy
left a comment
There was a problem hiding this comment.
lgtm, just small note about error handler
Adds a CLI entry point (`anonymizer`) using tyro's SubcommandApp: - run: full anonymization pipeline (detection + replacement) - preview: run on a subset of records for quick inspection - validate: check config compatibility with model selections Includes GlobalOpts (--verbose, --debug, model/artifact overrides), output helpers (format_summary, write_result), and comprehensive test coverage (parse, errors, help, output). Updates README.md and CONTRIBUTING.md with CLI usage and developer guidance. Signed-off-by: aagonzales <aagonzales@nvidia.com> Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
a223f66 to
a5dc1dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
anonymizer) using tyro'sSubcommandAppwith three subcommands:run(full pipeline),preview(sample subset), andvalidate(config check)GlobalOptsfor--verbose,--debug, model config, and artifact path overridesAlso included (not CLI-related)
kindliteral field fromRedact,Hash,Annotate, andSubstitutestrategy models and replaces the string-basedDiscriminatorwith a callable_resolve_replace_tagthat resolves the tag from the class name (for instances) or akind/typekey (for dicts). No existing workflows are affected; this was bundled here as a low-risk cleanup.Changes
src/anonymizer/interface/cli/main.py,_output.py,__init__.pysrc/anonymizer/__main__.py(python -m anonymizersupport)pyproject.toml(tyro>=0.9dep +[project.scripts]entry point)tests/interface/cli/test_cli_parse.py,test_cli_errors.py,test_cli_help.py,test_cli_output.pyREADME.md,CONTRIBUTING.mdTest plan
make testpasses (363 tests, including 19 new CLI tests)anonymizer --help,anonymizer run --help,anonymizer preview --help,anonymizer validate --helpall exit 0--outputwrites CSV/Parquet correctly viawrite_resultMade with Cursor