Chape is a powerful command-line tool for editing MP3 metadata using YAML format. It provides an intuitive way to manage ID3v2 tags, chapters, and artwork in MP3 files.
- YAML-based metadata editing: Edit MP3 metadata using familiar YAML syntax
- Chapter support: Manage chapter markers for audiobooks and podcasts
- Artwork management: Handle embedded artwork with support for local files, URLs, and data URIs
- Interactive editing: Built-in editor support for seamless workflow
Interactive editing with your EDITOR:
chape audio.mp3Dump metadata to YAML:
chape dump audio.mp3 > metadata.yamlApply YAML metadata to MP3:
chape apply audio.mp3 < metadata.yaml-y: Skip confirmation prompts (useful for automation)--artwork <path>: Override artwork with local file path or HTTP/HTTPS URL
Edit metadata interactively:
chape my-audiobook.mp3Edit metadata with custom artwork:
chape --artwork cover.jpg my-audiobook.mp3Batch processing with automation:
chape apply -y audio.mp3 < batch-metadata.yamlChape uses a structured YAML format for metadata:
title: "My Audiobook"
subtitle: "Unabridged Edition"
artist: "Author Name"
album: "Book Series"
albumArtist: "Publisher"
grouping: "Volume 1: The Beginning"
date: "2024"
track: "1/12"
disc: "1/2"
genre: "Audiobook"
comment: "A great book"
composer: "Author Name"
publisher: "Publisher Name"
copyright: "© 2024 Publisher Name"
language: "eng"
bpm: 120
artwork: "cover.jpg"
lyrics: |
Chapter content here...
chapters:
- 0:00 Introduction
- 5:30 Chapter 1: Getting Started
- 15:45 Chapter 2: Advanced Topics
- 28:20 Chapter 3: Conclusion| Field | Description | ID3v2 Tag |
|---|---|---|
title |
Song/track title (podcast: episode title) | TIT2 |
subtitle |
Subtitle/description refinement | TIT3 |
artist |
Primary artist (podcast: host name) | TPE1 |
album |
Album title (podcast: show name) | TALB |
albumArtist |
Album artist (podcast: network/publisher) | TPE2 |
grouping |
Content group (e.g., work/movement, season) | TIT1 |
date |
Recording date | TDRC |
track |
Track number (podcast: episode number) | TRCK |
disc |
Disc number (podcast: season number) | TPOS |
genre |
Music genre (podcast: "Podcast" or category) | TCON |
comment |
Comments (podcast: episode description) | COMM |
composer |
Composer (podcast: producer) | TCOM |
publisher |
Publisher (podcast: network/platform) | TPUB |
copyright |
Copyright message | TCOP |
language |
Language code (e.g., "eng", "jpn") | TLAN |
bpm |
Beats per minute | TBPM |
artwork |
Artwork (file path, URL, or data URI) | APIC |
lyrics |
Lyrics text (podcast: transcript) | USLT |
chapters |
Chapter markers with timestamps | CHAP |
The date field supports ISO 8601 format with varying precision:
2024(year only)2024-03(year-month)2024-03-15(year-month-day)2024-03-15T14:30(with time)2024-03-15T14:30:45(with seconds)
Chapters use WebVTT-style time format with titles:
chapters:
- 0:00 Introduction
- 1:05:30 Long chapter (over 1 hour)
- 1:23.500 Chapter with millisecondsChape supports multiple artwork sources:
- Local file paths:
artwork: "cover.jpg" - HTTP/HTTPS URLs:
artwork: "https://example.com/cover.jpg" - Data URIs:
artwork: "data:image/jpeg;base64,/9j/4AAQ..."
When you specify an artwork path that doesn't exist, Chape will:
- Check if the MP3 has embedded artwork
- Automatically extract and save it to the specified path
- Update the metadata to reference the new file
Chape integrates with your preferred text editor for seamless metadata editing:
# Uses $EDITOR environment variable
export EDITOR=nano
chape audio.mp3Use the -y flag for non-interactive batch processing:
#!/bin/bash
for file in *.mp3; do
echo "title: $(basename "$file" .mp3)" | chape apply -y "$file"
doneExtract artwork from MP3 files:
# This will extract artwork to cover.jpg if it doesn't exist
echo 'artwork: cover.jpg' | chape apply audio.mp3Override artwork source:
chape --artwork https://example.com/new-cover.jpg audio.mp3% brew install Songmu/tap/chape
# Install the latest version. (Install it into ./bin/ by default).
% curl -sfL https://raw.githubusercontent.com/Songmu/chape/main/install.sh | sh -s
# Specify installation directory ($(go env GOPATH)/bin/) and version.
% curl -sfL https://raw.githubusercontent.com/Songmu/chape/main/install.sh | sh -s -- -b $(go env GOPATH)/bin [vX.Y.Z]
# In alpine linux (as it does not come with curl by default)
% wget -O - -q https://raw.githubusercontent.com/Songmu/chape/main/install.sh | sh -s [vX.Y.Z]
# go install
% go install github.com/Songmu/chape/cmd/chape@latest