Skip to content

Major CLI refactoring: Typer migration, command chaining, and testing - #2

Merged
eriktelepovsky merged 22 commits into
masterfrom
dev
Jan 8, 2026
Merged

Major CLI refactoring: Typer migration, command chaining, and testing#2
eriktelepovsky merged 22 commits into
masterfrom
dev

Conversation

@eriktelepovsky

Copy link
Copy Markdown
Contributor

Summary

Major refactoring of Mantis CLI with migration to Typer framework, improved command chaining, and comprehensive testing infrastructure.

CLI Framework Migration

  • Migrated from argparse to Typer for better CLI experience
  • Rich help panels with organized command groups
  • Command shortcuts (e.g., b for build, d for deploy)
  • Auto-completion support

Command Chaining with + Separator

  • New syntax for chaining commands: mantis -e prod build + push + deploy
  • Commands with arguments work correctly: mantis -e prod build web api + push + deploy
  • Clean separation between commands using + separator

Project Structure

  • Split commands into submodules (commands/core.py, commands/images.py, etc.)
  • Custom @command decorator with shortcut and panel support
  • Pydantic-based config validation (schema.py, config.py)
  • Replaced os.path with pathlib throughout

New Features

  • rolling-update command for one-by-one container updates
  • rename command for container renaming
  • Deployment rollback if zero-downtime container is not healthy
  • Auto-select config file
  • Environment shortcut resolution
  • Parallel build support
  • Dry-run mode (-n / --dry-run)

Testing & CI

  • Added pytest test suite for command-line parsing
  • GitHub Actions workflow for automated testing (Python 3.9-3.12)

Documentation

  • Updated README with new -e flag syntax
  • Updated examples to use + separator for chaining

Test plan

  • All 27 unit tests passing
  • Manual testing of command chaining: mantis -e <env> build + push + deploy
  • Manual testing of single commands: mantis -e <env> status
  • Manual testing of help: mantis --help, mantis build --help
  • Verify GitHub Actions runs tests on push

@eriktelepovsky
eriktelepovsky merged commit 8b70131 into master Jan 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant