Enhance CLI wrap functionality and streamline install options - #141
Conversation
Run providers from a persistent CAPA workspace without modifying in-repo configs, with scoped symlink exclusions, GUI wait-until-close, and stop killing active wraps. Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces a new detached process for the wrap command, allowing for better handling of interactive providers without console input conflicts. The wrap watcher runs in a separate process, ensuring that the main CLI can spawn the provider without interference. Additionally, updates to the launch process now utilize spawnSync for improved TTY handling and reliability. - Added `__wrap_watch__` command to start the wrap watcher. - Implemented `startDetachedWatchWorker` to manage the detached process. - Updated `launchProvider` to use spawnSync for CLI interactions. - Enhanced PID detection to include wrap watchers.
- Simplified the console output for the capabilities file update in the add command. - Introduced a `quiet` option in the install command to suppress UI output. - Updated the install command to manage the `quiet` flag state effectively. - Enhanced server management to conditionally log server status based on the `quiet` setting. - Adjusted the capabilities debounce time for improved performance during live re-apply operations.
PR Summary by QodoAdd
AI Description
Diagram
High-Level Assessment
Files changed (25)
|
Code Review by Qodo
1.
|
…rker Walk ancestors for wrap markers, restore workspace entries if relink fails, and keep the detached watcher's poll timer referenced. Co-authored-by: Cursor <cursoragent@cursor.com>
This pull request introduces several improvements and new features to the CLI, focusing on enhanced workspace handling, better process control, and improved testability. The main highlights are the addition of a new
wrapcommand for workspace management, more flexible and testable install logic, and new tests for theaddcommand's install behavior.Key changes include:
New Features: Wrap Workspace Support
wrapCommandinwrap.tsto manage provider-specific wrap workspaces, including workspace preparation, watcher management, and launching providers in both GUI and CLI modes. This includes robust process and signal handling for cleanup and user interrupts.index.ts), including a new__wrap_watch__mode for detached watcher processes. [1] [2]Install Command Refactoring and Options
installCommandto accept additional options (projectPath,identityPath,exitProcess,quiet) for improved testability and better integration with wrap workspaces. The install logic is now encapsulated in a helper function for clearer process control and error handling. [1] [2] [3] [4] [5] [6] [7] [8] [9]Add Command Enhancements
addCommandto support an--installflag, allowing users to optionally trigger installation after updating the capabilities file. The install step is now conditional and provides user feedback. [1] [2] [3] [4] [5]Test Coverage
addCommandto verify the correct behavior of the--installflag, ensuring that installation is only triggered when requested.These changes collectively improve the CLI's robustness, extensibility, and testability, especially around workspace management and install workflows.