[PR #481] [CLOSED] feat: hotkeys #9627

Closed
opened 2026-02-16 18:13:52 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/481
Author: @Tech0001
Created: 6/27/2025
Status: Closed

Base: devHead: feat-hotkeys


📝 Commits (3)

  • df9cf5e Provider Selection
  • f44b6f2 Added a Remove Provider section
  • 396a3af feat: Add unlimited numeric hotkeys for provider switching

📊 Changes

23 files changed (+4258 additions, -225 deletions)

View changed files

packages/opencode/src/cli/cmd/provider.ts (+144 -0)
📝 packages/opencode/src/config/config.ts (+1 -0)
📝 packages/opencode/src/index.ts (+2 -0)
📝 packages/opencode/src/server/server.ts (+263 -0)
packages/tui/cmd/opencode/opencode (+0 -0)
📝 packages/tui/internal/app/app.go (+42 -3)
📝 packages/tui/internal/commands/command.go (+16 -1)
📝 packages/tui/internal/completions/commands.go (+101 -21)
packages/tui/internal/components/dialog/auth_api_key.go (+174 -0)
packages/tui/internal/components/dialog/auth_method_select.go (+119 -0)
packages/tui/internal/components/dialog/auth_oauth.go (+451 -0)
packages/tui/internal/components/dialog/auth_provider_select.go (+133 -0)
packages/tui/internal/components/dialog/confirm_remove_provider.go (+146 -0)
packages/tui/internal/components/dialog/hotkeys.go (+276 -0)
📝 packages/tui/internal/components/dialog/models.go (+17 -12)
packages/tui/internal/components/dialog/providers.go (+311 -0)
packages/tui/internal/components/dialog/remove_provider.go (+161 -0)
📝 packages/tui/internal/components/status/status.go (+12 -2)
📝 packages/tui/internal/config/config.go (+18 -4)
📝 packages/tui/internal/tui/tui.go (+399 -4)

...and 3 more files

📄 Description

This builds on PR #479 Provider Selection

feat: Add unlimited numeric hotkeys for provider switching

Changes:

  • Added provider hotkeys system with unlimited numeric assignments (not limited to 1-5)
  • Users can assign any number (0-9+) as a hotkey to providers via /hotkeys command
  • Quick switch providers using /[number] commands (e.g., /3, /15, /99)
  • Hotkeys are shown in completion dropdown as valid commands
  • Added custom provider ordering with shift+up/down to reorder
  • Persist hotkey assignments and provider order in state

Files modified:

  • internal/commands/command.go: Added ProviderHotkeysCommand and ProviderQuickSwitchCommand
  • internal/completions/commands.go: Enhanced to recognize user-assigned hotkeys in completion system
  • internal/components/dialog/providers.go: Added provider reordering with move up/down functionality
  • internal/components/dialog/hotkeys.go: New dialog for managing provider hotkeys
  • internal/config/config.go: Added ProviderHotkeys map and ProviderOrder array to state
  • internal/tui/tui.go: Implemented hotkey handling, quick switch logic, and provider ordering

Key features:

  • /hotkeys command opens management dialog
  • Press 0-9 to assign hotkeys in the dialog
  • /[number] instantly switches to assigned provider
  • Visual indicators show assigned hotkeys
  • Hotkeys appear in command completion
  • Provider positions can be customized

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/481 **Author:** [@Tech0001](https://github.com/Tech0001) **Created:** 6/27/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat-hotkeys` --- ### 📝 Commits (3) - [`df9cf5e`](https://github.com/anomalyco/opencode/commit/df9cf5e2d92dac86132ed5ffd4286a3d5ee09db3) Provider Selection - [`f44b6f2`](https://github.com/anomalyco/opencode/commit/f44b6f2bf1727d191eb5e76cb28113c38ac820e7) Added a Remove Provider section - [`396a3af`](https://github.com/anomalyco/opencode/commit/396a3af94eeb179a35299f17aadcc37240958e79) feat: Add unlimited numeric hotkeys for provider switching ### 📊 Changes **23 files changed** (+4258 additions, -225 deletions) <details> <summary>View changed files</summary> ➕ `packages/opencode/src/cli/cmd/provider.ts` (+144 -0) 📝 `packages/opencode/src/config/config.ts` (+1 -0) 📝 `packages/opencode/src/index.ts` (+2 -0) 📝 `packages/opencode/src/server/server.ts` (+263 -0) ➕ `packages/tui/cmd/opencode/opencode` (+0 -0) 📝 `packages/tui/internal/app/app.go` (+42 -3) 📝 `packages/tui/internal/commands/command.go` (+16 -1) 📝 `packages/tui/internal/completions/commands.go` (+101 -21) ➕ `packages/tui/internal/components/dialog/auth_api_key.go` (+174 -0) ➕ `packages/tui/internal/components/dialog/auth_method_select.go` (+119 -0) ➕ `packages/tui/internal/components/dialog/auth_oauth.go` (+451 -0) ➕ `packages/tui/internal/components/dialog/auth_provider_select.go` (+133 -0) ➕ `packages/tui/internal/components/dialog/confirm_remove_provider.go` (+146 -0) ➕ `packages/tui/internal/components/dialog/hotkeys.go` (+276 -0) 📝 `packages/tui/internal/components/dialog/models.go` (+17 -12) ➕ `packages/tui/internal/components/dialog/providers.go` (+311 -0) ➕ `packages/tui/internal/components/dialog/remove_provider.go` (+161 -0) 📝 `packages/tui/internal/components/status/status.go` (+12 -2) 📝 `packages/tui/internal/config/config.go` (+18 -4) 📝 `packages/tui/internal/tui/tui.go` (+399 -4) _...and 3 more files_ </details> ### 📄 Description This builds on PR #479 Provider Selection feat: Add unlimited numeric hotkeys for provider switching Changes: - Added provider hotkeys system with unlimited numeric assignments (not limited to 1-5) - Users can assign any number (0-9+) as a hotkey to providers via /hotkeys command - Quick switch providers using /[number] commands (e.g., /3, /15, /99) - Hotkeys are shown in completion dropdown as valid commands - Added custom provider ordering with shift+up/down to reorder - Persist hotkey assignments and provider order in state Files modified: - internal/commands/command.go: Added ProviderHotkeysCommand and ProviderQuickSwitchCommand - internal/completions/commands.go: Enhanced to recognize user-assigned hotkeys in completion system - internal/components/dialog/providers.go: Added provider reordering with move up/down functionality - internal/components/dialog/hotkeys.go: New dialog for managing provider hotkeys - internal/config/config.go: Added ProviderHotkeys map and ProviderOrder array to state - internal/tui/tui.go: Implemented hotkey handling, quick switch logic, and provider ordering Key features: - /hotkeys command opens management dialog - Press 0-9 to assign hotkeys in the dialog - /[number] instantly switches to assigned provider - Visual indicators show assigned hotkeys - Hotkeys appear in command completion - Provider positions can be customized --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:52 -05:00
yindo closed this issue 2026-02-16 18:13:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9627