Generate music with Google Lyria from your terminal or an AI agent. Text in, MP3 out, with JSON results for automation.
Requires Node.js 22+ and a Gemini API key. After the first npm release:
npm install -g @crapthings/lyria-cli
export GEMINI_API_KEY='your-api-key'
lyria-cli generate \
--prompt 'Gentle jazz piano and upright bass, no vocals' \
--output ./music.mp3 \
--jsonThe npm package is @crapthings/lyria-cli; the executable is lyria-cli. Use --prompt-file ./song.txt for lyrics or long prompts. Run lyria-cli --help for all options. Default model: lyria-3.5.
The npm package includes lyria-music. After a project-local npm install @crapthings/lyria-cli, register it with your agent:
npx skills add ./node_modules/@crapthings/lyria-cli/skills/lyria-musicFrom this checkout, use npx skills add ./skills/lyria-music. You can also install from GitHub with npx skills add crapthings/lyria-cli --skill lyria-music. Installing the skill does not install the CLI or API credentials.
pnpm install
pnpm check
pnpm test
node dist/cli.js --helpRelease a new version with npm run release (patch by default). Preview with npm run release -- --dry-run.
CLI reference · Development, releases & GitHub Pages
MIT