/
mkudmi
/
gigaspec-kit
Обзор
Документация
Войти
/
mkudmi
/
gigaspec-kit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/specify_cli/integrations/opencode/__init__.py
51 строка
1 KB
Copilot
feat: support SPECKIT_INTEGRATION_<KEY>_EXECUTABLE env var (#2743)
29 май 2026, 18:19
Не верифицирован
29 май 2026, 18:19
b4e5a1c
Код
Авторство
О чём код?
"""opencode integration.""" from ..base import MarkdownIntegration class OpencodeIntegration(MarkdownIntegration): key = "opencode" config = { "name": "opencode", "folder": ".opencode/", "commands_subdir": "commands", "install_url": "https://opencode.ai", "requires_cli": True, } registrar_config = { "dir": ".opencode/commands", "legacy_dir": ".opencode/command", "format": "markdown", "args": "$ARGUMENTS", "extension": ".md", } context_file = "AGENTS.md" def build_exec_args( self, prompt: str, *, model: str | None = None, output_json: bool = True, ) -> list[str] | None: args = [self._resolve_executable(), "run"] # Apply operator-injected extra args before the prompt-derived # --command and the canonical --format/-m flags so Spec Kit's # later appends remain authoritative under repeated-flag CLI # semantics. self._apply_extra_args_env_var(args) message = prompt if prompt.startswith("/"): command, _, remainder = prompt[1:].partition(" ") if command: args.extend(["--command", command]) message = remainder if model: args.extend(["-m", model]) if output_json: args.extend(["--format", "json"]) if message: args.append(message) return args