chore: refactor root command adapters - #4687
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Root registration now changes the user-visible help ordering, contrary to the refactor’s compatibility requirement.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Refactors root CLI commands into dedicated adapters aligned with design/cli.md.
Changes:
- Moves
init,check, andversionintocommand_*.pymodules. - Removes the transitional
commandspackage. - Migrates tests and preserves compatibility exports and monkeypatch paths.
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Registers and re-exports root adapters. |
src/specify_cli/command_init.py |
Hosts the init adapter. |
src/specify_cli/command_check.py |
Hosts the check adapter. |
src/specify_cli/command_version.py |
Hosts the version adapter. |
src/specify_cli/commands/__init__.py |
Removes the obsolete package. |
src/specify_cli/integrations/_commands.py |
Updates an internal reference comment. |
tests/specify_cli/test_command_init.py |
Migrates and expands init tests. |
tests/specify_cli/test_command_check.py |
Moves check command tests. |
tests/specify_cli/test_command_version.py |
Retains version-command coverage. |
tests/specify_cli/test_root_version_callback.py |
Separates root version-option tests. |
tests/specify_cli/test_check_tool.py |
Leaves domain-level tool checks. |
tests/specify_cli/test_agent_config.py |
Removes obsolete package tests. |
tests/test_presets.py |
Updates init helper imports. |
tests/test_live_transient_windows.py |
Removes relocated init source test. |
tests/integrations/test_cli.py |
Updates init patch/import paths. |
tests/integrations/test_integration_alquimia.py |
Updates init patch paths. |
tests/integrations/test_integration_claude.py |
Updates init patch paths. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol, autonomous); comment fully AI-drafted. Addressed the review finding in commit Restored the original root registration and help order to Validation: 27 focused root-command tests passed; |

Description
Refactor the remaining top-level Specify CLI command adapters so the root command surface follows
design/cli.md.specify init,specify check, andspecify versionintocommand_init.py,command_check.py, andcommand_version.py.specify_cli.__init__responsible for the root Typer app, callback--versionoption, explicit command/group registration, root re-exports, and shared root behavior.specify_cli.commandspackage; there is nospecify commands ...namespace.specify_cli.check_tooland rootcheck/versionexports.tests/specify_cli/while keeping callback and domain tests separate.specify versionand its coverage.The pytest collection count is preserved relative to the rebased upstream tree, and the wheel contains all three new command modules with no obsolete
specify_cli/commands/entries.Testing
uv run specify --help.venv/bin/python -m pytest— 8,428 passed, 17 skipped; 8,445 collecteduvx ruff@0.15.0 check src testsgit diff --checkAI Disclosure
AI disclosure: GitHub Copilot (model: GPT-5.6 Sol, autonomous mode; reasoning effort managed by the runtime default) authored the code refactor, test migration, rebase/conflict resolution, validation commands, and this PR description on behalf of @mnriem. The contribution is fully AI-drafted.