Skip to content

Commit bc80e29

Browse files
refactor(cli): create cli package structure
Establish hatch/cli/ directory with package initialization as the foundation for handler-based CLI architecture refactoring. Deliverables: - hatch/cli/__init__.py: Package init with main() export - hatch/cli/__main__.py: Module entry point for python -m hatch.cli Both files delegate to cli_hatch.main() for backward compatibility. Full entry point migration planned for Task M1.7.
1 parent 222b357 commit bc80e29

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

hatch/cli/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""CLI package for Hatch package manager.
2+
3+
This package provides the command-line interface for Hatch, organized into
4+
domain-specific handler modules:
5+
6+
- cli_utils: Shared utilities, exit codes, and helper functions
7+
- cli_mcp: MCP host configuration handlers
8+
- cli_env: Environment management handlers
9+
- cli_package: Package management handlers
10+
- cli_system: System commands (create, validate)
11+
12+
The main entry point is the `main()` function which sets up argument parsing
13+
and routes commands to appropriate handlers.
14+
"""
15+
16+
# Import main entry point from cli_hatch for now (will be moved in M1.7)
17+
from hatch.cli_hatch import main
18+
19+
__all__ = [
20+
'main',
21+
]

hatch/cli/__main__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Entry point for running hatch.cli as a module.
2+
3+
This allows running the CLI via: python -m hatch.cli
4+
5+
Currently delegates to cli_hatch.main() for backward compatibility.
6+
Will be refactored in M1.7 to contain the full entry point logic.
7+
"""
8+
9+
import sys
10+
11+
from hatch.cli_hatch import main
12+
13+
if __name__ == "__main__":
14+
sys.exit(main())

0 commit comments

Comments
 (0)