Runtime or CLI code links a write operation to an explicit external AI-agent control path:
import { command } from 'commander';
import fs from 'fs';
import path from 'path';
import { db, getcontextoshome } from '../../core/storage/database.js';
import { generatecursorconfig } from '../../mcp/cursor/config-generator.js';
import { mcp_server_instructions } from '../../mcp/instructions.js';
import chalk from 'chalk';
import { mergecontextosmcpconfig, validatejsonconfigs } from '../utils/mcp-config.js';
export const initcommand = new command('init')
.description('initialize contextos in the current repository')
.action(async () => {
const cwd = process.cwd();
const repocontextdir = path.join(cwd, '.contextos');