@context-forge/cli 0.10.6 → 0.11.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/dist/commands/build.d.ts +0 -21
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +0 -60
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +8 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/setup-ide.d.ts +42 -6
- package/dist/commands/setup-ide.d.ts.map +1 -1
- package/dist/commands/setup-ide.js +131 -143
- package/dist/commands/setup-ide.js.map +1 -1
- package/package.json +2 -2
package/dist/commands/build.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
interface BuildAndPrintOpts {
|
|
3
|
-
project?: string;
|
|
4
|
-
phase?: string;
|
|
5
|
-
slice?: string;
|
|
6
|
-
json?: boolean;
|
|
7
|
-
embed?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Core build logic: resolves project, generates context.
|
|
11
|
-
*
|
|
12
|
-
* Output modes:
|
|
13
|
-
* - `--json`: JSON object to stdout with project, phase, and context fields
|
|
14
|
-
* - bare CLI: help message to stderr, nothing to stdout
|
|
15
|
-
*
|
|
16
|
-
* Slash commands call the CLI, which outputs to stdout — the slash command
|
|
17
|
-
* wrapper captures and frames it as working context. Since bare CLI now shows
|
|
18
|
-
* a help message instead of raw prompt, slash commands use `--json` implicitly
|
|
19
|
-
* (the `!` backtick syntax in the .md file captures stdout).
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildAndPrint(opts: BuildAndPrintOpts): Promise<void>;
|
|
22
2
|
export declare function registerBuildCommand(program: Command): void;
|
|
23
|
-
export {};
|
|
24
3
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqF3D"}
|
package/dist/commands/build.js
CHANGED
|
@@ -5,66 +5,6 @@ import { resolveProjectWorktree } from '../utils/project.js';
|
|
|
5
5
|
import { withJsonOption, withProjectOption } from '../options.js';
|
|
6
6
|
import { handleError, UserError } from '../utils/errors.js';
|
|
7
7
|
import { printJson } from '../output/formatter.js';
|
|
8
|
-
/**
|
|
9
|
-
* Core build logic: resolves project, generates context.
|
|
10
|
-
*
|
|
11
|
-
* Output modes:
|
|
12
|
-
* - `--json`: JSON object to stdout with project, phase, and context fields
|
|
13
|
-
* - bare CLI: help message to stderr, nothing to stdout
|
|
14
|
-
*
|
|
15
|
-
* Slash commands call the CLI, which outputs to stdout — the slash command
|
|
16
|
-
* wrapper captures and frames it as working context. Since bare CLI now shows
|
|
17
|
-
* a help message instead of raw prompt, slash commands use `--json` implicitly
|
|
18
|
-
* (the `!` backtick syntax in the .md file captures stdout).
|
|
19
|
-
*/
|
|
20
|
-
export async function buildAndPrint(opts) {
|
|
21
|
-
const store = new FileProjectStore();
|
|
22
|
-
const { id, worktreeId } = await resolveProjectWorktree({ project: opts.project }, store);
|
|
23
|
-
const project = await resolveProject(store, id, worktreeId);
|
|
24
|
-
if (!project) {
|
|
25
|
-
throw new UserError(`Project not found: '${id}'.`, 'PROJECT_NOT_FOUND', `Run cf project list to see available projects.`);
|
|
26
|
-
}
|
|
27
|
-
if (!project.projectPath) {
|
|
28
|
-
throw new UserError(`Project '${project.name}' has no projectPath configured.`, 'MISSING_CONFIG', `Run: cf project set projectPath /path/to/project`);
|
|
29
|
-
}
|
|
30
|
-
// Status message goes to stderr so stdout stays clean for piping
|
|
31
|
-
process.stderr.write(`Building context for ${project.name}...\n`);
|
|
32
|
-
// Apply overrides to a working copy
|
|
33
|
-
const workingCopy = { ...project };
|
|
34
|
-
if (opts.phase) {
|
|
35
|
-
const resolved = resolvePhaseValue(opts.phase);
|
|
36
|
-
if (!resolved) {
|
|
37
|
-
process.stderr.write(`Warning: '${opts.phase}' is not a recognized phase. Use a number (0-7), name (implementation), or shorthand (P6).\n`);
|
|
38
|
-
}
|
|
39
|
-
const phaseValue = resolved ?? opts.phase;
|
|
40
|
-
workingCopy.developmentPhase = phaseValue;
|
|
41
|
-
workingCopy.instruction = phaseValue;
|
|
42
|
-
}
|
|
43
|
-
if (opts.slice)
|
|
44
|
-
workingCopy.fileSlice = opts.slice;
|
|
45
|
-
const { integrator } = createContextPipeline(workingCopy.projectPath);
|
|
46
|
-
let contextString = await integrator.generateContextFromProject(workingCopy, worktreeId);
|
|
47
|
-
if (opts.embed) {
|
|
48
|
-
contextString = await embedReferencedFiles(workingCopy, workingCopy.projectPath, contextString);
|
|
49
|
-
}
|
|
50
|
-
if (opts.json) {
|
|
51
|
-
// --json mode: structured output to stdout
|
|
52
|
-
printJson({
|
|
53
|
-
project: project.name,
|
|
54
|
-
phase: workingCopy.developmentPhase ?? null,
|
|
55
|
-
context: contextString,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
// Bare CLI: help message to stderr, nothing to stdout
|
|
60
|
-
const sliceInfo = workingCopy.fileSlice ? `, slice ${workingCopy.fileSlice}` : '';
|
|
61
|
-
const phaseInfo = workingCopy.developmentPhase ?? 'no phase set';
|
|
62
|
-
process.stderr.write(`\nContext built for ${project.name} (${phaseInfo}${sliceInfo}).\n\n` +
|
|
63
|
-
`To use this context:\n` +
|
|
64
|
-
` /cf:build — load as working context in Claude Code\n` +
|
|
65
|
-
` cf build --json — output as JSON for pipelines\n`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
8
|
export function registerBuildCommand(program) {
|
|
69
9
|
const buildCmd = program
|
|
70
10
|
.command('build')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAenD,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAC5C,iBAAiB,CAAC,QAAQ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AAY,EAAE,aAAa,CAAC,CAAC;YACnG,CAAC;YAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,SAAS,CAAC;oBACR,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,KAAK,EAAE,WAAW,CAAC,gBAAgB,IAAI,IAAI;oBAC3C,OAAO,EAAE,aAAa;iBACvB,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClF,MAAM,SAAS,GAAG,WAAW,CAAC,gBAAgB,IAAI,cAAc,CAAC;gBACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uBAAuB,OAAO,CAAC,IAAI,KAAK,SAAS,GAAG,SAAS,QAAQ;oBACrE,wBAAwB;oBACxB,mEAAmE;oBACnE,wDAAwD,CACzD,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4DpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4DpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgG1D"}
|
package/dist/commands/init.js
CHANGED
|
@@ -6,7 +6,7 @@ import { buildProjectCreationDefaults } from '@context-forge/core';
|
|
|
6
6
|
import { handleError } from '../utils/errors.js';
|
|
7
7
|
import { success, warn, dim } from '../output/styles.js';
|
|
8
8
|
import { guidesInstallAction } from './guides.js';
|
|
9
|
-
import { setupIdeAction } from './setup-ide.js';
|
|
9
|
+
import { setupIdeAction, normalizeTarget } from './setup-ide.js';
|
|
10
10
|
import { installCommandsAction } from './commandInstaller.js';
|
|
11
11
|
/**
|
|
12
12
|
* Returns true if the cwd is a git worktree whose main worktree is already
|
|
@@ -60,7 +60,7 @@ export function registerInitCommand(program) {
|
|
|
60
60
|
.description('Initialize a Context Forge project in the current directory')
|
|
61
61
|
.option('--name <name>', 'Project name (defaults to directory basename)')
|
|
62
62
|
.option('--lite', 'Create project entry only, skip guides/commands/IDE setup')
|
|
63
|
-
.option('--ide <target>', 'IDE target
|
|
63
|
+
.option('--ide <target>', 'IDE target: claude, copilot, cursor, agents (aliases: openai, codex) (default: claude)')
|
|
64
64
|
.option('--no-ide', 'Skip IDE configuration step')
|
|
65
65
|
.action(async (opts) => {
|
|
66
66
|
try {
|
|
@@ -130,7 +130,12 @@ export function registerInitCommand(program) {
|
|
|
130
130
|
const ideTarget = typeof opts.ide === 'string' ? opts.ide : 'claude';
|
|
131
131
|
try {
|
|
132
132
|
await setupIdeAction(cwd, ideTarget, { yes: true });
|
|
133
|
-
|
|
133
|
+
// normalizeTarget cannot return null here: setupIdeAction just validated
|
|
134
|
+
// this same string and would have thrown otherwise.
|
|
135
|
+
const normalizedIdeTarget = normalizeTarget(ideTarget) ?? ideTarget;
|
|
136
|
+
const wasAlias = ideTarget.trim().toLowerCase() !== normalizedIdeTarget;
|
|
137
|
+
const ideLabel = wasAlias ? `${normalizedIdeTarget} (${ideTarget})` : normalizedIdeTarget;
|
|
138
|
+
console.log(success(`IDE configured for ${ideLabel}`));
|
|
134
139
|
}
|
|
135
140
|
catch (err) {
|
|
136
141
|
console.log(warn(`IDE setup failed: ${err.message}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;GAGG;AACH,SAAS,eAAe,CAAC,GAAW,EAAE,eAAyB;IAC7D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,CAAC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wBACpE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,mBAAmB,CAAC;wBACxE,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,mBAAmB,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC;wBAC1F,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC,CAAC;oBACzD,CAAC;oBAAC,OAAO,GAAG,EAAE,CAAC;wBACb,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAsB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACnF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,15 +1,51 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
import type { ProjectData } from '@context-forge/core';
|
|
3
|
+
export type Target = 'claude' | 'copilot' | 'cursor' | 'agents';
|
|
4
|
+
export interface TargetDescriptor {
|
|
5
|
+
/** Files probed for the managed marker; also the files backed up before overwrite. */
|
|
6
|
+
markerFiles: string[];
|
|
7
|
+
/** Directories copied to worktrees, recursively. */
|
|
8
|
+
propagateDirs: string[];
|
|
9
|
+
/** Label used in prompts and completion messages. */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
13
|
+
* One definition per target drives validation, the managed-marker check, backup,
|
|
14
|
+
* and worktree propagation. The `Record<Target, TargetDescriptor>` annotation makes
|
|
15
|
+
* the compiler reject a target added to the `Target` union without an entry here.
|
|
8
16
|
*/
|
|
9
|
-
export declare
|
|
17
|
+
export declare const TARGETS: Record<Target, TargetDescriptor>;
|
|
18
|
+
/** Aliases resolved to a canonical target before anything downstream sees the input. */
|
|
19
|
+
export declare const TARGET_ALIASES: Record<string, Target>;
|
|
20
|
+
/** Resolves a target string (case/whitespace-insensitive) to its canonical form, or null if unknown. */
|
|
21
|
+
export declare function normalizeTarget(input: string): Target | null;
|
|
22
|
+
/** Built from TARGETS/TARGET_ALIASES so the message can never drift from what normalizeTarget accepts. */
|
|
23
|
+
export declare function invalidTargetMessage(input: string): string;
|
|
24
|
+
export declare const MANAGED_MARKER = "[//]: # (context-forge:managed)";
|
|
25
|
+
/**
|
|
26
|
+
* Returns true if any of the given (root-relative, `/`-separated) files exists
|
|
27
|
+
* and carries the managed marker in its first 20 lines. Returns false when none
|
|
28
|
+
* of the listed files exists (new install).
|
|
29
|
+
*/
|
|
30
|
+
export declare function isManagedInstall(projectPath: string, markerFiles: string[]): boolean;
|
|
10
31
|
/** Run IDE setup for a project. Errors propagate to the caller. */
|
|
11
32
|
export declare function setupIdeAction(projectPath: string, target: string, opts?: {
|
|
12
33
|
yes?: boolean;
|
|
13
34
|
}): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Propagate IDE-generated files from the project root to all registered worktrees.
|
|
37
|
+
*
|
|
38
|
+
* The setup-ide script always writes to the project root (its find_project_root()
|
|
39
|
+
* walks up to the nearest directory containing project-documents/, which is always
|
|
40
|
+
* the root). Worktrees share the same guides submodule source but have independent
|
|
41
|
+
* working trees, so without propagation their compiled IDE files go stale after
|
|
42
|
+
* every root setup-ide run.
|
|
43
|
+
*
|
|
44
|
+
* Descriptor-driven: each target's `markerFiles` and `propagateDirs` (see TARGETS)
|
|
45
|
+
* define exactly what is copied. `.claude/settings.local.json` and `.claude/worktrees/`
|
|
46
|
+
* stay out because neither appears in any target's `propagateDirs` — the former is
|
|
47
|
+
* worktree-specific, the latter is the cf worktree registry and root-only.
|
|
48
|
+
*/
|
|
49
|
+
export declare function propagateToWorktrees(project: ProjectData, target: string): void;
|
|
14
50
|
export declare function registerSetupIdeCommand(program: Command): void;
|
|
15
51
|
//# sourceMappingURL=setup-ide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-ide.d.ts","sourceRoot":"","sources":["../../src/commands/setup-ide.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"setup-ide.d.ts","sourceRoot":"","sources":["../../src/commands/setup-ide.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oDAAoD;IACpD,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAqBpD,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAyC,CAAC;AAE5F,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK5D;AAeD,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAaD,eAAO,MAAM,cAAc,oCAAoC,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAYpF;AAED,mEAAmE;AACnE,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GACvB,OAAO,CAAC,IAAI,CAAC,CAwEf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAyC/E;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsC9D"}
|
|
@@ -6,7 +6,60 @@ import { FileProjectStore, GuideDetector, GUIDE_RELATIVE_PATH } from '@context-f
|
|
|
6
6
|
import { resolveProjectId } from '../utils/project.js';
|
|
7
7
|
import { withProjectOption, withYesOption } from '../options.js';
|
|
8
8
|
import { handleError, UserError } from '../utils/errors.js';
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* One definition per target drives validation, the managed-marker check, backup,
|
|
11
|
+
* and worktree propagation. The `Record<Target, TargetDescriptor>` annotation makes
|
|
12
|
+
* the compiler reject a target added to the `Target` union without an entry here.
|
|
13
|
+
*/
|
|
14
|
+
export const TARGETS = {
|
|
15
|
+
claude: {
|
|
16
|
+
markerFiles: ['CLAUDE.md'],
|
|
17
|
+
propagateDirs: ['.claude/rules', '.claude/agents', '.claude/skills'],
|
|
18
|
+
label: 'Claude Code',
|
|
19
|
+
},
|
|
20
|
+
copilot: {
|
|
21
|
+
markerFiles: ['.github/copilot-instructions.md', 'AGENTS.md'],
|
|
22
|
+
propagateDirs: ['.github/instructions', '.github/prompts'],
|
|
23
|
+
label: 'GitHub Copilot',
|
|
24
|
+
},
|
|
25
|
+
cursor: {
|
|
26
|
+
markerFiles: ['AGENTS.md'],
|
|
27
|
+
propagateDirs: ['.cursor/rules'],
|
|
28
|
+
label: 'Cursor',
|
|
29
|
+
},
|
|
30
|
+
agents: {
|
|
31
|
+
markerFiles: ['AGENTS.md'],
|
|
32
|
+
propagateDirs: ['.agents/skills'],
|
|
33
|
+
label: 'agents',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
/** Aliases resolved to a canonical target before anything downstream sees the input. */
|
|
37
|
+
export const TARGET_ALIASES = { openai: 'agents', codex: 'agents' };
|
|
38
|
+
/** Resolves a target string (case/whitespace-insensitive) to its canonical form, or null if unknown. */
|
|
39
|
+
export function normalizeTarget(input) {
|
|
40
|
+
const normalized = input.trim().toLowerCase();
|
|
41
|
+
if (normalized in TARGETS)
|
|
42
|
+
return normalized;
|
|
43
|
+
if (normalized in TARGET_ALIASES)
|
|
44
|
+
return TARGET_ALIASES[normalized];
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
/** Groups TARGET_ALIASES by canonical target, e.g. "openai, codex → agents". */
|
|
48
|
+
function describeAliases() {
|
|
49
|
+
const byTarget = new Map();
|
|
50
|
+
for (const [alias, target] of Object.entries(TARGET_ALIASES)) {
|
|
51
|
+
const group = byTarget.get(target) ?? [];
|
|
52
|
+
group.push(alias);
|
|
53
|
+
byTarget.set(target, group);
|
|
54
|
+
}
|
|
55
|
+
return Array.from(byTarget.entries())
|
|
56
|
+
.map(([target, aliases]) => `${aliases.join(', ')} → ${target}`)
|
|
57
|
+
.join(', ');
|
|
58
|
+
}
|
|
59
|
+
/** Built from TARGETS/TARGET_ALIASES so the message can never drift from what normalizeTarget accepts. */
|
|
60
|
+
export function invalidTargetMessage(input) {
|
|
61
|
+
return `Invalid target '${input}'. Valid targets: ${Object.keys(TARGETS).join(', ')} (aliases: ${describeAliases()})`;
|
|
62
|
+
}
|
|
10
63
|
/** Prompt user for y/N confirmation via stdin. Returns true if confirmed. */
|
|
11
64
|
function askConfirmation(prompt) {
|
|
12
65
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -17,29 +70,20 @@ function askConfirmation(prompt) {
|
|
|
17
70
|
});
|
|
18
71
|
});
|
|
19
72
|
}
|
|
20
|
-
|
|
21
|
-
export function isManagedClaudeMd(filePath) {
|
|
22
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
23
|
-
const lines = content.split('\n').slice(0, 20);
|
|
24
|
-
return lines.some((line) => line.trim() === '[//]: # (context-forge:managed)');
|
|
25
|
-
}
|
|
26
|
-
const COPILOT_MANAGED_MARKER = '[//]: # (context-forge:managed)';
|
|
73
|
+
export const MANAGED_MARKER = '[//]: # (context-forge:managed)';
|
|
27
74
|
/**
|
|
28
|
-
* Returns true if
|
|
29
|
-
*
|
|
30
|
-
*
|
|
75
|
+
* Returns true if any of the given (root-relative, `/`-separated) files exists
|
|
76
|
+
* and carries the managed marker in its first 20 lines. Returns false when none
|
|
77
|
+
* of the listed files exists (new install).
|
|
31
78
|
*/
|
|
32
|
-
export function
|
|
33
|
-
const
|
|
34
|
-
path.join(projectPath,
|
|
35
|
-
path.join(projectPath, 'AGENTS.md'),
|
|
36
|
-
];
|
|
37
|
-
for (const filePath of filesToCheck) {
|
|
79
|
+
export function isManagedInstall(projectPath, markerFiles) {
|
|
80
|
+
for (const relPath of markerFiles) {
|
|
81
|
+
const filePath = path.join(projectPath, ...relPath.split('/'));
|
|
38
82
|
if (!fs.existsSync(filePath))
|
|
39
83
|
continue;
|
|
40
84
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
41
85
|
const lines = content.split('\n').slice(0, 20);
|
|
42
|
-
if (lines.some((line) => line.trim() ===
|
|
86
|
+
if (lines.some((line) => line.trim() === MANAGED_MARKER)) {
|
|
43
87
|
return true;
|
|
44
88
|
}
|
|
45
89
|
}
|
|
@@ -47,9 +91,10 @@ export function isManagedCopilotFiles(projectPath) {
|
|
|
47
91
|
}
|
|
48
92
|
/** Run IDE setup for a project. Errors propagate to the caller. */
|
|
49
93
|
export async function setupIdeAction(projectPath, target, opts) {
|
|
50
|
-
// Validate target
|
|
51
|
-
|
|
52
|
-
|
|
94
|
+
// Validate and normalize target — everything downstream uses the canonical value
|
|
95
|
+
const normalizedTarget = normalizeTarget(target);
|
|
96
|
+
if (!normalizedTarget) {
|
|
97
|
+
throw new UserError(invalidTargetMessage(target));
|
|
53
98
|
}
|
|
54
99
|
// Check guide installation
|
|
55
100
|
const detector = new GuideDetector();
|
|
@@ -63,71 +108,37 @@ export async function setupIdeAction(projectPath, target, opts) {
|
|
|
63
108
|
if (!fs.existsSync(scriptPath)) {
|
|
64
109
|
throw new UserError(`setup-ide script not found at ${scriptPath}. Your guides installation may be incomplete — try 'cf guides update'.`);
|
|
65
110
|
}
|
|
66
|
-
//
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const confirmed = await askConfirmation('Continue? (y/N) ');
|
|
79
|
-
if (!confirmed) {
|
|
80
|
-
console.error('Aborted.');
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (!fs.existsSync(claudeMdBakPath)) {
|
|
85
|
-
fs.copyFileSync(claudeMdPath, claudeMdBakPath);
|
|
86
|
-
console.log('Backed up CLAUDE.md → CLAUDE.md.bak');
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
console.log('existing backup preserved at CLAUDE.md.bak');
|
|
111
|
+
// Safety check — descriptor-driven, identical shape for every target
|
|
112
|
+
const descriptor = TARGETS[normalizedTarget];
|
|
113
|
+
const markerPaths = descriptor.markerFiles.map((rel) => path.join(projectPath, ...rel.split('/')));
|
|
114
|
+
if (!isManagedInstall(projectPath, descriptor.markerFiles)) {
|
|
115
|
+
const existingPaths = markerPaths.filter((p) => fs.existsSync(p));
|
|
116
|
+
if (existingPaths.length > 0) {
|
|
117
|
+
if (!opts?.yes) {
|
|
118
|
+
console.error(`Warning: ${descriptor.label} IDE files already exist and will be overwritten.`);
|
|
119
|
+
const confirmed = await askConfirmation('Continue? (y/N) ');
|
|
120
|
+
if (!confirmed) {
|
|
121
|
+
console.error('Aborted.');
|
|
122
|
+
return;
|
|
90
123
|
}
|
|
91
124
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const copilotInstructionsPath = path.join(projectPath, '.github', 'copilot-instructions.md');
|
|
98
|
-
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
99
|
-
const eitherExists = fs.existsSync(copilotInstructionsPath) || fs.existsSync(agentsMdPath);
|
|
100
|
-
if (eitherExists) {
|
|
101
|
-
if (!opts?.yes) {
|
|
102
|
-
console.error('Warning: Copilot IDE files already exist and will be overwritten.');
|
|
103
|
-
const confirmed = await askConfirmation('Continue? (y/N) ');
|
|
104
|
-
if (!confirmed) {
|
|
105
|
-
console.error('Aborted.');
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
125
|
+
for (const filePath of existingPaths) {
|
|
126
|
+
const bakPath = `${filePath}.bak`;
|
|
127
|
+
if (!fs.existsSync(bakPath)) {
|
|
128
|
+
fs.copyFileSync(filePath, bakPath);
|
|
129
|
+
console.log(`Backed up ${path.relative(projectPath, filePath)} → ${path.relative(projectPath, bakPath)}`);
|
|
108
130
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
[copilotInstructionsPath, `${copilotInstructionsPath}.bak`],
|
|
112
|
-
[agentsMdPath, `${agentsMdPath}.bak`],
|
|
113
|
-
]) {
|
|
114
|
-
if (fs.existsSync(src)) {
|
|
115
|
-
if (!fs.existsSync(bak)) {
|
|
116
|
-
fs.copyFileSync(src, bak);
|
|
117
|
-
console.log(`Backed up ${path.relative(projectPath, src)} → ${path.relative(projectPath, bak)}`);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
console.log(`existing backup preserved at ${path.relative(projectPath, bak)}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
131
|
+
else {
|
|
132
|
+
console.log(`existing backup preserved at ${path.relative(projectPath, bakPath)}`);
|
|
123
133
|
}
|
|
124
134
|
}
|
|
125
135
|
}
|
|
126
|
-
//
|
|
136
|
+
// else: none of the marker files exist — fresh install, proceed silently
|
|
127
137
|
}
|
|
138
|
+
// else: managed install — proceed silently
|
|
128
139
|
// Run the setup-ide script
|
|
129
140
|
try {
|
|
130
|
-
execFileSync('bash', [scriptPath,
|
|
141
|
+
execFileSync('bash', [scriptPath, normalizedTarget], {
|
|
131
142
|
cwd: projectPath,
|
|
132
143
|
stdio: 'inherit',
|
|
133
144
|
});
|
|
@@ -136,7 +147,7 @@ export async function setupIdeAction(projectPath, target, opts) {
|
|
|
136
147
|
const code = err.status ?? 'unknown';
|
|
137
148
|
throw new UserError(`setup-ide exited with code ${code}. Check the output above for details.`);
|
|
138
149
|
}
|
|
139
|
-
console.error(`IDE setup complete for ${
|
|
150
|
+
console.error(`IDE setup complete for ${normalizedTarget}.`);
|
|
140
151
|
}
|
|
141
152
|
/**
|
|
142
153
|
* Propagate IDE-generated files from the project root to all registered worktrees.
|
|
@@ -144,74 +155,48 @@ export async function setupIdeAction(projectPath, target, opts) {
|
|
|
144
155
|
* The setup-ide script always writes to the project root (its find_project_root()
|
|
145
156
|
* walks up to the nearest directory containing project-documents/, which is always
|
|
146
157
|
* the root). Worktrees share the same guides submodule source but have independent
|
|
147
|
-
* working trees, so without propagation their
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* Files propagated (claude target):
|
|
151
|
-
* CLAUDE.md — compiled from alwaysApply rules
|
|
152
|
-
* .claude/rules/ — modular (non-alwaysApply) rule files
|
|
153
|
-
* .claude/agents/ — agent definition files
|
|
154
|
-
* .claude/skills/ — skill definition files
|
|
158
|
+
* working trees, so without propagation their compiled IDE files go stale after
|
|
159
|
+
* every root setup-ide run.
|
|
155
160
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
161
|
+
* Descriptor-driven: each target's `markerFiles` and `propagateDirs` (see TARGETS)
|
|
162
|
+
* define exactly what is copied. `.claude/settings.local.json` and `.claude/worktrees/`
|
|
163
|
+
* stay out because neither appears in any target's `propagateDirs` — the former is
|
|
164
|
+
* worktree-specific, the latter is the cf worktree registry and root-only.
|
|
159
165
|
*/
|
|
160
|
-
function propagateToWorktrees(project, target) {
|
|
161
|
-
const
|
|
166
|
+
export function propagateToWorktrees(project, target) {
|
|
167
|
+
const rootPath = project.projectPath;
|
|
168
|
+
const resolvedRootPath = path.resolve(rootPath);
|
|
169
|
+
// WorktreeService migrates a project's pre-worktree workflow fields into a
|
|
170
|
+
// "default" worktree context whose worktreePath IS the project root (see
|
|
171
|
+
// WorktreeService.ts). Propagating the root onto itself is a no-op at best;
|
|
172
|
+
// fs.cpSync throws ERR_FS_CP_EINVAL when src and dest are the same path, so
|
|
173
|
+
// this must be filtered out rather than merely being harmless.
|
|
174
|
+
const worktrees = (project.worktrees ?? []).filter((wt) => wt.worktreePath && fs.existsSync(wt.worktreePath) && path.resolve(wt.worktreePath) !== resolvedRootPath);
|
|
162
175
|
if (worktrees.length === 0)
|
|
163
176
|
return;
|
|
164
|
-
const
|
|
177
|
+
const resolvedTarget = normalizeTarget(target);
|
|
178
|
+
if (!resolvedTarget) {
|
|
179
|
+
throw new UserError(`No propagation descriptor for target '${target}'.`);
|
|
180
|
+
}
|
|
181
|
+
const descriptor = TARGETS[resolvedTarget];
|
|
165
182
|
for (const wt of worktrees) {
|
|
166
183
|
const wtPath = wt.worktreePath;
|
|
167
184
|
console.log(` → propagating to worktree: ${wt.name ?? wt.id} (${wtPath})`);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
for (const dir of ['rules', 'agents', 'skills']) {
|
|
176
|
-
const srcDir = path.join(rootPath, '.claude', dir);
|
|
177
|
-
const dstDir = path.join(wtPath, '.claude', dir);
|
|
178
|
-
if (!fs.existsSync(srcDir))
|
|
179
|
-
continue;
|
|
180
|
-
fs.mkdirSync(dstDir, { recursive: true });
|
|
181
|
-
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
182
|
-
if (entry.isFile()) {
|
|
183
|
-
fs.copyFileSync(path.join(srcDir, entry.name), path.join(dstDir, entry.name));
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
185
|
+
for (const relFile of descriptor.markerFiles) {
|
|
186
|
+
const srcFile = path.join(rootPath, ...relFile.split('/'));
|
|
187
|
+
if (!fs.existsSync(srcFile))
|
|
188
|
+
continue;
|
|
189
|
+
const dstFile = path.join(wtPath, ...relFile.split('/'));
|
|
190
|
+
fs.mkdirSync(path.dirname(dstFile), { recursive: true });
|
|
191
|
+
fs.copyFileSync(srcFile, dstFile);
|
|
187
192
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
// .github/copilot-instructions.md
|
|
195
|
-
const srcInstructions = path.join(rootPath, '.github', 'copilot-instructions.md');
|
|
196
|
-
if (fs.existsSync(srcInstructions)) {
|
|
197
|
-
fs.mkdirSync(path.join(wtPath, '.github'), { recursive: true });
|
|
198
|
-
fs.copyFileSync(srcInstructions, path.join(wtPath, '.github', 'copilot-instructions.md'));
|
|
199
|
-
}
|
|
200
|
-
// .github/instructions/ and .github/prompts/
|
|
201
|
-
for (const dir of ['instructions', 'prompts']) {
|
|
202
|
-
const srcDir = path.join(rootPath, '.github', dir);
|
|
203
|
-
const dstDir = path.join(wtPath, '.github', dir);
|
|
204
|
-
if (!fs.existsSync(srcDir))
|
|
205
|
-
continue;
|
|
206
|
-
fs.mkdirSync(dstDir, { recursive: true });
|
|
207
|
-
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
208
|
-
if (entry.isFile()) {
|
|
209
|
-
fs.copyFileSync(path.join(srcDir, entry.name), path.join(dstDir, entry.name));
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
193
|
+
for (const relDir of descriptor.propagateDirs) {
|
|
194
|
+
const srcDir = path.join(rootPath, ...relDir.split('/'));
|
|
195
|
+
if (!fs.existsSync(srcDir))
|
|
196
|
+
continue;
|
|
197
|
+
const dstDir = path.join(wtPath, ...relDir.split('/'));
|
|
198
|
+
fs.cpSync(srcDir, dstDir, { recursive: true });
|
|
213
199
|
}
|
|
214
|
-
// Future targets (cursor, windsurf) would propagate their own dirs here.
|
|
215
200
|
}
|
|
216
201
|
console.log(` Propagated to ${worktrees.length} worktree${worktrees.length !== 1 ? 's' : ''}.`);
|
|
217
202
|
}
|
|
@@ -219,14 +204,17 @@ export function registerSetupIdeCommand(program) {
|
|
|
219
204
|
const ideCmd = program
|
|
220
205
|
.command('setup-ide')
|
|
221
206
|
.description('Configure IDE-specific AI integration files for the current project')
|
|
222
|
-
.argument('<target>', 'IDE target: claude, copilot');
|
|
207
|
+
.argument('<target>', 'IDE target: claude, copilot, cursor, agents (aliases: openai, codex)');
|
|
223
208
|
withProjectOption(ideCmd);
|
|
224
209
|
withYesOption(ideCmd);
|
|
225
210
|
ideCmd.action(async (target, opts) => {
|
|
226
211
|
try {
|
|
227
|
-
// Validate target early (before project resolution for fast
|
|
228
|
-
|
|
229
|
-
|
|
212
|
+
// Validate and normalize target early (before project resolution for fast
|
|
213
|
+
// failure). Both downstream calls use the normalized value — an alias like
|
|
214
|
+
// 'codex' has no entry in TARGETS, and propagateToWorktrees throws on a miss.
|
|
215
|
+
const normalizedTarget = normalizeTarget(target);
|
|
216
|
+
if (!normalizedTarget) {
|
|
217
|
+
throw new UserError(invalidTargetMessage(target));
|
|
230
218
|
}
|
|
231
219
|
// Resolve project
|
|
232
220
|
const store = new FileProjectStore();
|
|
@@ -239,8 +227,8 @@ export function registerSetupIdeCommand(program) {
|
|
|
239
227
|
throw new UserError(`Project '${project.name}' has no configured project path.\n` +
|
|
240
228
|
' Run cf init in the project directory to set the path.');
|
|
241
229
|
}
|
|
242
|
-
await setupIdeAction(project.projectPath,
|
|
243
|
-
propagateToWorktrees(project,
|
|
230
|
+
await setupIdeAction(project.projectPath, normalizedTarget, { yes: opts.yes });
|
|
231
|
+
propagateToWorktrees(project, normalizedTarget);
|
|
244
232
|
}
|
|
245
233
|
catch (err) {
|
|
246
234
|
handleError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-ide.js","sourceRoot":"","sources":["../../src/commands/setup-ide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup-ide.js","sourceRoot":"","sources":["../../src/commands/setup-ide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,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AkB;YAClB,MAAM,KAAK,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACrC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAExC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YACrD,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACzB,MAAM,IAAI,SAAS,CACjB,YAAY,OAAO,CAAC,IAAI,qCAAqC;oBAC3D,yDAAyD,CAC5D,CAAC;YACJ,CAAC;YAED,MAAM,cAAc,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/E,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@context-forge/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "CLI for Context Forge — terminal access to context assembly, project management, workflow navigation, and configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"chalk": "^5.4.1",
|
|
34
34
|
"commander": "^13.1.0",
|
|
35
|
-
"@context-forge/core": "0.
|
|
35
|
+
"@context-forge/core": "0.11.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^25.3.0",
|