Skip to content

Feat/migrate to subcommands#39

Merged
eetann merged 6 commits intodevfrom
feat/migrate-to-subcommands
Nov 22, 2025
Merged

Feat/migrate to subcommands#39
eetann merged 6 commits intodevfrom
feat/migrate-to-subcommands

Conversation

@eetann
Copy link
Copy Markdown
Owner

@eetann eetann commented Nov 22, 2025

No description provided.

Migrate from option-based modes to explicit subcommands for better UX and maintainability:
- old: `editprompt --resume` → new: `editprompt resume`
- old: `editprompt -- "text"` → new: `editprompt input "text"`
- old: `editprompt --quote` → new: `editprompt collect`
- old: `editprompt --capture` → new: `editprompt dump`
- old: `editprompt` (no args) → new: `editprompt open`

Changes:
- Update dependencies to latest versions (gunshi v0.26.3)
- Add shared args definitions in `src/modes/args.ts` for reusability
- Rename mode files to match subcommand names:
  - `sendOnly.ts` → `input.ts`
  - `quote.ts` → `collect.ts`
  - `capture.ts` → `dump.ts`
- Implement subcommand definitions using gunshi's `define()` in each mode file
- Refactor `src/index.ts` to route subcommands instead of parsing options
- Add migration guide error message when running without subcommands
- Remove unused `src/modules/process.ts` and related tests
- Update integration tests for subcommand-based execution

BREAKING CHANGE: All commands now require explicit subcommands. Running `editprompt` without a subcommand will show a migration guide and exit with error.
Add migration guide and update all command examples to use new subcommand syntax:
- Create comprehensive migration guide (docs/migration-guide-v1.md)
  - Migration table mapping old commands to new subcommands
  - Detailed examples for each subcommand
  - Help commands and troubleshooting tips
- Update README.md
  - Add migration guide link at the top for v0.8.1 users
  - Convert all command examples to subcommand format
  - Update tmux, WezTerm, and Neovim configuration examples
- Update docs/modes.md
  - Rename "Mode Implementation Details" to "Subcommand Implementation Details"
  - Update all mode references to subcommand names (openEditor→open, sendOnly→input, quote→collect, capture→dump)
  - Update all code examples to use subcommand syntax
Implement the ability to send content from one editor pane to multiple target panes simultaneously.

Major changes:
- Add new `register` command to register multiple target panes for an editor pane
- Update `open` command to accept multiple `--target-pane` options
- Refactor content delivery logic to support batch sending to multiple panes
- Add `DeliveryResult` type to track success/failure across multiple panes
- Update tmux module to store target pane IDs as comma-separated values in `@editprompt_target_panes`
- Update wezterm module to store target pane IDs as array in Conf
- Modify `resume` mode to focus on the first available target pane
- Update `dump` command to retrieve and combine quote content from all target panes
- Update `input` mode to send content to all registered target panes
- Add utility functions to normalize and deduplicate target pane IDs
- Implement graceful fallback behavior when some panes fail
- Add focus management for the first successful pane after content delivery
- Remove `EDITPROMPT_TARGET_PANE` environment variable in favor of multiplexer-stored data

Breaking changes:
- The `@editprompt_target_pane` pane variable in tmux is replaced by `@editprompt_target_panes` (comma-separated)
- The Conf structure for wezterm editor pane now uses `targetPaneIds` (array) instead of `targetPaneId` (string)
Convert Japanese test descriptions and comments to English in contentProcessor and sendConfig test files for better international collaboration.
- Added "Multiple Target Panes Support" section to open subcommand
- Added new register subcommand documentation
- Updated resume subcommand to reflect @editprompt_target_panes (comma-separated) instead of @editprompt_target_pane
- Updated input subcommand to explain reading from pane variables/Conf instead of environment variables
- Updated dump subcommand to support retrieving and combining quotes from multiple target panes
- Added "Sending to Multiple Panes" section to README with usage examples
@eetann eetann merged commit bb7db06 into dev Nov 22, 2025
@eetann eetann deleted the feat/migrate-to-subcommands branch November 22, 2025 00:44
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