Install the CLI
Use npm with Node.js 22 or later.
npm install -g @crapthings/lyria-cliGOOGLE LYRIA, ONE COMMAND AWAY
Describe a sound. Get a track.
A small CLI that turns your ideas into music with Google Lyria — built for you and your agents.
Node.js 22+ · Bring your Gemini API key · MIT
# A little idea. A whole new sound.
$ lyria-cli generate \
--prompt "Warm jazz piano,
upright bass, no vocals" \
--output ./evening.mp3 \
--jsonGenerating music with lyria-3.5...
01 / GET STARTED
Three steps. Your own API key.
No account with us required.
Pre-release: npm installation commands become available after the first package release.
Use npm with Node.js 22 or later.
npm install -g @crapthings/lyria-cliGet a key from Google AI Studio ↗.
export GEMINI_API_KEY='your-key'Describe your sound and save an MP3.
lyria-cli generate \
--prompt 'Dreamy piano, no vocals' \
--output ./music.mp302 / FIND YOUR SOUND
A short prompt, a file full of lyrics, or a command inside an agent loop. Same simple interface.
Style, tempo, vocals, and duration belong in your prompt. The default model is lyria-3.5.
A soundtrack for a slower evening.
lyria-cli generate \
--prompt 'Mellow bossa nova, nylon guitar,
soft percussion, instrumental only' \
--output ./evening.mp3Put your musical directions and lyrics in song.txt.
lyria-cli generate \
--prompt-file ./song.txt \
--output ./song.mp3Use section tags such as [Verse] and [Chorus] in your prompt file.
Give your agent a result it can work with.
lyria-cli generate \
--prompt 'Gentle ambient synth, no vocals' \
--output ./ambient.mp3 \
--json{ "ok": true, "model": "lyria-3.5",
"files": [{ "path": "/path/ambient.mp3",
"mimeType": "audio/mpeg", "bytes": 123456 }],
"text": "Any returned lyrics or description" }JSON on stdout, progress on stderr, and clear exit codes for automation.
No automatic generation retries. Set a timeout and control the next step yourself.
Complete MP3 files, saved locally. Existing files are protected by default.
A FEW DETAILS
The default is lyria-3.5. You can select lyria-3-clip-preview with --model for a fixed 30-second clip. Your Gemini API key needs access to the selected model.
Yes. Put your musical directions, language, vocal style, and lyrics in the prompt or a UTF-8 prompt file. For instrumental music, explicitly ask for no vocals. See the Lyria prompt guide.
You bring your own Gemini API key, and usage is billed by your API provider. Check Google's current pricing. The CLI does not automatically retry a generation request.
This version generates one complete MP3 per request. It supports text prompts, including lyrics. Real-time streaming, image input, WAV output, and audio editing are outside the current CLI.
Run lyria-cli --help. Use --timeout to set a request deadline and --overwrite when you intend to replace an existing output. Duration and tempo are prompt instructions, not exact guarantees.
Small command. New possibilities.
Make your first track