Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / packages/cli/src/index.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | packages/cli/src/index.ts |
| Original SHA-256 | 6f4529d5cce4bf12ca3425b458a1ddcc3b4210b8e17e33ca703a233fd8ac0452 |
| Git blob SHA | b2a527c419ceafdaca9f998ceb3668bb92aa6de9 |
| Reading-copy SHA-256 | 6f4529d5cce4bf12ca3425b458a1ddcc3b4210b8e17e33ca703a233fd8ac0452 |
Recovered source transcript
Download complete source text ↓78 lines · 2.5 KB
import { Command } from 'commander'
import { info } from './commands/info.js'
import { init } from './commands/init.js'
import { install } from './commands/install.js'
import { list } from './commands/list.js'
import { remove } from './commands/remove.js'
import { search } from './commands/search.js'
import { update } from './commands/update.js'
import { printBanner } from './lib/banner.js'
const program = new Command()
program
.name('llmstxt')
.description('Install llms.txt files from the llms-txt-hub registry into your AI coding tools')
.version(__CLI_VERSION__)
.action(() => {
// Bare `llmstxt` with no command: show banner + help
printBanner(__CLI_VERSION__)
program.outputHelp()
})
program
.command('init')
.description('Auto-detect dependencies and install matching llms.txt files')
.option('--category <categories>', 'Filter by categories (comma-separated)')
.option('--all-categories', 'Include all categories')
.option('--dry-run', 'Preview without installing')
.option('--full', 'Prefer llms-full.txt when available')
.option('-y, --yes', 'Skip confirmation prompts')
.action(init)
program
.command('install')
.description('Install llms.txt files by name')
.argument('<names...>', 'Names or slugs to install')
.option('--full', 'Prefer llms-full.txt when available')
.option('--force', 'Re-download even if already installed')
.action((names: string[], options: { full?: boolean; force?: boolean }) =>
install({ names, options })
)
program
.command('search')
.description('Search the registry for llms.txt entries')
.argument('<query>', 'Search query')
.option('--category <categories>', 'Filter by categories (comma-separated)')
.option('--all-categories', 'Search all categories')
.action(search)
program.command('list').alias('ls').description('List installed llms.txt files').action(list)
program
.command('update')
.description('Update installed llms.txt files')
.argument('[name]', 'Specific entry to update (updates all if omitted)')
.option('--force', 'Force re-download even if unchanged')
.action(update)
program
.command('remove')
.alias('rm')
.description('Remove an installed llms.txt file')
.argument('<name>', 'Name or slug to remove')
.action(remove)
program
.command('info')
.description('Show details about a registry entry')
.argument('<name>', 'Name or slug to look up')
.action(info)
program.parseAsync().catch((err: unknown) => {
const msg = err instanceof Error ? err.message : String(err)
console.error(`\nError: ${msg}`)
process.exitCode = 1
})