Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ Claude reads layer 0 first, then routes down as needed.

Yes. Edit any `CONTEXT.md`, add `<!-- klonode:manual -->` at the top, and Klonode will preserve your edits on future runs.

## How do I ignore generated files in Git?

If you want to treat Klonode's output as ephemeral artifacts rather than committing them to your repo, add this to your `.gitignore`:

```gitignore
# Klonode auto-generated routing
CLAUDE.md
CONTEXT.md
.klonode/
```

You can automatically append this by running `klonode init --gitignore-only`.

## Is it production-ready?

No. This is v0.1.0 alpha. Interfaces may change. But the core pipeline works end-to-end — we use it daily.
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ program
.argument('[path]', 'Path to the git repository', '.')
.option('-m, --mode <mode>', 'Output mode: inline or shadow', 'inline')
.option('--dry-run', 'Show what would be generated without writing files')
.option('--gitignore-only', 'Append Klonode presets to .gitignore without scanning')
.action(initCommand);

program
Expand Down
25 changes: 23 additions & 2 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,29 @@ import chalk from 'chalk';

export async function initCommand(
repoPath: string,
options: { mode?: string; dryRun?: boolean },
options: { mode?: string; dryRun?: boolean; gitignoreOnly?: boolean },
): Promise<void> {
const resolved = path.resolve(repoPath);

if (options.gitignoreOnly) {
const fs = await import('fs');
const gitignorePath = path.join(resolved, '.gitignore');
const snippet = '\n# Klonode auto-generated routing\nCLAUDE.md\nCONTEXT.md\n.klonode/\n';

if (fs.existsSync(gitignorePath)) {
const content = fs.readFileSync(gitignorePath, 'utf8');
if (!content.includes('# Klonode auto-generated routing')) {
fs.appendFileSync(gitignorePath, snippet);
console.log(chalk.green('✓ Appended Klonode preset to .gitignore'));
} else {
console.log(chalk.yellow('⚠ .gitignore already contains the Klonode preset'));
}
} else {
fs.writeFileSync(gitignorePath, snippet.trimStart());
console.log(chalk.green('✓ Created .gitignore and added Klonode preset'));
}
return;
}
const {
generateRouting,
writeGeneratedFiles,
Expand All @@ -19,7 +40,7 @@ export async function initCommand(
formatInjectionReport,
} = await import('@klonode/core');

const resolved = path.resolve(repoPath);

const mode = (options.mode === 'shadow' ? 'shadow' : 'inline') as 'inline' | 'shadow';

console.log(chalk.blue.bold('\n⟐ Klonode — AI Context Routing Generator\n'));
Expand Down
Loading