-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Expand file tree
/
Copy path__init__.py
More file actions
66 lines (56 loc) · 2.03 KB
/
__init__.py
File metadata and controls
66 lines (56 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""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.key, "-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)",
),
]