skrypt-ai
v0.8.1
Published
AI-powered documentation generator with code examples
Maintainers
Readme
skrypt
AI-powered documentation generator with code examples.
Scans your codebase, extracts API signatures, and generates beautiful documentation with working code examples.
Features
- Multi-language scanning: TypeScript, Python, Go, Rust
- AI-generated docs: Clear descriptions, parameters, return types
- Code examples: Working examples in TypeScript and Python
- Topic organization: Group elements by concept, not file
- MDX output: Works with any doc platform
- Doc site template: Beautiful, searchable documentation site
Installation
npm install -g skrypt-aiQuick Start
1. Initialize a documentation site
skrypt init my-docs
cd my-docs
npm install2. Generate API documentation
skrypt generate ../my-project/src -o ./content/docs3. Start the dev server
npm run devOpen http://localhost:3000 to see your docs.
CLI Commands
skrypt init [directory]
Initialize a new documentation site.
skrypt init my-docs --name "My API Docs"Options:
--name <name>- Project name (default: "my-docs")
skrypt generate <source>
Generate documentation from source code.
skrypt generate ./src -o ./docs
# Multi-language examples
skrypt generate ./src -o ./docs --multi-lang
# Organize by topic
skrypt generate ./src -o ./docs --by-topicOptions:
-o, --output <dir>- Output directory-c, --config <file>- Config file path--provider <name>- LLM provider (deepseek, openai, anthropic, google, ollama, openrouter)--model <name>- LLM model name--multi-lang- Generate TypeScript + Python examples--by-topic- Organize by topic instead of file--dry-run- Scan only, don't generate--public-only- Only document exported/public APIs--exclude <patterns...>- Exclude patterns (files orname:pattern)--llms-txt- Generate llms.txt for Answer Engine Optimization--project-name <name>- Project name for llms.txt header--openapi <file>- Include OpenAPI spec for API Playground
Privacy Controls
Prevent internal code from being documented:
# Only document exported APIs
skrypt generate ./src --public-only
# Exclude specific patterns
skrypt generate ./src --exclude "**/internal/**" "name:_private*"Create .skryptignore in your source directory:
# Exclude test files
**/*.test.ts
**/*.spec.ts
# Exclude internal modules
**/internal/**
# Exclude by function name (regex supported)
name:_privateHelper
name:__internal.*Answer Engine Optimization (AEO)
Generate llms.txt for AI search engines:
skrypt generate ./src --llms-txt --project-name "My API"This creates:
llms.txt- Condensed API summary for LLMsllms-full.md- Full API reference in LLM-friendly format
Configuration
Create .skrypt.yaml in your project:
version: 1
source:
path: ./src
include: ["**/*.ts", "**/*.py"]
exclude: ["**/node_modules/**"]
output:
path: ./docs
format: mdx
llm:
provider: deepseek
model: deepseek-v3Doc Site Features
The generated documentation site includes:
- Search: Full-text search across all docs
- Syntax highlighting: Beautiful code blocks with Shiki
- MDX components: Cards, Tabs, CodeGroup, Callouts, Accordions, Steps
- Dark mode: Automatic dark/light theme switching
- Responsive: Works on all device sizes
MDX Components
Use these components in your MDX files:
<CardGroup cols={2}>
<Card title="Getting Started" icon="Zap" href="/docs/quickstart">
Get up and running in 5 minutes
</Card>
</CardGroup>
<Info title="Note">
Important information here.
</Info>
<CodeGroup>
\`\`\`typescript
const client = new Client()
\`\`\`
\`\`\`python
client = Client()
\`\`\`
</CodeGroup>
<Steps>
<Step title="Install">Install the package</Step>
<Step title="Configure">Set up your config</Step>
</Steps>Environment Variables
Set API keys for your LLM provider:
export DEEPSEEK_API_KEY=your-key
export OPENAI_API_KEY=your-key
export ANTHROPIC_API_KEY=your-key