@cliat/suno is a JSR-ready Deno package with a suno CLI and a small client
library for Suno's text-only song creation workflow.
The CLI uses playwright-cli for login/bootstrap and plain authenticated
fetch for create, polling, and download. Runtime auth is built from saved Suno
cookies: the __session cookie becomes the Bearer token and suno_device_id
becomes the device header.
deno task run --help
deno task version
deno task version:compare -- HEAD~1
deno task run auth
deno task run songs create --prompt "upbeat synthpop about shipping software" --style "synthpop"Default session path:
~/.auth/cliat@suno.jsonOverride it with the global --session-path, -s <path> flag before the command
path.
suno auth
suno auth get-cookies
suno auth loginsuno auth tries auth get-cookies. It only saves a Rookie session when
extracted Suno/Clerk cookies pass a harmless authenticated fetch probe against
Suno. If that cannot be proven, use suno auth login; it opens Suno with
playwright-cli, waits for login, saves the validated fetch session, and closes
the browser automatically after success.
Runtime dependencies for auth flows:
npm install -g playwright-cli
playwright-cli install chrome
deno eval "await import('npm:@rookie-rs/api@0.5.6')"suno songs create --prompt "a bright indie pop song about a rainy commute" --style "indie pop"
suno songs get <song-or-job-id>
suno songs wait <song-or-job-id> --timeout 10m
suno songs download <song-id> --out ./downloadssongs create emits a stable pollable song id plus jobId when Suno returns
one. songs get, songs wait, and songs download accept the song id
directly.
import { createClient } from "jsr:@cliat/suno";
const client = createClient({
auth: { cookie: "..." },
});
const result = await client.createSong({
prompt: "ambient piano about morning light",
style: "ambient piano",
});The library is runtime-neutral and accepts a custom fetch. Deno-specific
session files, playwright-cli, Rookie, and filesystem downloads live in the
CLI layer.
Human-readable output is the default. Use --json for parseable output when a
script or agent will consume results. JSON success output goes to stdout.
Diagnostics and errors go to stderr. Secret material such as cookies and auth
headers is never printed.
suno --json songs create --prompt "a bright indie pop song about a rainy commute"deno task check
deno task compile
deno publish --dry-run
deno publishdeno task compile builds target-specific binaries under bin/ for Linux
x86_64 and aarch64, Windows x86_64, and macOS x86_64 and aarch64.
deno task version prints the current package version, and
deno task version:compare -- <git-ref> compares it to a previous deno.json
version from git history.
Published CLI usage:
deno x jsr:@cliat/suno/cli --help
deno install -g -A jsr:@cliat/suno/cliThe GitHub Actions workflow watches deno.json. When version changes on
main, it runs deno task check, compiles all supported binaries, creates a
GitHub Release tagged as v<version>, uploads the bin/ artifacts, and
publishes to JSR. Version detection is delegated to the same Deno version
helper tasks that are available locally.