Fix: no longer overrides readme, package.json and gitignore but instead merges and/or adds to them if they already exist. Also bins the app into its own package. Can now call all functions using task-master instead of calling the dev.js script directly. Also adjusts readme and cursor rule to know about this.

This commit is contained in:
Eyal Toledano
2025-03-22 15:52:22 -04:00
parent 58cf14c1d1
commit 70d307a711
33 changed files with 4345 additions and 224 deletions

84
tasks/task_002.txt Normal file
View File

@@ -0,0 +1,84 @@
# Task ID: 2
# Title: Develop Command Line Interface Foundation
# Status: done
# Dependencies: 1 ✅
# Priority: high
# Description: Create the basic CLI structure using Commander.js with command parsing and help documentation.
# Details:
Implement the CLI foundation including:
- Set up Commander.js for command parsing
- Create help documentation for all commands
- Implement colorized console output for better readability
- Add logging system with configurable levels
- Handle global options (--help, --version, --file, --quiet, --debug, --json)
# Test Strategy:
Test each command with various parameters to ensure proper parsing. Verify help documentation is comprehensive and accurate. Test logging at different verbosity levels.
# Subtasks:
## Subtask ID: 1
## Title: Set up Commander.js Framework
## Status: done
## Dependencies: None
## Description: Initialize and configure Commander.js as the command-line parsing framework. Create the main CLI entry point file that will serve as the application's command-line interface. Set up the basic command structure with program name, version, and description from package.json. Implement the core program flow including command registration pattern and error handling.
## Acceptance Criteria:
- Commander.js is properly installed and configured in the project
- CLI entry point file is created with proper Node.js shebang and permissions
- Program metadata (name, version, description) is correctly loaded from package.json
- Basic command registration pattern is established
- Global error handling is implemented to catch and display unhandled exceptions
## Subtask ID: 2
## Title: Implement Global Options Handling
## Status: done
## Dependencies: 2.1 ✅
## Description: Add support for all required global options including --help, --version, --file, --quiet, --debug, and --json. Implement the logic to process these options and modify program behavior accordingly. Create a configuration object that stores these settings and can be accessed by all commands. Ensure options can be combined and have appropriate precedence rules.
## Acceptance Criteria:
- All specified global options (--help, --version, --file, --quiet, --debug, --json) are implemented
- Options correctly modify program behavior when specified
- Alternative tasks.json file can be specified with --file option
- Output verbosity is controlled by --quiet and --debug flags
- JSON output format is supported with the --json flag
- Help text is displayed when --help is specified
- Version information is displayed when --version is specified
## Subtask ID: 3
## Title: Create Command Help Documentation System
## Status: done
## Dependencies: 2.1 ✅, 2.2 ✅
## Description: Develop a comprehensive help documentation system that provides clear usage instructions for all commands and options. Implement both command-specific help and general program help. Ensure help text is well-formatted, consistent, and includes examples. Create a centralized system for managing help text to ensure consistency across the application.
## Acceptance Criteria:
- General program help shows all available commands and global options
- Command-specific help shows detailed usage information for each command
- Help text includes clear examples of command usage
- Help formatting is consistent and readable across all commands
- Help system handles both explicit help requests (--help) and invalid command syntax
## Subtask ID: 4
## Title: Implement Colorized Console Output
## Status: done
## Dependencies: 2.1 ✅
## Description: Create a utility module for colorized console output to improve readability and user experience. Implement different color schemes for various message types (info, warning, error, success). Add support for text styling (bold, underline, etc.) and ensure colors are used consistently throughout the application. Make sure colors can be disabled in environments that don't support them.
## Acceptance Criteria:
- Utility module provides consistent API for colorized output
- Different message types (info, warning, error, success) use appropriate colors
- Text styling options (bold, underline, etc.) are available
- Colors are disabled automatically in environments that don't support them
- Color usage is consistent across the application
- Output remains readable when colors are disabled
## Subtask ID: 5
## Title: Develop Configurable Logging System
## Status: done
## Dependencies: 2.1 ✅, 2.2 ✅, 2.4 ✅
## Description: Create a logging system with configurable verbosity levels that integrates with the CLI. Implement different logging levels (error, warn, info, debug, trace) and ensure log output respects the verbosity settings specified by global options. Add support for log output redirection to files. Ensure logs include appropriate timestamps and context information.
## Acceptance Criteria:
- Logging system supports multiple verbosity levels (error, warn, info, debug, trace)
- Log output respects verbosity settings from global options (--quiet, --debug)
- Logs include timestamps and appropriate context information
- Log messages use consistent formatting and appropriate colors
- Logging can be redirected to files when needed
- Debug logs provide detailed information useful for troubleshooting
- Logging system has minimal performance impact when not in use
Each of these subtasks directly addresses a component of the CLI foundation as specified in the task description, and together they provide a complete implementation of the required functionality. The subtasks are ordered in a logical sequence that respects their dependencies.