Skip to content

Commit e100e9a

Browse files
rootclaude
andcommitted
feat: load license key from fondamenta.config.ts
Read license field from fondamenta.config.ts via regex in loadConfig(). Enables PRO agents when config file is present in project root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0ae9a54 commit e100e9a

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/cli.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,26 @@ async function runGeneration(
688688
}
689689

690690
async function loadConfig(
691-
_projectRoot: string,
691+
projectRoot: string,
692692
opts: Record<string, unknown>,
693693
): Promise<FondamentaConfig> {
694-
const config = { ...DEFAULT_CONFIG };
694+
let config: FondamentaConfig = { ...DEFAULT_CONFIG };
695+
696+
// Load fondamenta.config.ts if present
697+
const configPath = resolve(projectRoot, 'fondamenta.config.ts');
698+
if (existsSync(configPath)) {
699+
try {
700+
const raw = await readFile(configPath, 'utf-8');
701+
// Extract license key from config file via regex (avoids ts execution)
702+
const licenseMatch = raw.match(/license:\s*['"](FA-PRO-[^'"]+)['"]/);
703+
if (licenseMatch) {
704+
if (!config.agents) config.agents = {} as any;
705+
(config.agents as any).license = licenseMatch[1];
706+
}
707+
} catch {
708+
// ignore config read errors
709+
}
710+
}
695711

696712
if (opts.output) config.output = opts.output as string;
697713
if (opts.framework) config.framework = opts.framework as any;

0 commit comments

Comments
 (0)