@kradle/cli 0.2.0 → 0.2.2
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 +42 -13
- package/dist/commands/ai-docs/api.d.ts +6 -0
- package/dist/commands/ai-docs/api.js +13 -0
- package/dist/commands/ai-docs/cli.d.ts +6 -0
- package/dist/commands/ai-docs/cli.js +13 -0
- package/dist/commands/init.js +4 -2
- package/dist/lib/experiment/runner.js +1 -0
- package/oclif.manifest.json +49 -1
- package/package.json +4 -1
- package/static/ai_docs/LLM_API_REFERENCE.md +1468 -0
- package/static/ai_docs/LLM_CLI_REFERENCE.md +669 -0
- package/static/project_template/AGENTS.md +15 -0
- package/static/project_template/CLAUDE.md +1 -0
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- This file is for human consumption. If you are an LLM or any AI Agent, make sure to read static/ai_docs/LLM_CLI_REFERENCE.md for an exhaustive explanation of this package. -->
|
|
2
|
+
|
|
1
3
|
# Kradle CLI
|
|
2
4
|
|
|
3
5
|
Kradle's CLI for managing Minecraft challenges, experiments, agents, and more!
|
|
@@ -8,6 +10,7 @@ Kradle's CLI for managing Minecraft challenges, experiments, agents, and more!
|
|
|
8
10
|
* [Challenge](#challenge-commands)
|
|
9
11
|
* [Experiments](#experiment-commands)
|
|
10
12
|
* [Agents](#agent-commands)
|
|
13
|
+
* [AI Docs](#ai-docs-commands)
|
|
11
14
|
* [Publishing a New Version](#publishing-a-new-version)
|
|
12
15
|
* [Development](#development)
|
|
13
16
|
* [Architecture](#architecture)
|
|
@@ -127,16 +130,6 @@ kradle challenge run <challenge-name>
|
|
|
127
130
|
kradle challenge run <challenge-name> --studio # Run in local studio environment
|
|
128
131
|
```
|
|
129
132
|
|
|
130
|
-
### Multi-Upload
|
|
131
|
-
|
|
132
|
-
Interactively select and upload multiple challenges:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
kradle challenge multi-upload
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Provides an interactive UI to select multiple challenges and uploads them in parallel.
|
|
139
|
-
|
|
140
133
|
## Experiment Commands
|
|
141
134
|
|
|
142
135
|
Experiments allow you to run batches of challenge runs with different agents and configurations, then analyze the results. This is useful for benchmarking agents, testing challenge difficulty, or gathering statistics across many runs.
|
|
@@ -172,9 +165,10 @@ This creates `experiments/<name>/config.ts` with a template that you can customi
|
|
|
172
165
|
Execute or resume an experiment:
|
|
173
166
|
|
|
174
167
|
```bash
|
|
175
|
-
kradle experiment run <name>
|
|
176
|
-
kradle experiment run <name> --new-version
|
|
177
|
-
kradle experiment run <name> --max-concurrent 10
|
|
168
|
+
kradle experiment run <name> # Resume current version or create first one
|
|
169
|
+
kradle experiment run <name> --new-version # Start a new version
|
|
170
|
+
kradle experiment run <name> --max-concurrent 10 # Control parallelism (default: 5)
|
|
171
|
+
kradle experiment run <name> --download-recordings # Auto-download recordings as runs complete
|
|
178
172
|
```
|
|
179
173
|
|
|
180
174
|
The run command:
|
|
@@ -184,6 +178,20 @@ The run command:
|
|
|
184
178
|
4. Saves progress periodically (allows resuming if interrupted)
|
|
185
179
|
5. Opens Metabase dashboard with results when complete
|
|
186
180
|
|
|
181
|
+
### Download Recordings
|
|
182
|
+
|
|
183
|
+
Download gameplay recordings from completed experiment runs:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
kradle experiment recordings <name> # Interactive selection of run and participant
|
|
187
|
+
kradle experiment recordings <name> <run-id> # Download specific run
|
|
188
|
+
kradle experiment recordings <name> --all # Download all runs and participants
|
|
189
|
+
kradle experiment recordings <name> --version 2 # Download from specific version
|
|
190
|
+
kradle experiment recordings <name> <run-id> --all # Download all participants for a run
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Recordings are saved to `experiments/<name>/versions/<version>/recordings/<run-id>/`.
|
|
194
|
+
|
|
187
195
|
### List Experiments
|
|
188
196
|
|
|
189
197
|
List all local experiments:
|
|
@@ -202,6 +210,26 @@ List all agents registered in the system:
|
|
|
202
210
|
kradle agent list
|
|
203
211
|
```
|
|
204
212
|
|
|
213
|
+
## AI Docs Commands
|
|
214
|
+
|
|
215
|
+
Output LLM-focused documentation to stdout. These commands are designed to provide AI agents with comprehensive reference material about the Kradle CLI and API.
|
|
216
|
+
|
|
217
|
+
### CLI Reference
|
|
218
|
+
|
|
219
|
+
Output the CLI reference documentation:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
kradle ai-docs cli
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### API Reference
|
|
226
|
+
|
|
227
|
+
Output the API reference documentation for the `@kradle/challenges` package:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
kradle ai-docs api
|
|
231
|
+
```
|
|
232
|
+
|
|
205
233
|
## Publishing a New Version
|
|
206
234
|
|
|
207
235
|
The CLI uses GitHub Actions for automated releases. To publish a new version:
|
|
@@ -303,6 +331,7 @@ kradle-cli/
|
|
|
303
331
|
├── src/
|
|
304
332
|
│ ├── commands/ # CLI commands
|
|
305
333
|
│ │ ├── agent/ # Agent commands
|
|
334
|
+
│ │ ├── ai-docs/ # AI documentation commands
|
|
306
335
|
│ │ ├── challenge/ # Challenge management commands
|
|
307
336
|
│ │ └── experiment/ # Experiment commands
|
|
308
337
|
│ └── lib/ # Core libraries
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { Command } from "@oclif/core";
|
|
3
|
+
import { getStaticResourcePath } from "../../lib/utils.js";
|
|
4
|
+
export default class Api extends Command {
|
|
5
|
+
static description = "Output the Kradle API reference documentation for LLMs";
|
|
6
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
7
|
+
async run() {
|
|
8
|
+
await this.parse(Api);
|
|
9
|
+
const docPath = getStaticResourcePath("ai_docs/LLM_API_REFERENCE.md");
|
|
10
|
+
const content = await fs.readFile(docPath, "utf-8");
|
|
11
|
+
this.log(content);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { Command } from "@oclif/core";
|
|
3
|
+
import { getStaticResourcePath } from "../../lib/utils.js";
|
|
4
|
+
export default class Cli extends Command {
|
|
5
|
+
static description = "Output the Kradle CLI reference documentation for LLMs";
|
|
6
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
7
|
+
async run() {
|
|
8
|
+
await this.parse(Cli);
|
|
9
|
+
const docPath = getStaticResourcePath("ai_docs/LLM_CLI_REFERENCE.md");
|
|
10
|
+
const content = await fs.readFile(docPath, "utf-8");
|
|
11
|
+
this.log(content);
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/commands/init.js
CHANGED
|
@@ -104,13 +104,15 @@ export default class Init extends Command {
|
|
|
104
104
|
const templateDir = getStaticResourcePath("project_template");
|
|
105
105
|
const templateFiles = await readDirSorted(templateDir);
|
|
106
106
|
for (const file of templateFiles) {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// We ignore .env as it will be created later
|
|
108
|
+
if (file.name.endsWith(".env") || file.isDirectory()) {
|
|
109
109
|
continue;
|
|
110
110
|
}
|
|
111
111
|
const srcPath = path.join(file.parentPath, file.name);
|
|
112
112
|
const srcRelativePath = path.relative(templateDir, srcPath);
|
|
113
113
|
const destPath = path.join(targetDir, srcRelativePath);
|
|
114
|
+
// Ensure the destination directory exists before copying the file
|
|
115
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
114
116
|
await fs.copyFile(srcPath, destPath);
|
|
115
117
|
}
|
|
116
118
|
// Create .env file based on the environment
|
|
@@ -44,6 +44,7 @@ export class Runner {
|
|
|
44
44
|
const state = this.states[entry.index];
|
|
45
45
|
state.status = entry.status;
|
|
46
46
|
state.runId = entry.runId;
|
|
47
|
+
state.participantIds = entry.participantIds;
|
|
47
48
|
state.startTime = entry.startTime;
|
|
48
49
|
if (entry.status === "completed" || entry.status === "finished" || entry.status === "game_over") {
|
|
49
50
|
this.completedRuns.add(entry.index);
|
package/oclif.manifest.json
CHANGED
|
@@ -86,6 +86,54 @@
|
|
|
86
86
|
"list.js"
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
|
+
"ai-docs:api": {
|
|
90
|
+
"aliases": [],
|
|
91
|
+
"args": {},
|
|
92
|
+
"description": "Output the Kradle API reference documentation for LLMs",
|
|
93
|
+
"examples": [
|
|
94
|
+
"<%= config.bin %> <%= command.id %>"
|
|
95
|
+
],
|
|
96
|
+
"flags": {},
|
|
97
|
+
"hasDynamicHelp": false,
|
|
98
|
+
"hiddenAliases": [],
|
|
99
|
+
"id": "ai-docs:api",
|
|
100
|
+
"pluginAlias": "@kradle/cli",
|
|
101
|
+
"pluginName": "@kradle/cli",
|
|
102
|
+
"pluginType": "core",
|
|
103
|
+
"strict": true,
|
|
104
|
+
"enableJsonFlag": false,
|
|
105
|
+
"isESM": true,
|
|
106
|
+
"relativePath": [
|
|
107
|
+
"dist",
|
|
108
|
+
"commands",
|
|
109
|
+
"ai-docs",
|
|
110
|
+
"api.js"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"ai-docs:cli": {
|
|
114
|
+
"aliases": [],
|
|
115
|
+
"args": {},
|
|
116
|
+
"description": "Output the Kradle CLI reference documentation for LLMs",
|
|
117
|
+
"examples": [
|
|
118
|
+
"<%= config.bin %> <%= command.id %>"
|
|
119
|
+
],
|
|
120
|
+
"flags": {},
|
|
121
|
+
"hasDynamicHelp": false,
|
|
122
|
+
"hiddenAliases": [],
|
|
123
|
+
"id": "ai-docs:cli",
|
|
124
|
+
"pluginAlias": "@kradle/cli",
|
|
125
|
+
"pluginName": "@kradle/cli",
|
|
126
|
+
"pluginType": "core",
|
|
127
|
+
"strict": true,
|
|
128
|
+
"enableJsonFlag": false,
|
|
129
|
+
"isESM": true,
|
|
130
|
+
"relativePath": [
|
|
131
|
+
"dist",
|
|
132
|
+
"commands",
|
|
133
|
+
"ai-docs",
|
|
134
|
+
"cli.js"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
89
137
|
"challenge:build": {
|
|
90
138
|
"aliases": [],
|
|
91
139
|
"args": {
|
|
@@ -760,5 +808,5 @@
|
|
|
760
808
|
]
|
|
761
809
|
}
|
|
762
810
|
},
|
|
763
|
-
"version": "0.2.
|
|
811
|
+
"version": "0.2.2"
|
|
764
812
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kradle/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Kradle's CLI. Manage challenges, experiments, agents and more!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli"
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
},
|
|
82
82
|
"experiment": {
|
|
83
83
|
"description": "Manage and run experiments"
|
|
84
|
+
},
|
|
85
|
+
"ai-docs": {
|
|
86
|
+
"description": "Output LLM reference documentation"
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
}
|