CLI harness for Audacity - Audio editing and processing via sox. Requires: sox (apt install sox)
Project description
Audacity CLI
A stateful command-line interface for audio editing, following the same patterns as the GIMP and Blender CLIs in this repo.
Architecture
- JSON project format tracks state (tracks, clips, effects, labels, selection)
- Python stdlib (
wave,struct,math) handles WAV I/O and audio processing - Click provides the CLI framework with subcommand groups and REPL
- Effects are recorded in the project JSON and applied during export/render
Install
pip install click numpy # numpy only needed for tests
No other dependencies required. Core functionality uses only Python stdlib.
Run
# From the agent-harness/ directory:
cd /root/cli-anything/audacity/agent-harness
# One-shot commands
python3 -m cli.audacity_cli project new --name "My Podcast"
python3 -m cli.audacity_cli track add --name "Voice"
python3 -m cli.audacity_cli clip add 0 /path/to/recording.wav
python3 -m cli.audacity_cli effect add normalize --track 0
python3 -m cli.audacity_cli export render output.wav
# JSON output mode (for agent consumption)
python3 -m cli.audacity_cli --json project info
# Interactive REPL
python3 -m cli.audacity_cli repl
Run Tests
cd /root/cli-anything/audacity/agent-harness
# All tests
python3 -m pytest cli/tests/ -v
# Unit tests only (no real audio files)
python3 -m pytest cli/tests/test_core.py -v
# E2E tests (generates real WAV files)
python3 -m pytest cli/tests/test_full_e2e.py -v
Command Groups
| Group | Commands |
|---|---|
project |
new, open, save, info, settings, json |
track |
add, remove, list, set |
clip |
import, add, remove, trim, split, move, list |
effect |
list-available, info, add, remove, set, list |
selection |
set, all, none, info |
label |
add, remove, list |
media |
probe, check |
export |
presets, preset-info, render |
session |
status, undo, redo, history |
Example Workflow
# Create a podcast project
python3 -m cli.audacity_cli project new --name "Episode 1" -o project.json
# Add tracks
python3 -m cli.audacity_cli --project project.json track add --name "Host"
python3 -m cli.audacity_cli --project project.json track add --name "Guest"
python3 -m cli.audacity_cli --project project.json track add --name "Music"
# Import audio clips
python3 -m cli.audacity_cli --project project.json clip add 0 host_recording.wav
python3 -m cli.audacity_cli --project project.json clip add 1 guest_recording.wav --start 0.5
python3 -m cli.audacity_cli --project project.json clip add 2 music.wav --volume 0.3
# Apply effects
python3 -m cli.audacity_cli --project project.json effect add normalize --track 0 -p target_db=-3.0
python3 -m cli.audacity_cli --project project.json effect add compress --track 0 -p threshold=-20 -p ratio=4.0
python3 -m cli.audacity_cli --project project.json effect add fade_in --track 2 -p duration=2.0
# Add labels
python3 -m cli.audacity_cli --project project.json label add 0.0 --text "Intro"
python3 -m cli.audacity_cli --project project.json label add 30.0 -e 60.0 --text "Main discussion"
# Export
python3 -m cli.audacity_cli --project project.json export render episode1.wav --preset wav
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cli_anything_audacity-1.0.0.tar.gz.
File metadata
- Download URL: cli_anything_audacity-1.0.0.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586955e63817f1b59b5cb13f0b0fd116f2759adec6b270e493c756e1dde4646c
|
|
| MD5 |
f0ecfa5fc92daf4cc57c23f3837c5270
|
|
| BLAKE2b-256 |
e5f1eae5250cb0e35b9a34c3aa6e3129caa664f3b552d0192ace4bbb5a83bae4
|
File details
Details for the file cli_anything_audacity-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cli_anything_audacity-1.0.0-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71091b55bfdc850b320e6a8e2b602a3e5ce4b9f1abad66bb760002f654166aa
|
|
| MD5 |
b1cc09a4244b3cdcf9fb33ab39050075
|
|
| BLAKE2b-256 |
74cc8d269be094004989c4dc1f4759e5b5d6e12264939285b4b39957957db903
|