Skip to content

Commit b6055b8

Browse files
authored
docs(typedoc): generate llms.txt (#34)
1 parent d651732 commit b6055b8

4 files changed

Lines changed: 71 additions & 1 deletion

File tree

.config/typedoc.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,59 @@ export default {
5858
'TypeAlias',
5959
],
6060
lightHighlightTheme: 'vitesse-light',
61+
// llms.txt configuration
62+
// llmsTxtDeclarations: Auto-generation doesn't work with kind-dir router
63+
// for single-entry-point projects. Use empty array to disable.
64+
// See: https://github.com/boneskull/typedoc-plugin-llms-txt
65+
llmsTxtDeclarations: [],
66+
llmsTxtHeader: {
67+
description:
68+
'A TypeScript-first CLI argument parser wrapping Node.js util.parseArgs() with full type inference and zero runtime dependencies.',
69+
features: [
70+
'Combinator-style fluent API: `bargs("app").globals(opts).command("cmd", pos, handler)`',
71+
'Full type inference: options and positionals are strongly typed without manual annotations',
72+
'Option builders: `opt.string()`, `opt.boolean()`, `opt.number()`, `opt.enum()`, `opt.array()`, `opt.count()`',
73+
'Positional builders: `pos.string()`, `pos.number()`, `pos.enum()`, `pos.variadic()`',
74+
'Transforms: `map()` to transform results, `merge()` to combine parsers, `camelCaseValues()` for key conversion',
75+
'Built-in help generation with ANSI theming and terminal hyperlink support',
76+
'Zero runtime dependencies - only wraps Node.js built-in util.parseArgs()',
77+
],
78+
},
79+
llmsTxtQuickReference: `// Simple CLI with options
80+
import { bargs, opt } from '@boneskull/bargs';
81+
82+
const result = await bargs('greeter', { version: '1.0.0' })
83+
.options(opt.options({
84+
name: opt.string({ description: 'Name to greet', default: 'World' }),
85+
excited: opt.boolean({ aliases: ['e'], description: 'Add excitement' }),
86+
}))
87+
.parseAsync();
88+
89+
console.log(\`Hello, \${result.values.name}\${result.values.excited ? '!' : '.'}\`);
90+
91+
// Command-based CLI with positionals
92+
import { bargs, opt, pos } from '@boneskull/bargs';
93+
94+
await bargs('tasks', { version: '1.0.0' })
95+
.globals(opt.options({
96+
verbose: opt.boolean({ aliases: ['v'] }),
97+
}))
98+
.command('add', pos.positionals(
99+
pos.string({ name: 'task', required: true }),
100+
), ({ positionals }) => console.log(\`Added: \${positionals[0]}\`))
101+
.command('list', undefined, () => console.log('Listing tasks...'))
102+
.parseAsync();
103+
104+
// Type-safe enum options
105+
opt.enum({ values: ['debug', 'info', 'warn', 'error'], default: 'info' })
106+
107+
// Variadic positionals (collects remaining args)
108+
pos.variadic({ name: 'files' })`,
109+
llmsTxtSections: {
110+
About: { displayName: 'About', order: 3 },
111+
Guides: { displayName: 'Docs', order: 1 },
112+
Reference: { displayName: 'Reference', order: 2 },
113+
},
61114
markdownLinkExternal: true,
62115
name: 'BARGS',
63116
navigation: {
@@ -73,6 +126,7 @@ export default {
73126
'typedoc-plugin-mdn-links',
74127
'typedoc-plugin-extras',
75128
'@boneskull/typedoc-plugin-mermaid',
129+
'typedoc-plugin-llms-txt',
76130
],
77131
preserveWatchOutput: true,
78132
router: 'kind-dir',

cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"subcommand",
7878
"subcommands",
7979
"navigations",
80-
"dogg"
80+
"dogg",
81+
"llms"
8182
]
8283
}

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"tsx": "4.21.0",
107107
"typedoc": "0.28.15",
108108
"typedoc-plugin-extras": "4.0.1",
109+
"typedoc-plugin-llms-txt": "0.1.2",
109110
"typedoc-plugin-mdn-links": "5.0.10",
110111
"typescript": "5.9.3",
111112
"typescript-eslint": "8.50.0",

0 commit comments

Comments
 (0)