feat(skill): add cover and audio repainting support to acestep CLI#777
feat(skill): add cover and audio repainting support to acestep CLI#777
Conversation
Add `cover` command and audio input support to the acestep.sh script, enabling song covers and audio repainting via both completion and native API modes. - Add `cover` command as shortcut for `generate --src-audio --task-type cover` - Add --src-audio, --task-type, --cover-strength, --repaint-start, --repaint-end options - Add --key-scale and --time-signature options for music attributes - Encode audio as base64 via python3 for completion mode (avoids shell arg limits) - Add User-Agent header to fix Cloudflare 1010 errors on large payloads - Update SKILL.md with cover/repainting documentation and examples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughACE-Step skill gains cover and audio repainting capabilities through documentation expansion and new CLI command implementation. The update introduces a Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as ACE-Step CLI
participant Validator as File Validator
participant PayloadBuilder as Payload Constructor
participant API as ACE-Step API
User->>CLI: Execute cover command with --src-audio
CLI->>Validator: Validate audio file exists
Validator-->>CLI: File confirmed
CLI->>PayloadBuilder: Build multipart payload with audio data
PayloadBuilder->>PayloadBuilder: Encode audio to base64
PayloadBuilder->>PayloadBuilder: Construct JSON with task_type, audio_config
PayloadBuilder-->>CLI: Payload ready
CLI->>API: Send curl request with multipart payload + metadata
API-->>CLI: Return cover/repainting result
CLI->>User: Display task completion with output details
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.claude/skills/acestep/scripts/acestep.sh (2)
925-929: Consider adding Python fallback for base64 encoding.The
decode_base64_audiofunction (lines 564-569) falls back topythonifpython3is unavailable, but the encoding here only usespython3. For consistency and broader compatibility:Suggested improvement
local audio_b64_file=$(mktemp) - python3 -c " + if ! python3 -c " import base64, sys with open(sys.argv[1], 'rb') as f: sys.stdout.write(base64.b64encode(f.read()).decode('ascii')) -" "$src_audio" > "$audio_b64_file" +" "$src_audio" > "$audio_b64_file" 2>/dev/null; then + python -c " +import base64, sys +with open(sys.argv[1], 'rb') as f: + sys.stdout.write(base64.b64encode(f.read()).decode('ascii')) +" "$src_audio" > "$audio_b64_file" || { + echo -e "${RED}Error: python3 or python required for audio encoding${NC}" + rm -f "$audio_b64_file" + exit 1 + } + fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/acestep/scripts/acestep.sh around lines 925 - 929, The base64 encoding invocation currently hardcodes "python3" and should mirror the decode_base64_audio fallback by using python3 if available otherwise falling back to python; update the block that converts "$src_audio" into "$audio_b64_file" (the inline Python snippet invoked for encoding) to first detect command availability (e.g., via command -v python3 || command -v python) and call the discovered interpreter to run the same base64 encode snippet so both encoding and decode paths support systems where only "python" exists.
886-886: Static analysis: Declare and assign separately to avoid masking return values.Per SC2155, combining
localwith command substitution masks the command's exit code.Suggested fix
- local api_mode=$(load_api_mode) + local api_mode + api_mode=$(load_api_mode)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/acestep/scripts/acestep.sh at line 886, The command substitution for api_mode currently combines declaration and assignment which masks the exit status; change to declare the variable first (local api_mode) and then assign via a separate command substitution (api_mode=$(load_api_mode)), preserving the return code from load_api_mode so callers can detect failures — update the occurrence that uses load_api_mode and the api_mode variable accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/skills/acestep/scripts/acestep.sh:
- Around line 925-929: The base64 encoding invocation currently hardcodes
"python3" and should mirror the decode_base64_audio fallback by using python3 if
available otherwise falling back to python; update the block that converts
"$src_audio" into "$audio_b64_file" (the inline Python snippet invoked for
encoding) to first detect command availability (e.g., via command -v python3 ||
command -v python) and call the discovered interpreter to run the same base64
encode snippet so both encoding and decode paths support systems where only
"python" exists.
- Line 886: The command substitution for api_mode currently combines declaration
and assignment which masks the exit status; change to declare the variable first
(local api_mode) and then assign via a separate command substitution
(api_mode=$(load_api_mode)), preserving the return code from load_api_mode so
callers can detect failures — update the occurrence that uses load_api_mode and
the api_mode variable accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 06f11776-10f6-449b-a6d7-c3fd134debfe
📒 Files selected for processing (2)
.claude/skills/acestep/SKILL.md.claude/skills/acestep/scripts/acestep.sh
…#777](ace-step/ACE-Step-1.5#777)) Add `cover` command and audio input support to the acestep.sh script, enabling song covers and audio repainting via both completion and native API modes. - Add `cover` command as shortcut for `generate --src-audio --task-type cover` - Add --src-audio, --task-type, --cover-strength, --repaint-start, --repaint-end options - Add --key-scale and --time-signature options for music attributes - Encode audio as base64 via python3 for completion mode (avoids shell arg limits) - Add User-Agent header to fix Cloudflare 1010 errors on large payloads - Update SKILL.md with cover/repainting documentation and examples Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
covercommand and--src-audiooption toacestep.shfor song covers and audio repainting--task-type(cover/repaint),--cover-strength,--repaint-start/end,--key-scale,--time-signatureoptionsUser-Agentheader to curl requestsUsage
Test plan
covercommand with compressed audio on cloud API — verified workinggenerateandrandomcommands unaffected🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation