@contextforge/cli 0.1.6 → 0.1.8
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/dist/index.js +9 -25
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -128,14 +128,13 @@ async function doctorCommand(options = {}) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// src/commands/init.ts
|
|
131
|
-
import {
|
|
131
|
+
import { select } from "@inquirer/prompts";
|
|
132
132
|
import {
|
|
133
133
|
DEFAULT_CORE_PACKS,
|
|
134
134
|
DEFAULT_TOOLS,
|
|
135
135
|
createConfig,
|
|
136
136
|
detectProject,
|
|
137
137
|
fetchRegistry as fetchRegistry2,
|
|
138
|
-
installPack,
|
|
139
138
|
missingMandatoryCorePacks,
|
|
140
139
|
recommendPacks,
|
|
141
140
|
syncProject
|
|
@@ -155,29 +154,17 @@ async function selectTools() {
|
|
|
155
154
|
if (!canPrompt()) {
|
|
156
155
|
return DEFAULT_TOOLS;
|
|
157
156
|
}
|
|
158
|
-
const selected = await
|
|
157
|
+
const selected = await select({
|
|
159
158
|
message: "Which AI tools should ContextForge configure?",
|
|
160
|
-
required: true,
|
|
161
159
|
choices: [
|
|
162
|
-
{ name: "All agents", value: "all"
|
|
160
|
+
{ name: "All agents", value: "all" },
|
|
163
161
|
...DEFAULT_TOOLS.map((tool) => ({
|
|
164
|
-
name: TOOL_LABELS[tool]
|
|
165
|
-
value: tool
|
|
166
|
-
checked: false
|
|
162
|
+
name: `${TOOL_LABELS[tool]} only`,
|
|
163
|
+
value: tool
|
|
167
164
|
}))
|
|
168
165
|
]
|
|
169
166
|
});
|
|
170
|
-
return selected
|
|
171
|
-
}
|
|
172
|
-
function printRecommendedAddCommands(recommended) {
|
|
173
|
-
if (recommended.length === 0) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
console.log("");
|
|
177
|
-
console.log(pc3.bold("Recommended packs:"));
|
|
178
|
-
for (const pack of recommended) {
|
|
179
|
-
console.log(`npx @contextforge/cli add ${pack.name}`);
|
|
180
|
-
}
|
|
167
|
+
return selected === "all" ? DEFAULT_TOOLS : [selected];
|
|
181
168
|
}
|
|
182
169
|
async function initCommand(options = {}) {
|
|
183
170
|
const root = process.cwd();
|
|
@@ -195,12 +182,10 @@ async function initCommand(options = {}) {
|
|
|
195
182
|
const tools = await selectTools();
|
|
196
183
|
const packNames = [
|
|
197
184
|
.../* @__PURE__ */ new Set([
|
|
198
|
-
...DEFAULT_CORE_PACKS.filter((packName) => registry.packs.some((pack) => pack.name === packName))
|
|
185
|
+
...DEFAULT_CORE_PACKS.filter((packName) => registry.packs.some((pack) => pack.name === packName)),
|
|
186
|
+
...recommended.map((pack) => pack.name)
|
|
199
187
|
])
|
|
200
188
|
];
|
|
201
|
-
for (const packName of packNames) {
|
|
202
|
-
await installPack(root, registryUrl, packName, { force: true });
|
|
203
|
-
}
|
|
204
189
|
const initialConfig = createConfig(
|
|
205
190
|
analysis,
|
|
206
191
|
packNames.map((name) => ({ name })),
|
|
@@ -210,7 +195,6 @@ async function initCommand(options = {}) {
|
|
|
210
195
|
const result = await syncProject(root, initialConfig);
|
|
211
196
|
console.log(pc3.green("ContextForge initialized."));
|
|
212
197
|
console.log(formatGeneratedFiles(result.generatedFiles));
|
|
213
|
-
printRecommendedAddCommands(recommended);
|
|
214
198
|
}
|
|
215
199
|
|
|
216
200
|
// src/commands/list.ts
|
|
@@ -280,7 +264,7 @@ async function syncCommand(options = {}) {
|
|
|
280
264
|
|
|
281
265
|
// src/index.ts
|
|
282
266
|
var program = new Command();
|
|
283
|
-
program.name("contextforge").description("Make existing codebases AI-agent ready").version("0.1.
|
|
267
|
+
program.name("contextforge").description("Make existing codebases AI-agent ready").version("0.1.8");
|
|
284
268
|
program.command("init").description("Initialize AI-agent instructions").option("--registry <url>", "Static remote registry index URL", collectRegistryOption, []).action(initCommand);
|
|
285
269
|
program.command("add").argument("<pack>").description("Add an instruction pack").option("--registry <url>", "Static remote registry index URL", collectRegistryOption, []).option("--force", "Re-download and regenerate even when the pack is already installed").option("--dry-run", "Show what would be installed without writing files").action(addCommand);
|
|
286
270
|
program.command("sync").description("Sync generated AI instruction files").option("--registry <url>", "Static remote registry index URL", collectRegistryOption, []).action(syncCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contextforge/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contextforge": "dist/index.js"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"commander": "^14.0.0",
|
|
14
14
|
"ora": "^8.2.0",
|
|
15
15
|
"picocolors": "^1.1.1",
|
|
16
|
-
"@contextforge/core": "0.1.
|
|
16
|
+
"@contextforge/core": "0.1.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsx": "^4.20.0"
|