capyai 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/bin/capy.js +61 -0
- package/bin/capy.ts +62 -0
- package/dist/capy.js +1619 -0
- package/package.json +36 -0
- package/src/api.ts +125 -0
- package/src/cli.ts +722 -0
- package/src/config.ts +93 -0
- package/src/format.ts +45 -0
- package/src/github.ts +112 -0
- package/src/greptile.ts +151 -0
- package/src/quality.ts +131 -0
- package/src/types.ts +181 -0
- package/src/watch.ts +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# capy-cli
|
|
2
|
+
|
|
3
|
+
Agent orchestrator with quality gates for [Capy.ai](https://capy.ai). Zero dependencies.
|
|
4
|
+
|
|
5
|
+
Works with Claude Code, Codex, OpenClaw, or any AI agent that can run shell commands.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g capy-cli
|
|
11
|
+
capy init
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or set env vars directly:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
export CAPY_API_KEY=capy_...
|
|
18
|
+
export CAPY_PROJECT_ID=...
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Start work
|
|
25
|
+
capy captain "Implement feature X. Files: src/foo.ts. Tests required."
|
|
26
|
+
capy build "Fix typo in README"
|
|
27
|
+
|
|
28
|
+
# Monitor
|
|
29
|
+
capy status
|
|
30
|
+
capy watch <thread-id>
|
|
31
|
+
|
|
32
|
+
# Review + approve
|
|
33
|
+
capy review <task-id>
|
|
34
|
+
capy approve <task-id>
|
|
35
|
+
capy retry <task-id> --fix="fix the failing test"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Every command supports `--json` for machine-readable output.
|
|
39
|
+
|
|
40
|
+
## Quality Gates
|
|
41
|
+
|
|
42
|
+
`capy review` checks pass/fail gates:
|
|
43
|
+
|
|
44
|
+
| Gate | What it checks |
|
|
45
|
+
|------|---------------|
|
|
46
|
+
| `pr_exists` | PR was created |
|
|
47
|
+
| `pr_open` | PR is open or merged |
|
|
48
|
+
| `ci` | CI checks passing |
|
|
49
|
+
| `greptile` | No unaddressed Greptile issues |
|
|
50
|
+
| `greptile_check` | Greptile GitHub status check |
|
|
51
|
+
| `threads` | No unresolved review threads |
|
|
52
|
+
| `tests` | Diff includes test files |
|
|
53
|
+
|
|
54
|
+
Configure which gates run via `capy config quality.reviewProvider greptile|capy|both|none`.
|
|
55
|
+
|
|
56
|
+
## For Agents
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
capy review TASK-1 --json # parse quality.pass boolean
|
|
60
|
+
capy status --json # full state dump
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Config
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
capy config defaultModel gpt-5.4
|
|
67
|
+
capy config quality.reviewProvider both
|
|
68
|
+
capy config notifyCommand "notify-send {text}"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Env vars: `CAPY_API_KEY`, `CAPY_PROJECT_ID`, `CAPY_SERVER`, `CAPY_ENV_FILE`, `GREPTILE_API_KEY`.
|
|
72
|
+
|
|
73
|
+
## Requirements
|
|
74
|
+
|
|
75
|
+
Node.js 18+ or Bun. GitHub CLI (`gh`) for quality gate checks.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
package/bin/capy.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
|
|
6
|
+
const cmd = process.argv[2];
|
|
7
|
+
|
|
8
|
+
if (!cmd || cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
9
|
+
const { version } = require("../package.json");
|
|
10
|
+
console.log(`capy — agent orchestrator with quality gates
|
|
11
|
+
|
|
12
|
+
Usage: capy <command> [args] [flags]
|
|
13
|
+
|
|
14
|
+
Agents:
|
|
15
|
+
captain <prompt> Start Captain thread
|
|
16
|
+
build <prompt> Start Build agent
|
|
17
|
+
threads [list|get|msg|stop|messages]
|
|
18
|
+
|
|
19
|
+
Tasks:
|
|
20
|
+
status Dashboard
|
|
21
|
+
list [status] List tasks
|
|
22
|
+
get <id> Task details
|
|
23
|
+
start/stop/msg <id> Control tasks
|
|
24
|
+
diff <id> View diff
|
|
25
|
+
pr <id> [title] Create PR
|
|
26
|
+
|
|
27
|
+
Quality:
|
|
28
|
+
review <id> Gate check
|
|
29
|
+
re-review <id> Trigger Greptile re-review
|
|
30
|
+
approve <id> [--force] Approve if gates pass
|
|
31
|
+
retry <id> [--fix="..."] Retry with context
|
|
32
|
+
|
|
33
|
+
Monitoring:
|
|
34
|
+
watch/unwatch <id> Auto-poll + notify
|
|
35
|
+
watches List watches
|
|
36
|
+
|
|
37
|
+
Config:
|
|
38
|
+
init Interactive setup
|
|
39
|
+
config [key] [value] Get/set config
|
|
40
|
+
models List models
|
|
41
|
+
tools All commands + env vars
|
|
42
|
+
|
|
43
|
+
Flags:
|
|
44
|
+
--json --model=<id> --opus --sonnet --fast
|
|
45
|
+
|
|
46
|
+
v${version}
|
|
47
|
+
`);
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const { run } = await import("../dist/capy.js");
|
|
53
|
+
await run(cmd, process.argv.slice(3));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
if (e.code === "ERR_MODULE_NOT_FOUND" || e.code === "MODULE_NOT_FOUND") {
|
|
56
|
+
console.error("capy: not built. Run: bun run build");
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
console.error(e.message);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
package/bin/capy.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const { version } = require("../package.json");
|
|
6
|
+
|
|
7
|
+
const cmd = process.argv[2];
|
|
8
|
+
|
|
9
|
+
if (!cmd || cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
10
|
+
console.log(`capy — agent orchestrator with quality gates
|
|
11
|
+
|
|
12
|
+
Usage: capy <command> [args] [flags]
|
|
13
|
+
|
|
14
|
+
Agents:
|
|
15
|
+
captain <prompt> Start Captain thread
|
|
16
|
+
build <prompt> Start Build agent
|
|
17
|
+
threads [list|get|msg|stop|messages]
|
|
18
|
+
|
|
19
|
+
Tasks:
|
|
20
|
+
status Dashboard
|
|
21
|
+
list [status] List tasks
|
|
22
|
+
get <id> Task details
|
|
23
|
+
start/stop/msg <id> Control tasks
|
|
24
|
+
diff <id> View diff
|
|
25
|
+
pr <id> [title] Create PR
|
|
26
|
+
|
|
27
|
+
Quality:
|
|
28
|
+
review <id> Gate check
|
|
29
|
+
re-review <id> Trigger Greptile re-review
|
|
30
|
+
approve <id> [--force] Approve if gates pass
|
|
31
|
+
retry <id> [--fix="..."] Retry with context
|
|
32
|
+
|
|
33
|
+
Monitoring:
|
|
34
|
+
watch/unwatch <id> Auto-poll + notify
|
|
35
|
+
watches List watches
|
|
36
|
+
|
|
37
|
+
Config:
|
|
38
|
+
init Interactive setup
|
|
39
|
+
config [key] [value] Get/set config
|
|
40
|
+
models List models
|
|
41
|
+
tools All commands + env vars
|
|
42
|
+
|
|
43
|
+
Flags:
|
|
44
|
+
--json --model=<id> --opus --sonnet --fast
|
|
45
|
+
|
|
46
|
+
v${version}
|
|
47
|
+
`);
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const { run } = await import("../src/cli.js");
|
|
53
|
+
await run(cmd, process.argv.slice(3));
|
|
54
|
+
} catch (e: unknown) {
|
|
55
|
+
const err = e as Error & { code?: string };
|
|
56
|
+
if (err.code === "MODULE_NOT_FOUND" || err.code === "ERR_MODULE_NOT_FOUND") {
|
|
57
|
+
console.error("capy: broken install. Reinstall: npm i -g capy-cli");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
console.error(err.message);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|