Lyra is a CLI toolkit for Markdown-first content production. It helps you generate weekly content, assemble article prompts, and keep frontmatter metadata (especially tags) clean and consistent.
Package name: @captain_z/lyra
CLI command: lyra
- Features
- Installation
- Quick Start
- Command Reference
- Metadata and Tag Governance
- Configuration Discovery
- Minimal Config Example
- Versioning
- Troubleshooting
- Documentation
- Project Links
- License
- Template-driven content generation (
weeklyand more) - Prompt assembly via
lyra article/lyra prompt - Scheduler support with
lyra schedule - Image host auditing via
lyra check-images - Metadata and tag governance via
lyra check-metadata
# Global install
npm install -g @captain_z/lyra
# Local install
npm install @captain_z/lyra# 1) Initialize config
lyra init
# 2) List available templates
lyra list
# 3) Preview generation (no file output)
lyra weekly --dry-run
# 4) Generate content
lyra weekly| Command | Alias | Description |
|---|---|---|
lyra |
- | Launch interactive mode |
lyra <template> |
- | Quick generation by template |
lyra create [template] |
lyra c |
Explicit generation command |
lyra list |
lyra ls |
List registered templates |
lyra init |
- | Initialize config file |
lyra config |
- | Show/validate config |
lyra schedule |
lyra sched |
Run scheduler |
lyra check-images |
lyra check-img |
Check image hosts against allowlist |
lyra check-metadata |
lyra check-meta |
Validate/organize frontmatter and tags |
lyra article |
lyra a |
Build article prompt |
lyra prompt |
lyra p |
Backward-compatible alias of article |
lyra check-metadata supports both directory and single-file input, with automatic dedupe and optional AI-assisted tag generation.
# Check directory only (no write)
lyra check-metadata --path ../your-notes-repo
# Normalize tags (dedupe/trim/split delimiters)
lyra check-metadata --path ../your-notes-repo --fix-tags
# Normalize a single file
lyra check-metadata --path ./Input/Notes/today.md --fix-tags
# Normalize + AI enrich tags based on content
lyra check-metadata --path ../your-notes-repo --fix-tags --ai-tags --provider openaiCommon options:
--path <path>: directory or single Markdown file--fix-tags: normalize tags (dedupe, trim, delimiter cleanup)--ai-tags: generate/enrich tags from title and body content--max-tags <n>: max tags per file (default8)--min-tags <n>: min tags per file (default1)--dry-run: preview only, no write
Provider notes:
openai: requiresOPENAI_API_KEYanthropic: requiresANTHROPIC_API_KEYlocal: uses local model endpoint
Lyra searches upward from current directory for these config files:
.lyrarc.lyrarc.json.lyrarc.yaml.lyrarc.yml.lyrarc.js.lyrarc.cjs.lyrarc.mjslyra.config.jsonlyra.config.jslyra.config.cjslyra.config.mjs
{
"global": {
"logLevel": "info",
"defaultTemplate": "weekly"
},
"templates": {
"weekly": {
"enabled": true,
"template": {
"path": "./templates/weekly.hbs"
},
"sources": {
"articles": "./articles",
"tools": "./tools",
"notes": "./notes"
},
"output": {
"path": "./output",
"filename": "Weekly-{{issueNumber}}.md"
},
"content": {
"articles": { "topN": 10, "minRating": 0 },
"tools": { "perCategory": 3 },
"notes": { "groupBy": "none" }
}
}
}
}Lyra follows semantic versioning (MAJOR.MINOR.PATCH):
MAJOR: breaking changesMINOR: backward-compatible featuresPATCH: backward-compatible fixes
For frequent publishing, increment at least PATCH for every release.
- Prefer dedicated
wechat.publish.json/zhihu.publish.jsonfiles - Publish config should only include platform publish fields (AI follows
.lyrarc.json)
{
"lyraConfig": "./.lyrarc.json",
"title": "Default Title",
"author": "Lyra",
"digest": "Default digest",
"thumb_image_path": "./Output/Z° North/Publish/default-cover.png",
"cover_source_order": ["ai", "unsplash", "placeholder"],
"articles": [
{
"title": "Weekly #12",
"module": "weekly",
"contentFile": "./Output/Z° North/Z°N Weekly/drafts/2026-03-16-weekly.html"
},
{
"title": "Life Notes",
"contentFile": "./Output/Z° North/Z°N 生活志/drafts/2026-03-16-life.html"
}
]
}Publish command:
lyra publish --config ./wechat.publish.jsonIf publish fails during npm run build with EPERM on dist, rebuild from clean state and check permissions:
rm -rf dist
npm run buildlyra initlyra weekly --dry-run --verbose- CLI Guide
- Quick Start
- Enhanced Template Guide
- Migration Guide (Legacy -> Enhanced)
- Enhanced Config Schema
- Repository: https://github.com/codeshareman/Lyra
- Homepage: https://github.com/codeshareman/Lyra#readme
- Bugs: https://github.com/codeshareman/Lyra/issues
MIT