cli-anything-audacity

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-anything-audacity

cli-anything-audacity

A stateful command-line interface for audio editing, following the same patterns as the GIMP and Blender CLIs in this repo.
一款支持状态管理的音频编辑命令行工具,遵循本仓库中GIMP和Blender命令行工具(CLI)的设计模式。

Installation

安装

This CLI is installed as part of the cli-anything-audacity package:
bash
pip install cli-anything-audacity
Prerequisites:
  • Python 3.10+
  • audacity must be installed on your system
该CLI作为cli-anything-audacity包的一部分进行安装:
bash
pip install cli-anything-audacity
前置要求:
  • Python 3.10及以上版本
  • 系统中已安装Audacity

Usage

使用方法

Basic Commands

基础命令

bash
undefined
bash
undefined

Show help

显示帮助信息

cli-anything-audacity --help
cli-anything-audacity --help

Start interactive REPL mode

启动交互式REPL模式

cli-anything-audacity
cli-anything-audacity

Create a new project

创建新项目

cli-anything-audacity project new -o project.json
cli-anything-audacity project new -o project.json

Run with JSON output (for agent consumption)

以JSON格式输出(供Agent调用)

cli-anything-audacity --json project info -p project.json
undefined
cli-anything-audacity --json project info -p project.json
undefined

REPL Mode

REPL模式

When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-audacity
当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-audacity

Enter commands interactively with tab-completion and history

以交互式方式输入命令,支持自动补全和历史记录

undefined
undefined

Command Groups

命令组

Project

项目管理

Project management commands.
CommandDescription
new
Create a new project
open
Open an existing project
save
Save the current project
info
Show project information
settings
View or update project settings
json
Print raw project JSON
项目管理相关命令。
命令描述
new
创建新项目
open
打开现有项目
save
保存当前项目
info
显示项目信息
settings
查看或更新项目设置
json
打印原始项目JSON数据

Track

轨道管理

Track management commands.
CommandDescription
add
Add a new track
remove
Remove a track by index
list
List all tracks
set
Set a track property (name, mute, solo, volume, pan)
轨道管理相关命令。
命令描述
add
添加新轨道
remove
按索引删除轨道
list
列出所有轨道
set
设置轨道属性(名称、静音、独奏、音量、声像)

Clip

剪辑管理

Clip management commands.
CommandDescription
import
Probe/import an audio file (show metadata)
add
Add an audio clip to a track
remove
Remove a clip from a track
trim
Trim a clip's start and/or end
split
Split a clip at a given time position
move
Move a clip to a new start time
list
List clips on a track
剪辑管理相关命令。
命令描述
import
探测/导入音频文件(显示元数据)
add
向轨道添加音频剪辑
remove
从轨道删除剪辑
trim
修剪剪辑的起始和/或结束位置
split
在指定时间点拆分剪辑
move
将剪辑移动到新的起始时间
list
列出轨道上的所有剪辑

Effect Group

效果管理

Effect management commands.
CommandDescription
list-available
List all available effects
info
Show details about an effect
add
Add an effect to a track
remove
Remove an effect by index
set
Set an effect parameter
list
List effects on a track
效果管理相关命令。
命令描述
list-available
列出所有可用效果
info
显示效果详情
add
向轨道添加效果
remove
按索引删除效果
set
设置效果参数
list
列出轨道上的所有效果

Selection

选区管理

Selection management commands.
CommandDescription
set
Set selection range
all
Select all (entire project duration)
none
Clear selection
info
Show current selection
选区管理相关命令。
命令描述
set
设置选区范围
all
全选(整个项目时长)
none
清除选区
info
显示当前选区

Label

标签/标记管理

Label/marker management commands.
CommandDescription
add
Add a label at a time position
remove
Remove a label by index
list
List all labels
标签/标记管理相关命令。
命令描述
add
在指定时间点添加标签
remove
按索引删除标签
list
列出所有标签

Media

媒体文件操作

Media file operations.
CommandDescription
probe
Analyze an audio file
check
Check that all referenced audio files exist
媒体文件操作相关命令。
命令描述
probe
分析音频文件
check
检查所有引用的音频文件是否存在

Export Group

导出/渲染

Export/render commands.
CommandDescription
presets
List export presets
preset-info
Show preset details
render
Render the project to an audio file
导出/渲染相关命令。
命令描述
presets
列出导出预设
preset-info
显示预设详情
render
将项目渲染为音频文件

Session Group

会话管理

Session management commands.
CommandDescription
status
Show session status
undo
Undo the last operation
redo
Redo the last undone operation
history
Show undo history
会话管理相关命令。
命令描述
status
显示会话状态
undo
撤销上一步操作
redo
重做上一步撤销的操作
history
显示撤销历史

Examples

示例

Create a New Project

创建新项目

Create a new audacity project file.
bash
cli-anything-audacity project new -o myproject.json
创建一个新的Audacity项目文件。
bash
cli-anything-audacity project new -o myproject.json

Or with JSON output for programmatic use

或者以JSON格式输出,供程序化调用

cli-anything-audacity --json project new -o myproject.json
undefined
cli-anything-audacity --json project new -o myproject.json
undefined

Interactive REPL Session

交互式REPL会话

Start an interactive session with undo/redo support.
bash
cli-anything-audacity
启动支持撤销/重做的交互式会话。
bash
cli-anything-audacity

Enter commands interactively

以交互式方式输入命令

Use 'help' to see available commands

使用'help'查看可用命令

Use 'undo' and 'redo' for history navigation

使用'undo'和'redo'导航历史操作

undefined
undefined

Export Project

导出项目

Export the project to a final output format.
bash
cli-anything-audacity --project myproject.json export render output.pdf --overwrite
将项目导出为最终输出格式。
bash
cli-anything-audacity --project myproject.json export render output.pdf --overwrite

State Management

状态管理

The CLI maintains session state with:
  • Undo/Redo: Up to 50 levels of history
  • Project persistence: Save/load project state as JSON
  • Session tracking: Track modifications and changes
该CLI通过以下方式维护会话状态:
  • 撤销/重做:最多支持50级历史记录
  • 项目持久化:以JSON格式保存/加载项目状态
  • 会话跟踪:跟踪修改和变更

Output Formats

输出格式

All commands support dual output modes:
  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (
    --json
    flag): Structured JSON for agent consumption
bash
undefined
所有命令支持两种输出模式:
  • 人类可读格式(默认):表格、彩色文本、格式化文本
  • 机器可读格式
    --json
    参数):结构化JSON,供Agent调用
bash
undefined

Human output

人类可读格式输出

cli-anything-audacity project info -p project.json
cli-anything-audacity project info -p project.json

JSON output for agents

供Agent调用的JSON格式输出

cli-anything-audacity --json project info -p project.json
undefined
cli-anything-audacity --json project info -p project.json
undefined

For AI Agents

供AI Agent调用指南

When using this CLI programmatically:
  1. Always use
    --json
    flag
    for parseable output
  2. Check return codes - 0 for success, non-zero for errors
  3. Parse stderr for error messages on failure
  4. Use absolute paths for all file operations
  5. Verify outputs exist after export operations
当以程序化方式使用该CLI时:
  1. 始终使用
    --json
    参数
    以获取可解析的输出
  2. 检查返回码——0表示成功,非0表示错误
  3. 解析stderr以获取失败时的错误信息
  4. 使用绝对路径进行所有文件操作
  5. 导出操作后验证输出文件是否存在

More Information

更多信息

  • Full documentation: See README.md in the package
  • Test coverage: See TEST.md in the package
  • Methodology: See HARNESS.md in the cli-anything-plugin
  • 完整文档:查看包中的README.md
  • 测试覆盖率:查看包中的TEST.md
  • 实现方法:查看cli-anything-plugin中的HARNESS.md

Version

版本

1.0.0
1.0.0