mokout-cli 0.1.6 → 0.1.7
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 +65 -0
- package/dist/cli.js +99 -31
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -80,6 +80,71 @@ mokout code-fast init --dry-run # preview
|
|
|
80
80
|
Idempotent: re-running refreshes the doctrine's managed block in `CLAUDE.md`
|
|
81
81
|
and leaves everything else (including your own notes) untouched.
|
|
82
82
|
|
|
83
|
+
### Advanced Agent Workflows (via google/agents-cli)
|
|
84
|
+
|
|
85
|
+
`mokout-cli` installs and seamlessly wraps the [`google/agents-cli`](https://github.com/google/agents-cli) toolkit, providing deep capabilities for evaluating, testing, and deploying coding agents. All `agents-cli` commands are proxied through `mokout agents`.
|
|
86
|
+
|
|
87
|
+
**CLI Commands**
|
|
88
|
+
| Command | What it does |
|
|
89
|
+
|---------|--------------|
|
|
90
|
+
| `mokout agents setup` | Install CLI + skills to coding agents (runs automatically on install) |
|
|
91
|
+
| `mokout agents scaffold <name>` | Create a new agent project |
|
|
92
|
+
| `mokout agents eval generate` | Run agent on eval dataset, produce traces |
|
|
93
|
+
| `mokout agents eval grade` | Run agent evaluations on the traces |
|
|
94
|
+
| `mokout agents deploy` | Deploy to Google Cloud |
|
|
95
|
+
| `mokout agents publish gemini-enterprise` | Register with Gemini Enterprise |
|
|
96
|
+
|
|
97
|
+
**See all commands**
|
|
98
|
+
| Command | Description |
|
|
99
|
+
|---------|-------------|
|
|
100
|
+
| `mokout agents login` | Authenticate with Google Cloud or AI Studio |
|
|
101
|
+
| `mokout agents login --status` | Show authentication status |
|
|
102
|
+
|
|
103
|
+
**Scaffold**
|
|
104
|
+
| Command | Description |
|
|
105
|
+
|---------|-------------|
|
|
106
|
+
| `mokout agents scaffold <name>` | Create a new agent project |
|
|
107
|
+
| `mokout agents scaffold enhance` | Add deployment, CI/CD, or RAG to an existing project |
|
|
108
|
+
| `mokout agents scaffold upgrade` | Upgrade project to a newer agents-cli version |
|
|
109
|
+
|
|
110
|
+
**Develop**
|
|
111
|
+
| Command | Description |
|
|
112
|
+
|---------|-------------|
|
|
113
|
+
| `mokout agents run "prompt"` | Run agent with a single prompt |
|
|
114
|
+
| `mokout agents install` | Install project dependencies |
|
|
115
|
+
| `mokout agents lint` | Run code quality checks (Ruff) |
|
|
116
|
+
|
|
117
|
+
**Evaluate**
|
|
118
|
+
| Command | Description |
|
|
119
|
+
|---------|-------------|
|
|
120
|
+
| `mokout agents eval generate` | Run agent inference over eval cases |
|
|
121
|
+
| `mokout agents eval grade` | Grade generated traces against metrics |
|
|
122
|
+
| `mokout agents eval dataset synthesize` | Synthesize multi-turn eval scenarios for your local agent |
|
|
123
|
+
| `mokout agents eval compare` | Compare two eval result files |
|
|
124
|
+
| `mokout agents eval analyze` | Cluster failure modes from grade results |
|
|
125
|
+
| `mokout agents eval metric list` | List available metrics |
|
|
126
|
+
| `mokout agents eval optimize` | Auto-tune agent prompts using eval data |
|
|
127
|
+
|
|
128
|
+
**Deploy & Publish**
|
|
129
|
+
| Command | Description |
|
|
130
|
+
|---------|-------------|
|
|
131
|
+
| `mokout agents deploy` | Deploy to Google Cloud |
|
|
132
|
+
| `mokout agents publish gemini-enterprise` | Register with Gemini Enterprise |
|
|
133
|
+
| `mokout agents infra single-project` | Provision single-project infrastructure |
|
|
134
|
+
| `mokout agents infra cicd` | Set up CI/CD pipeline + staging/prod infrastructure |
|
|
135
|
+
|
|
136
|
+
**Data**
|
|
137
|
+
| Command | Description |
|
|
138
|
+
|---------|-------------|
|
|
139
|
+
| `mokout agents infra datastore` | Provision datastore infrastructure for RAG |
|
|
140
|
+
| `mokout agents data-ingestion` | Run data ingestion pipeline |
|
|
141
|
+
|
|
142
|
+
**Other**
|
|
143
|
+
| Command | Description |
|
|
144
|
+
|---------|-------------|
|
|
145
|
+
| `mokout agents info` | Show project config and CLI version |
|
|
146
|
+
| `mokout agents update` | Force reinstall skills to all IDEs |
|
|
147
|
+
|
|
83
148
|
## Install
|
|
84
149
|
|
|
85
150
|
No install needed — `npx mokout project init` runs the latest version. To install globally:
|
package/dist/cli.js
CHANGED
|
@@ -3,9 +3,75 @@
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { Builtins, Cli } from "clipanion";
|
|
5
5
|
|
|
6
|
-
// src/commands/
|
|
6
|
+
// src/commands/agent-init.ts
|
|
7
|
+
import { spawnSync } from "child_process";
|
|
7
8
|
import * as p from "@clack/prompts";
|
|
8
|
-
import { Command
|
|
9
|
+
import { Command } from "clipanion";
|
|
10
|
+
var AgentInitCommand = class extends Command {
|
|
11
|
+
static paths = [["agent", "init"]];
|
|
12
|
+
static usage = Command.Usage({
|
|
13
|
+
description: "Initialize and install google-agents-cli skills locally in the project folder.",
|
|
14
|
+
examples: [["Install skills to workspace", "mokout agent init"]]
|
|
15
|
+
});
|
|
16
|
+
async execute() {
|
|
17
|
+
p.intro("mokout agent init");
|
|
18
|
+
const s = p.spinner();
|
|
19
|
+
s.start("Installing google-agents-cli and workspace skills...");
|
|
20
|
+
const cwd = process.cwd();
|
|
21
|
+
const installResult = spawnSync("uv", ["tool", "install", "google-agents-cli"], {
|
|
22
|
+
cwd,
|
|
23
|
+
stdio: "inherit"
|
|
24
|
+
});
|
|
25
|
+
if (installResult.error || installResult.status !== null && installResult.status !== 0) {
|
|
26
|
+
p.cancel("Failed to install google-agents-cli via uv tool.");
|
|
27
|
+
return installResult.status ?? 1;
|
|
28
|
+
}
|
|
29
|
+
const setupResult = spawnSync(
|
|
30
|
+
"uv",
|
|
31
|
+
["tool", "run", "google-agents-cli", "setup", "--workspace"],
|
|
32
|
+
{
|
|
33
|
+
cwd,
|
|
34
|
+
stdio: "inherit"
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
if (setupResult.error || setupResult.status !== null && setupResult.status !== 0) {
|
|
38
|
+
p.cancel("Failed to setup google-agents-cli skills.");
|
|
39
|
+
return setupResult.status ?? 1;
|
|
40
|
+
}
|
|
41
|
+
s.stop("Skills installed locally in the workspace!");
|
|
42
|
+
p.outro("Done.");
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/commands/agents.ts
|
|
48
|
+
import { spawnSync as spawnSync2 } from "child_process";
|
|
49
|
+
import { Command as Command2, Option } from "clipanion";
|
|
50
|
+
var AgentsCommand = class extends Command2 {
|
|
51
|
+
static paths = [["agents"]];
|
|
52
|
+
static usage = Command2.Usage({
|
|
53
|
+
category: "agents",
|
|
54
|
+
description: "Proxy command for google/agents-cli (scaffold, eval, deploy, etc.)",
|
|
55
|
+
examples: [
|
|
56
|
+
["Scaffold an agent project", "mokout agents scaffold my-agent"],
|
|
57
|
+
["Evaluate the agent", "mokout agents eval generate"],
|
|
58
|
+
["Deploy the agent", "mokout agents deploy"]
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
args = Option.Proxy();
|
|
62
|
+
async execute() {
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
const result = spawnSync2("uv", ["tool", "run", "google-agents-cli", ...this.args], {
|
|
65
|
+
cwd,
|
|
66
|
+
stdio: "inherit"
|
|
67
|
+
});
|
|
68
|
+
return result.status ?? (result.error ? 1 : 0);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/commands/code-fast-init.ts
|
|
73
|
+
import * as p2 from "@clack/prompts";
|
|
74
|
+
import { Command as Command3, Option as Option2 } from "clipanion";
|
|
9
75
|
import nodePlop from "node-plop";
|
|
10
76
|
|
|
11
77
|
// src/generators/engine.ts
|
|
@@ -334,9 +400,9 @@ function filesFor(stack) {
|
|
|
334
400
|
}
|
|
335
401
|
|
|
336
402
|
// src/commands/code-fast-init.ts
|
|
337
|
-
var CodeFastInitCommand = class extends
|
|
403
|
+
var CodeFastInitCommand = class extends Command3 {
|
|
338
404
|
static paths = [["code-fast", "init"]];
|
|
339
|
-
static usage =
|
|
405
|
+
static usage = Command3.Usage({
|
|
340
406
|
category: "code-fast",
|
|
341
407
|
description: "Add agent files (CLAUDE.md, AGENTS.md, tasks/) to the current project.",
|
|
342
408
|
examples: [
|
|
@@ -344,21 +410,21 @@ var CodeFastInitCommand = class extends Command {
|
|
|
344
410
|
["Preview without writing", "mokout code-fast init --dry-run"]
|
|
345
411
|
]
|
|
346
412
|
});
|
|
347
|
-
dryRun =
|
|
413
|
+
dryRun = Option2.Boolean("--dry-run", false, {
|
|
348
414
|
description: "Print what would be created without writing anything"
|
|
349
415
|
});
|
|
350
416
|
async execute() {
|
|
351
417
|
const cwd = process.cwd();
|
|
352
|
-
|
|
418
|
+
p2.intro("mokout code-fast init");
|
|
353
419
|
const files = agentFiles();
|
|
354
420
|
const paths = [...new Set(files.map((f) => f.path))];
|
|
355
421
|
const links = SYMLINKS.map((l) => `${l.path} -> ${l.target}`);
|
|
356
422
|
if (this.dryRun) {
|
|
357
|
-
|
|
358
|
-
|
|
423
|
+
p2.note([...paths, ...links].join("\n"), "Would create");
|
|
424
|
+
p2.outro("Dry run \u2014 nothing written.");
|
|
359
425
|
return 0;
|
|
360
426
|
}
|
|
361
|
-
const s =
|
|
427
|
+
const s = p2.spinner();
|
|
362
428
|
s.start("Adding agent files");
|
|
363
429
|
const plop = await nodePlop(void 0, { destBasePath: cwd, force: false });
|
|
364
430
|
registerGenerator(plop, {
|
|
@@ -369,22 +435,22 @@ var CodeFastInitCommand = class extends Command {
|
|
|
369
435
|
});
|
|
370
436
|
await plop.getGenerator("code-fast-init").runActions({});
|
|
371
437
|
s.stop("Agent files added");
|
|
372
|
-
|
|
373
|
-
|
|
438
|
+
p2.note([...paths.map((f) => `\u2022 ${f}`), ...links.map((l) => `\u2022 ${l}`)].join("\n"), "Added");
|
|
439
|
+
p2.outro("Done. CLAUDE.md holds the doctrine; AGENTS.md mirrors it for other agents.");
|
|
374
440
|
return 0;
|
|
375
441
|
}
|
|
376
442
|
};
|
|
377
443
|
|
|
378
444
|
// src/commands/init.ts
|
|
379
|
-
import * as
|
|
380
|
-
import { Command as
|
|
445
|
+
import * as p3 from "@clack/prompts";
|
|
446
|
+
import { Command as Command4, Option as Option3 } from "clipanion";
|
|
381
447
|
import nodePlop2 from "node-plop";
|
|
382
448
|
var UV_BOILERPLATE = ["hello.py", "main.py", "README.md"];
|
|
383
449
|
var PY_DEV_DEPS = ["pytest", "ruff", "pyrefly"];
|
|
384
450
|
var JS_DEV_DEPS = ["@biomejs/biome"];
|
|
385
|
-
var InitCommand = class extends
|
|
451
|
+
var InitCommand = class extends Command4 {
|
|
386
452
|
static paths = [["project", "init"]];
|
|
387
|
-
static usage =
|
|
453
|
+
static usage = Command4.Usage({
|
|
388
454
|
description: "Scaffold an agentic AI project: uv/npm, CLAUDE.md, and modern tooling.",
|
|
389
455
|
examples: [
|
|
390
456
|
["Interactive (asks for stack)", "mokout project init"],
|
|
@@ -393,19 +459,19 @@ var InitCommand = class extends Command2 {
|
|
|
393
459
|
["Preview without writing", "mokout project init --dry-run"]
|
|
394
460
|
]
|
|
395
461
|
});
|
|
396
|
-
js =
|
|
397
|
-
python =
|
|
462
|
+
js = Option3.Boolean("--js", false, { description: "Scaffold a Node/JS project" });
|
|
463
|
+
python = Option3.Boolean("--python", false, {
|
|
398
464
|
description: "Scaffold a Python project (default)"
|
|
399
465
|
});
|
|
400
|
-
dryRun =
|
|
466
|
+
dryRun = Option3.Boolean("--dry-run", false, {
|
|
401
467
|
description: "Print what would be created without writing anything"
|
|
402
468
|
});
|
|
403
469
|
async execute() {
|
|
404
470
|
const cwd = process.cwd();
|
|
405
|
-
|
|
471
|
+
p3.intro("mokout project init");
|
|
406
472
|
const stack = await this.resolveStack();
|
|
407
473
|
if (stack === null) {
|
|
408
|
-
|
|
474
|
+
p3.cancel("Cancelled.");
|
|
409
475
|
return 1;
|
|
410
476
|
}
|
|
411
477
|
const files = filesFor(stack);
|
|
@@ -413,19 +479,19 @@ var InitCommand = class extends Command2 {
|
|
|
413
479
|
const links = SYMLINKS.map((l) => `${l.path} -> ${l.target}`);
|
|
414
480
|
const steps = stack === "javascript" ? ["npm init -y", `npm install --save-dev ${JS_DEV_DEPS.join(" ")}`] : ["uv init", `uv add --dev ${PY_DEV_DEPS.join(" ")}`];
|
|
415
481
|
if (this.dryRun) {
|
|
416
|
-
|
|
417
|
-
|
|
482
|
+
p3.note(["git init", ...steps, ...paths, ...links].join("\n"), "Would create");
|
|
483
|
+
p3.outro("Dry run \u2014 nothing written.");
|
|
418
484
|
return 0;
|
|
419
485
|
}
|
|
420
486
|
if (!exists(cwd, ".git")) run("git", ["init", "-q"], cwd);
|
|
421
487
|
if (stack === "javascript") {
|
|
422
488
|
if (!exists(cwd, "package.json")) {
|
|
423
489
|
if (!hasCommand("npm")) {
|
|
424
|
-
|
|
490
|
+
p3.cancel("npm not found on PATH.");
|
|
425
491
|
return 1;
|
|
426
492
|
}
|
|
427
493
|
run("npm", ["init", "-y"], cwd);
|
|
428
|
-
const dep =
|
|
494
|
+
const dep = p3.spinner();
|
|
429
495
|
dep.start(`Adding dev dependencies (${JS_DEV_DEPS.join(", ")})`);
|
|
430
496
|
try {
|
|
431
497
|
run("npm", ["install", "--save-dev", ...JS_DEV_DEPS], cwd);
|
|
@@ -438,7 +504,7 @@ var InitCommand = class extends Command2 {
|
|
|
438
504
|
}
|
|
439
505
|
} else if (!exists(cwd, "pyproject.toml")) {
|
|
440
506
|
if (!hasCommand("uv")) {
|
|
441
|
-
|
|
507
|
+
p3.cancel("uv not found on PATH \u2014 install from https://docs.astral.sh/uv/");
|
|
442
508
|
return 1;
|
|
443
509
|
}
|
|
444
510
|
const preexisting = UV_BOILERPLATE.filter((f) => exists(cwd, f));
|
|
@@ -446,7 +512,7 @@ var InitCommand = class extends Command2 {
|
|
|
446
512
|
for (const f of UV_BOILERPLATE) {
|
|
447
513
|
if (!preexisting.includes(f)) remove(cwd, f);
|
|
448
514
|
}
|
|
449
|
-
const dep =
|
|
515
|
+
const dep = p3.spinner();
|
|
450
516
|
dep.start(`Adding dev dependencies (${PY_DEV_DEPS.join(", ")})`);
|
|
451
517
|
try {
|
|
452
518
|
run("uv", ["add", "--dev", ...PY_DEV_DEPS], cwd);
|
|
@@ -460,7 +526,7 @@ var InitCommand = class extends Command2 {
|
|
|
460
526
|
${RUFF_PYPROJECT}`);
|
|
461
527
|
}
|
|
462
528
|
}
|
|
463
|
-
const s =
|
|
529
|
+
const s = p3.spinner();
|
|
464
530
|
s.start("Writing project files");
|
|
465
531
|
const plop = await nodePlop2(void 0, { destBasePath: cwd, force: false });
|
|
466
532
|
registerGenerator(plop, {
|
|
@@ -471,11 +537,11 @@ ${RUFF_PYPROJECT}`);
|
|
|
471
537
|
});
|
|
472
538
|
await plop.getGenerator("init").runActions({});
|
|
473
539
|
s.stop("Files written");
|
|
474
|
-
|
|
540
|
+
p3.note(
|
|
475
541
|
[...paths.map((f) => `\u2022 ${f}`), ...links.map((l) => `\u2022 ${l}`)].join("\n"),
|
|
476
542
|
`Scaffolded (${stack})`
|
|
477
543
|
);
|
|
478
|
-
|
|
544
|
+
p3.outro("Done. CLAUDE.md lists the project commands; AGENTS.md mirrors it.");
|
|
479
545
|
return 0;
|
|
480
546
|
}
|
|
481
547
|
/** Resolve the stack from flags, else prompt. Returns null if the user cancels. */
|
|
@@ -483,7 +549,7 @@ ${RUFF_PYPROJECT}`);
|
|
|
483
549
|
if (this.js) return "javascript";
|
|
484
550
|
if (this.python) return "python";
|
|
485
551
|
if (!process.stdin.isTTY) return "python";
|
|
486
|
-
const choice = await
|
|
552
|
+
const choice = await p3.select({
|
|
487
553
|
message: "Project stack?",
|
|
488
554
|
initialValue: "python",
|
|
489
555
|
options: [
|
|
@@ -491,7 +557,7 @@ ${RUFF_PYPROJECT}`);
|
|
|
491
557
|
{ value: "javascript", label: "JavaScript", hint: "npm + biome" }
|
|
492
558
|
]
|
|
493
559
|
});
|
|
494
|
-
return
|
|
560
|
+
return p3.isCancel(choice) ? null : choice;
|
|
495
561
|
}
|
|
496
562
|
};
|
|
497
563
|
|
|
@@ -503,6 +569,8 @@ var cli = new Cli({
|
|
|
503
569
|
});
|
|
504
570
|
cli.register(InitCommand);
|
|
505
571
|
cli.register(CodeFastInitCommand);
|
|
572
|
+
cli.register(AgentInitCommand);
|
|
573
|
+
cli.register(AgentsCommand);
|
|
506
574
|
cli.register(Builtins.HelpCommand);
|
|
507
575
|
cli.register(Builtins.VersionCommand);
|
|
508
576
|
cli.runExit(process.argv.slice(2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mokout-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Quick scaffolding for agentic AI projects — uv/npm, Claude-ready CLAUDE.md, and modern tooling in one command.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"typecheck": "tsc --noEmit",
|
|
24
24
|
"lint": "biome check .",
|
|
25
25
|
"format": "biome check --write .",
|
|
26
|
-
"prepublishOnly": "npm run build"
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"postinstall": "uv tool install google-agents-cli"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@clack/prompts": "^0.7.0",
|