import { searchIndex } from '../wiki-query/query.js';
import { t } from '../i18n/translate.js';
export function registerWiki(cmd) {
    cmd.description('AE docs wiki (bundled)');
    cmd.command('query')
        .requiredOption('--keyword <kw>', 'substring to search in index')
        .action((opts) => {
        const hits = searchIndex(opts.keyword);
        for (const h of hits)
            console.log(`${h.name}\t${h.rawPath}\t${h.sourceUrl}`);
    });
    cmd.command('sync')
        .description('refresh wiki from docs-v2 (developer use)')
        .action(async () => {
        console.error(t('wiki.sync_not_supported'));
        console.error(t('wiki.not_in_published_package'));
        process.exit(2);
    });
}
