Skip to main content

galaxy-tool-refactor-cli

The app tier of the Galaxy tool refactoring framework — the user-facing galaxy-tool-refactor CLI, a thin front-end over the tier-3.6 rule-registry facade (galaxy-tool-refactor-registry).

Tier Layer Package
0.5 rule metadata galaxy-tool-refactor-rules
1 parsing & validation galaxy-tool-source
2 structure galaxy-tool-codemod
3 formatting galaxy-tool-fmt
3.5 advisory checks galaxy-tool-lint
3.6 rule registry / rulesets galaxy-tool-refactor-registry
4 app / CLI galaxy-tool-refactor-cli (this package)

Rule orchestration lives in the registry facade; this package depends on it (plus fmt's cli_support engine and tier-1 parsing) and exposes twelve commands (format, upgrade, check, find-references, rename-param, rulesets, rules, normalize-macros, convert-help, tokenize-version, bump-version-suffix, lint-skip):

# Safe, idempotent: apply a ruleset's fixable rules + cosmetic formatting.
# Default ruleset = structural canonicalisation + cosmetic; never profile=.
galaxy-tool-refactor format tool.xml
galaxy-tool-refactor format --ruleset cosmetic tool.xml  # whitespace only
galaxy-tool-refactor format --ignore GTR002 tool.xml     # all but param-reorder
galaxy-tool-refactor format tools/                       # also formats <macros> files

# Opt-in, semantic: repair typos, then place profile=, then format.
# Minimal-bump by default: profile= moves only when strictly needed for
# validity (kept when the repaired tool validates at its baseline, undeclared
# stays undeclared, else the minimum valid profile at or above the baseline).
# --modernize opts into the behavior-preserving walk: upgrade profile= as far
# as behaviour provably stays the same, stopping at the behaviour ceiling
# (report naming the blocking code(s), pointing at docs/profile_boundaries.md)
# and never past the deployment ceiling (the newest profile every major
# public Galaxy server runs). Only an explicit --target-profile exceeds the
# deployment ceiling. No --ruleset; --select/--ignore tune it.
galaxy-tool-refactor upgrade tool.xml
galaxy-tool-refactor upgrade --modernize tool.xml              # gated walk to the ceilings
galaxy-tool-refactor upgrade --modernize --allow-behavior-change tool.xml  # lift the behaviour gate
galaxy-tool-refactor upgrade --target-profile 23.0 tool.xml    # explicit cap (implies the walk)

# Report-only linter: one `file:line  CODE  message` per finding, mutating
# nothing. The default ruleset reports the fixable GTR rules; `--ruleset strict` adds
# the advisory checks (marked `(advisory)`). Exits non-zero on any fixable
# finding; advisory findings are informational unless --strict.
galaxy-tool-refactor check tool.xml
galaxy-tool-refactor check --ruleset strict tool.xml

# Introspection.
galaxy-tool-refactor rulesets
galaxy-tool-refactor rules

# Opt-in, repo-scoped: lowercase literal format/ftype in <macros>-root files (the
# macro-library fix the per-tool `upgrade` can't reach). Rewrites files other than
# the one named, so it is a separate command — never part of format/upgrade.
galaxy-tool-refactor normalize-macros macros/            # --check to preview

# Opt-in convenience: prune planemo .lint_skip suppressions we can prove are
# resolved (apply the fixes, remove a line only when its linter is completely
# covered and clean on every tool in the dir). Leaves what it can't prove
# untouched and unmentioned. See docs/lint_skip.md.
galaxy-tool-refactor lint-skip tools/                    # --check to preview

format/upgrade/check share rule selection — --ruleset NAME (repeatable / comma-separated — the union of the named sets), --select CODE…, --ignore CODE… (ruff-style precedence: --ignore ▸ --select ▸ --ruleset; --select replaces the rulesets' set; upgrade takes no --ruleset). format/upgrade also honour --check (detect drift, exit non-zero, don't write — distinct from the check command), --diff, and --quiet; check honours --quiet and --strict. The typical modernization flow is upgrade then format.

Why a separate tier

Profile upgrade is semantic, fallible, and reports outcomes; canonicalisation + formatting is safe and idempotent. Keeping them in separate, explicit commands (rather than auto-upgrading inside "format my tool") lets users opt into modernization deliberately. Rule orchestration sits below the CLI in the registry facade — both because output is written via fmt's serializer (so the orchestrator must sit above fmt) and so the MCP server reuses the same core. See docs/decisions.md §D1 (the app tier), §D2 (check), §D3 (advisory findings), §D4 (the registry facade + rule selection).

Install / test

End-user install (the metapackage is the front door; it pulls this CLI):

pip install galaxy-tool-refactor          # provides the `galaxy-tool-refactor` command
pip install galaxy-tool-refactor-cli      # or this package directly

For development, from the workspace root:

uv sync
uv run --package galaxy-tool-refactor-cli pytest galaxy-tool-refactor-cli/tests/

Metadata

Release files for galaxy-tool-refactor-cli 0.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for galaxy-tool-refactor-cli 0.3.8
File Size Uploaded Provenance Actions
galaxy_tool_refactor_cli-0.3.8.tar.gz 52.9 kB With provenance Details for galaxy_tool_refactor_cli-0.3.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for galaxy-tool-refactor-cli 0.3.8
File Interpreter ABI Platform Actions
galaxy_tool_refactor_cli-0.3.8-py3-none-any.whl Python 3 none any Details for galaxy_tool_refactor_cli-0.3.8-py3-none-any.whl

Total release size: 90.0 kB

Release files / galaxy_tool_refactor_cli-0.3.8.tar.gz

Download URL galaxy_tool_refactor_cli-0.3.8.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a8c5c73a10d79caf564e40d9a4e149402b25d52a50745a674146612b00d5c941
BLAKE2b-256 checksum
How to use checksums
84f4429c8c2329e7dfa86a34bdc5c0905600c9d78b6e104730314ae34570e5a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / galaxy_tool_refactor_cli-0.3.8-py3-none-any.whl

Download URL galaxy_tool_refactor_cli-0.3.8-py3-none-any.whl
Size 37.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07c0616475f5e409198cd40bf1b865f6f2e8cfc72427aa1a674e7e1cde88c1e2
BLAKE2b-256 checksum
How to use checksums
2f2211ee20599a485aad967b2458dcb7c686e2eedafed5804b1fa477825176e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Security for galaxy-tool-refactor-cli 0.3.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for galaxy_tool_refactor_cli-0.3.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page