Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .config/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,59 @@ export default {
'TypeAlias',
],
lightHighlightTheme: 'vitesse-light',
// llms.txt configuration
// llmsTxtDeclarations: Auto-generation doesn't work with kind-dir router
// for single-entry-point projects. Use empty array to disable.
// See: https://github.com/boneskull/typedoc-plugin-llms-txt
llmsTxtDeclarations: [],
llmsTxtHeader: {
description:
'A TypeScript-first CLI argument parser wrapping Node.js util.parseArgs() with full type inference and zero runtime dependencies.',
features: [
'Combinator-style fluent API: `bargs("app").globals(opts).command("cmd", pos, handler)`',
'Full type inference: options and positionals are strongly typed without manual annotations',
'Option builders: `opt.string()`, `opt.boolean()`, `opt.number()`, `opt.enum()`, `opt.array()`, `opt.count()`',
'Positional builders: `pos.string()`, `pos.number()`, `pos.enum()`, `pos.variadic()`',
'Transforms: `map()` to transform results, `merge()` to combine parsers, `camelCaseValues()` for key conversion',
'Built-in help generation with ANSI theming and terminal hyperlink support',
'Zero runtime dependencies - only wraps Node.js built-in util.parseArgs()',
],
},
llmsTxtQuickReference: `// Simple CLI with options
import { bargs, opt } from '@boneskull/bargs';

const result = await bargs('greeter', { version: '1.0.0' })
.options(opt.options({
name: opt.string({ description: 'Name to greet', default: 'World' }),
excited: opt.boolean({ aliases: ['e'], description: 'Add excitement' }),
}))
.parseAsync();

console.log(\`Hello, \${result.values.name}\${result.values.excited ? '!' : '.'}\`);

// Command-based CLI with positionals
import { bargs, opt, pos } from '@boneskull/bargs';

await bargs('tasks', { version: '1.0.0' })
.globals(opt.options({
verbose: opt.boolean({ aliases: ['v'] }),
}))
.command('add', pos.positionals(
pos.string({ name: 'task', required: true }),
), ({ positionals }) => console.log(\`Added: \${positionals[0]}\`))
.command('list', undefined, () => console.log('Listing tasks...'))
.parseAsync();

// Type-safe enum options
opt.enum({ values: ['debug', 'info', 'warn', 'error'], default: 'info' })

// Variadic positionals (collects remaining args)
pos.variadic({ name: 'files' })`,
llmsTxtSections: {
About: { displayName: 'About', order: 3 },
Guides: { displayName: 'Docs', order: 1 },
Reference: { displayName: 'Reference', order: 2 },
},
markdownLinkExternal: true,
name: 'BARGS',
navigation: {
Expand All @@ -73,6 +126,7 @@ export default {
'typedoc-plugin-mdn-links',
'typedoc-plugin-extras',
'@boneskull/typedoc-plugin-mermaid',
'typedoc-plugin-llms-txt',
],
preserveWatchOutput: true,
router: 'kind-dir',
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"subcommand",
"subcommands",
"navigations",
"dogg"
"dogg",
"llms"
]
}
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"tsx": "4.21.0",
"typedoc": "0.28.15",
"typedoc-plugin-extras": "4.0.1",
"typedoc-plugin-llms-txt": "0.1.2",
"typedoc-plugin-mdn-links": "5.0.10",
"typescript": "5.9.3",
"typescript-eslint": "8.50.0",
Expand Down
Loading