Skip to content

cliat/suno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cliat/suno

@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.

Run Locally

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.json

Override it with the global --session-path, -s <path> flag before the command path.

Auth

suno auth
suno auth get-cookies
suno auth login

suno 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')"

Main Workflow

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 ./downloads

songs 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.

Library

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.

Output Contract

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"

Publishing

deno task check
deno task compile
deno publish --dry-run
deno publish

deno 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/cli

The 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.

About

Agent compatible suno.com CLI

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors