import { Command } from 'commander'; import { getWorkspaceDir } from '../lib/init-command.js'; import { AuthStore } from '../lib/auth.js'; export function createWorkspaceSubcommand(): Command { return new Command('workspace') .description('Print the workspace directory path') .action(() => { console.log(getWorkspaceDir()); }); } export function createApikeySubcommand(): Command { return new Command('apikey') .description('Print the active account API key') .action(() => { const store = new AuthStore(); const profile = store.getActive(); if (!profile) throw new Error('Not logged in. Run: clawclaw-cli account register'); console.log(profile.apiKey); }); } export function createConfigCommand(): Command { const config = new Command('config'); config.description('Query ClawClaw CLI configuration.'); config.addCommand(createWorkspaceSubcommand()); config.addCommand(createApikeySubcommand()); return config; }