mirror of
https://github.com/github/spec-kit
synced 2026-06-21 13:51:39 +00:00
b4e5a1c3be
* Initial plan * feat: support SPECKIT_INTEGRATION_<KEY>_EXECUTABLE env var override 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." * fix: complete docstring sentence in _resolve_executable * test: generalize extra-args test comments for override coverage * Fix stale Codex executable comment --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
66 lines
2.0 KiB
Python
66 lines
2.0 KiB
Python
"""Devin for Terminal integration — skills-based agent.
|
|
|
|
Devin uses the ``.devin/skills/speckit-<name>/SKILL.md`` layout and
|
|
reads project context from ``AGENTS.md`` at the repo root. The CLI
|
|
binary is ``devin`` and skills are invoked via ``/<name>`` inside an
|
|
interactive ``devin`` session.
|
|
|
|
See: https://cli.devin.ai/docs/extensibility/skills/overview
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from ..base import IntegrationOption, SkillsIntegration
|
|
|
|
|
|
class DevinIntegration(SkillsIntegration):
|
|
"""Integration for Cognition AI's Devin for Terminal."""
|
|
|
|
key = "devin"
|
|
config = {
|
|
"name": "Devin for Terminal",
|
|
"folder": ".devin/",
|
|
"commands_subdir": "skills",
|
|
"install_url": "https://cli.devin.ai/docs",
|
|
"requires_cli": True,
|
|
}
|
|
registrar_config = {
|
|
"dir": ".devin/skills",
|
|
"format": "markdown",
|
|
"args": "$ARGUMENTS",
|
|
"extension": "/SKILL.md",
|
|
}
|
|
context_file = "AGENTS.md"
|
|
|
|
def build_exec_args(
|
|
self,
|
|
prompt: str,
|
|
*,
|
|
model: str | None = None,
|
|
output_json: bool = True,
|
|
) -> list[str] | None:
|
|
"""Build non-interactive CLI args for Devin for Terminal.
|
|
|
|
Devin supports ``devin -p <prompt>`` for single-turn execution
|
|
and ``--model`` for model selection, but its CLI has no flag
|
|
for structured JSON output. When ``output_json`` is requested,
|
|
Devin is still dispatched normally and returns plain-text
|
|
stdout instead of structured JSON. ``requires_cli=True`` is
|
|
kept on the integration for tool detection.
|
|
"""
|
|
args = [self._resolve_executable(), "-p", prompt]
|
|
self._apply_extra_args_env_var(args)
|
|
if model:
|
|
args.extend(["--model", model])
|
|
return args
|
|
|
|
@classmethod
|
|
def options(cls) -> list[IntegrationOption]:
|
|
return [
|
|
IntegrationOption(
|
|
"--skills",
|
|
is_flag=True,
|
|
default=True,
|
|
help="Install as agent skills (default for Devin)",
|
|
),
|
|
] |