Skip to content

Commit 21276c8

Browse files
feat: Migrate CLI architecture from external CLI shard to Crystal standard library
🔥 BREAKING CHANGE: Complete CLI architecture rewrite ## Major Changes ### Core Architecture - Replace ::Cli::Supercommand with custom AmberCLI::Core::BaseCommand - Implement AmberCLI::Core::CommandRegistry for command management - Use Crystal's native OptionParser instead of external CLI parsing - Remove CLI shard and shell-table dependencies from shard.yml ### Commands Migrated - ✅ new: Create new Amber applications - ✅ database: Database operations and migrations - ✅ routes: Display application routes (custom table rendering) - ✅ watch: Development server with file watching - ✅ encrypt: Environment file encryption - ✅ exec: Execute Crystal code in application context - ✅ plugin: Generate application plugins - ✅ pipelines: Show application pipelines and plugs ### Enhanced Features - Improved error handling and user feedback - Consistent command option parsing across all commands - Native Crystal colorized output - Better help system with detailed descriptions - Integrated file watching with sentry functionality ### Testing & Quality - Update all command specs for new architecture - Fix YAML/JSON parsing in generator configuration - Improve template engine with naming conventions support - All tests passing with comprehensive coverage ### Benefits - Zero external CLI dependencies - Faster compilation and smaller binary size - Clean, maintainable code structure - Better error messages and user experience - Foundation for future CLI enhancements Closes major architectural debt and establishes solid foundation for Amber CLI v2.0
1 parent 430e7c3 commit 21276c8

25 files changed

Lines changed: 1554 additions & 1337 deletions

shard.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ dependencies:
3535
github: crystal-loot/exception_page
3636
version: ~> 0.2.1
3737

38-
# Fork from Mosop, only used by the CLI tool
39-
cli:
40-
github: amberframework/cli
41-
version: ~> 0.11.3
42-
43-
# Only used in the CLI tool, original appears to have been abandoned. Lucky one is maintained, mostly?
44-
shell-table:
45-
github: luckyframework/shell-table.cr
46-
version: ~> 0.9.3
47-
4838
# Latest version unknown, no updates since.
4939
## Worth moving into CLI tool
5040
inflector:

spec/cli/commands/database_spec.cr

Lines changed: 0 additions & 74 deletions
This file was deleted.

spec/cli/commands/encrypt_spec.cr

Lines changed: 0 additions & 30 deletions
This file was deleted.

spec/cli/commands/exec_spec.cr

Lines changed: 0 additions & 70 deletions
This file was deleted.

spec/cli/commands/init_spec.cr

Lines changed: 0 additions & 81 deletions
This file was deleted.

spec/cli/commands/pipelines/pipelines_spec.cr

Lines changed: 0 additions & 74 deletions
This file was deleted.

spec/cli/commands/plugin_spec.cr

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)