feat(cli): add @videojs/cli docs command for LLM-friendly installation (#1214)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-04-14 11:07:49 -05:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 9681515446
commit 24b8b77c8a
49 changed files with 2061 additions and 460 deletions
+40
View File
@@ -0,0 +1,40 @@
import { parse } from '@bomb.sh/args';
import { handleConfig } from './commands/config.js';
import { handleDocs } from './commands/docs.js';
const parsed = parse(process.argv.slice(2), {
alias: { f: 'framework', l: 'list', v: 'version', h: 'help' },
string: ['framework', 'preset', 'skin', 'media', 'source-url', 'install-method'],
boolean: ['list', 'version', 'help'],
});
const [command, ...rest] = parsed._ as string[];
if (parsed.version) {
console.log(`@videojs/cli v${__CLI_VERSION__}`);
process.exit(0);
}
if (!command) {
console.log(`@videojs/cli — Video.js 10 CLI
Commands:
docs <slug> [options] Read a doc page
docs --list [--framework] List available docs
config <set|get|list> [key] [value] Manage preferences
Options:
-f, --framework <html|react> JS framework
-v, --version Show version
-h, --help Show help`);
process.exit(0);
}
if (command === 'docs') {
await handleDocs(parsed, rest);
} else if (command === 'config') {
handleConfig(rest, { help: parsed.help });
} else {
console.error(`Unknown command: "${command}". Run with --help for usage.`);
process.exit(1);
}