A Python CLI for automating audio processing workflows on Suno using Playwright browser automation.
- Python 3.12+
- Windows / macOS / Linux
git clone <your-repo-url>
cd suno_toolpython -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activatepip install -r requirements.txtplaywright install chromiumCopy and edit the default config (or edit config.yaml directly):
# config.yaml
paths:
input_dir: "./input" # put your .wav / .mp3 files here
output_dir: "./output" # generated files are saved here
browser:
headless: false # set true to run without a visible windowBefore processing any files, you need to log in to Suno once so the session can be persisted:
python cli.py bootstrap-loginA browser window will open. Log in to Suno manually, then press ENTER in the terminal.
Your session is saved to ./browser_profile and reused on subsequent runs.
python cli.py processpython cli.py process --only my_beat.wavpython cli.py process --dry-runpython cli.py process --only my_beat.wav --dry-run# Reset one file
python cli.py process --only my_beat.wav --reset
# Reset everything
python cli.py process --resetpython cli.py statuspython cli.py process --verbosesuno_tool/
├── cli.py # CLI entry point (Click commands)
├── config.py # YAML config loader → typed dataclasses
├── config.yaml # Default configuration
├── scanner.py # Finds .wav / .mp3 files in input_dir
├── state.py # JSON-backed processing state tracker
├── suno_client.py # Playwright browser automation (stubs)
├── pipeline.py # Orchestrates scan → process → download
├── downloads.py # Saves generated audio to output_dir
├── utils.py # Logging setup and small helpers
├── requirements.txt
└── README.md
| Location | Purpose |
|---|---|
./input/ |
Drop your .wav or .mp3 files here |
./output/ |
Generated files are downloaded here |
./state.json |
Tracks which files have been processed |
./browser_profile/ |
Persisted Playwright browser session |
./logs/suno_tool.log |
Rotating log file |
The scanner reads only the root of input_dir — subdirectories are intentionally ignored.
The Suno workflow stubs live in suno_client.py. Each method has a # TODO block showing where to add Playwright selectors and interactions. The pipeline in pipeline.py calls these methods in order:
navigate_to_create()upload_audio(path)set_song_metadata(...)submit_generation()wait_for_completion()get_download_url()
Implement each step individually and test with --dry-run and --verbose to iterate quickly.