feat: support SPECKIT_INTEGRATION_<KEY>_EXECUTABLE env var#2743
Merged
mnriem merged 5 commits intoMay 29, 2026
Conversation
Adds `IntegrationBase._resolve_executable()` which reads `SPECKIT_INTEGRATION_<KEY>_EXECUTABLE` (hyphens→underscores, uppercased) and falls back to `self.key` when unset or whitespace-only. All concrete `build_exec_args()` implementations now call `self._resolve_executable()` instead of hard-coding `self.key` or `"agy"` as the first argv token: - MarkdownIntegration, TomlIntegration, SkillsIntegration (base classes) - CodexIntegration, DevinIntegration, OpencodeIntegration, HermesIntegration, AgyIntegration - CopilotIntegration (overrides `_resolve_executable()` to fall back to the platform-specific `_copilot_executable()` default; also updates `dispatch_command()` to use `_resolve_executable()`) Tests added to tests/integrations/test_extra_args.py covering: - default (unset) falls back to key - env var replaces first argv token - whitespace-only env var is a no-op - key hyphen→underscore normalisation - cross-integration scoping (wrong key ignored) - all override integrations (Codex, Devin, Opencode, Copilot) - Copilot dispatch_command path - EXECUTABLE and EXTRA_ARGS can be set simultaneously See issue #2596."
Copilot
AI
changed the title
[WIP] Add support for SPECKIT_INTEGRATION_EXECUTABLE env var to override executable
feat: support SPECKIT_INTEGRATION_<KEY>_EXECUTABLE env var
May 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an operator-facing escape hatch to override which CLI binary an integration uses (without changing integration config), by introducing a shared IntegrationBase._resolve_executable() that reads SPECKIT_INTEGRATION_<KEY>_EXECUTABLE and wiring it into integration argv construction (with a Copilot-specific override to preserve copilot.cmd behavior on Windows).
Changes:
- Introduce
IntegrationBase._resolve_executable()to resolve the executable fromSPECKIT_INTEGRATION_<KEY>_EXECUTABLE(with hyphen→underscore normalization) and fall back toself.keyfor backward compatibility. - Update base and overridden
build_exec_args()implementations to use_resolve_executable()as argv[0]; updateCopilotIntegration.dispatch_command()similarly, with Copilot overriding_resolve_executable()to preserve platform defaults. - Extend the existing env-var test suite to cover the new executable override behavior alongside extra-args behavior.
Show a summary per file
| File | Description |
|---|---|
| tests/integrations/test_extra_args.py | Expands tests to cover *_EXECUTABLE override and updates env cleanup/docstrings. |
| src/specify_cli/integrations/base.py | Adds _resolve_executable() and wires it into shared base build_exec_args() implementations. |
| src/specify_cli/integrations/codex/init.py | Uses _resolve_executable() for argv[0] in Codex override. |
| src/specify_cli/integrations/devin/init.py | Uses _resolve_executable() for argv[0] in Devin override. |
| src/specify_cli/integrations/opencode/init.py | Uses _resolve_executable() for argv[0] in Opencode override. |
| src/specify_cli/integrations/hermes/init.py | Uses _resolve_executable() for argv[0] in Hermes override. |
| src/specify_cli/integrations/copilot/init.py | Adds Copilot-specific _resolve_executable() and updates build/dispatch argv[0] usage. |
| src/specify_cli/integrations/agy/init.py | Uses _resolve_executable() for argv[0] in Agy override. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 2
mnriem
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operators had no way to override the CLI binary path for an integration without modifying integration configuration, making it difficult to pin a specific version or use a non-standard install location.
Changes
IntegrationBase._resolve_executable()(new method)SPECKIT_INTEGRATION_<KEY>_EXECUTABLE; key is uppercased with hyphens→underscores (e.g.kiro-cli→SPECKIT_INTEGRATION_KIRO_CLI_EXECUTABLE)self.key(no behaviour change for existing users)All
build_exec_args()implementations updated to callself._resolve_executable()as the first argv token:MarkdownIntegration,TomlIntegration,SkillsIntegrationCodexIntegration,DevinIntegration,OpencodeIntegration,HermesIntegration,AgyIntegrationCopilotIntegrationoverrides_resolve_executable()to check the env var first, then fall back to the platform-specific default (copilot.cmdon Windows,copilotelsewhere).dispatch_command()is updated alongsidebuild_exec_args().Example
SPECKIT_INTEGRATION_<KEY>_EXECUTABLEandSPECKIT_INTEGRATION_<KEY>_EXTRA_ARGSare independent and can be used simultaneously.