Skip to content

Commit 3d42b9e

Browse files
guitaripodclaude
andcommitted
Enhance README with comprehensive examples and clearer documentation
- Add command usage patterns at the top of Usage section - Enhance examples with more specific use cases from help system - Convert flag documentation to table format for better readability - Add advanced search examples section - Improve troubleshooting section with common issues and solutions - Update all command examples to use consistent 'songlink-cli' format - Add note about built-in help system in features - Make action options clearer with bullet formatting The README now better reflects the capabilities shown in the comprehensive help system, making it easier for users to understand all available features at a glance. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent e1eafea commit 3d42b9e

File tree

1 file changed

+100
-38
lines changed

1 file changed

+100
-38
lines changed

README.md

Lines changed: 100 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A Go program that retrieves Songlink and Spotify links for a given URL using the
2525
- Supports command line arguments for customizing the output format
2626
- Automatically copies the output to the clipboard for easy sharing
2727
- Includes a loading indicator to provide visual feedback during the retrieval process
28+
- Comprehensive built-in help system (`songlink-cli --help`)
2829
- Thoroughly tested with unit tests to ensure reliability and correctness
2930

3031
## Installation
@@ -46,8 +47,8 @@ brew install songlink-cli
4647
1. Clone the repository: `git clone https://github.com/guitaripod/songlink-cli.git`
4748
2. Navigate to the project directory: `cd songlink-cli`
4849
3. Install dependencies: `go mod download`
49-
4. Build the executable: `go build -o songlink .`
50-
5. Run the program: `./songlink`
50+
4. Build the executable: `go build -o songlink-cli .`
51+
5. Run the program: `./songlink-cli`
5152

5253
### Download Pre-built Binaries
5354

@@ -81,15 +82,23 @@ sudo pacman -S yt-dlp ffmpeg
8182

8283
## Usage
8384

85+
```
86+
songlink-cli [flags] Process URL from clipboard
87+
songlink-cli <command> [flags] <args> Run a specific command
88+
songlink-cli help <command> Show help for a command
89+
```
90+
91+
Run `songlink-cli --help` for comprehensive documentation of all features.
92+
8493
<details>
8594
<summary><strong>📋 Process URL from Clipboard</strong></summary>
8695

8796
1. Copy the URL of the song or album you want to retrieve links for.
8897
2. Run the program using one of the following commands:
89-
- `./songlink`: Retrieves only the Songlink URL
90-
- `./songlink -x`: Retrieves the Songlink URL without surrounding `<>`. For Twitter
91-
- `./songlink -d`: Retrieves the Songlink URL surrounded by `<>` and the Spotify URL. For Discord.
92-
- `./songlink -s`: Retrieves only the Spotify URL
98+
- `songlink-cli`: Retrieves only the Songlink URL
99+
- `songlink-cli -x`: Retrieves the Songlink URL without surrounding `<>` (for Twitter)
100+
- `songlink-cli -d`: Retrieves the Songlink URL surrounded by `<>` and the Spotify URL (for Discord)
101+
- `songlink-cli -s`: Retrieves only the Spotify URL
93102
3. The program will automatically retrieve the Songlink and/or Spotify link for the song or album and copy it to your clipboard.
94103

95104
</details>
@@ -100,24 +109,40 @@ sudo pacman -S yt-dlp ffmpeg
100109
### Basic Search
101110

102111
1. Configure your Apple Music API credentials (first time only):
103-
```
104-
./songlink config
112+
```bash
113+
songlink-cli config
105114
```
106115

107116
2. Search for a song or album:
108-
```
109-
./songlink search "song or album name"
117+
```bash
118+
songlink-cli search "song or album name"
110119
```
111120

112121
3. Select from the search results by entering the number.
113122

114123
4. After selecting a result, you will be prompted to choose an action:
115-
1) Copy the song.link + Spotify URL to clipboard
116-
2) Download the full track as MP3
117-
3) Download a video (MP4) with the album artwork
124+
- **Option 1**: Copy the song.link + Spotify URL to clipboard
125+
- **Option 2**: Download the full track as MP3
126+
- **Option 3**: Download a video (MP4) with the album artwork
118127

119128
5. If you choose to download, the file(s) will be saved in the `downloads/` directory by default.
120129

130+
### Advanced Search Examples
131+
132+
```bash
133+
# Search for a specific song
134+
songlink-cli search "Bohemian Rhapsody"
135+
136+
# Search for albums only
137+
songlink-cli search -type=album "Abbey Road"
138+
139+
# Search and format for Discord sharing
140+
songlink-cli search -d "Hotel California"
141+
142+
# Search with custom download directory
143+
songlink-cli search -out=~/Music "Imagine"
144+
```
145+
121146
### Search Flags
122147

123148
- `-type=song`: Search for songs only (default)
@@ -142,14 +167,27 @@ Download individual tracks as audio files or videos with artwork.
142167

143168
### Flags
144169

145-
- `-type=song` / `album` / `both` (default: song) — Type of Apple Music search.
146-
- `-format=mp3` / `mp4` (default: mp3) — Download as an audio file (MP3) or a video with artwork (MP4).
147-
- `-out=DIR` (default: downloads) — Directory to save the downloaded files.
170+
| Flag | Options | Default | Description |
171+
|------|---------|---------|-------------|
172+
| `-type` | `song`, `album` | `song` | Type of Apple Music search |
173+
| `-format` | `mp3`, `mp4` | `mp3` | Download format (MP3 audio or MP4 video with artwork) |
174+
| `-out` | Directory path | `downloads` | Output directory for downloaded files |
175+
| `-debug` | - | `false` | Show yt-dlp and ffmpeg output |
148176

149-
### Example
177+
### Examples
150178

151179
```bash
152-
./songlink download -type=song -format=mp4 "Purple Rain"
180+
# Download a song as MP3 (default)
181+
songlink-cli download "Stairway to Heaven"
182+
183+
# Download as MP4 with album artwork
184+
songlink-cli download -format=mp4 "Purple Rain"
185+
186+
# Download to custom directory
187+
songlink-cli download -out=~/Music "Yesterday"
188+
189+
# Download with debug output
190+
songlink-cli download -debug "Wonderwall"
153191
```
154192

155193
</details>
@@ -177,11 +215,13 @@ Download all tracks from an Apple Music playlist or album URL.
177215

178216
### Flags
179217

180-
- `--format=mp3` / `mp4` (default: mp3) — Download format for all tracks
181-
- `--out=DIR` (default: downloads) — Output directory for downloaded files
182-
- `--concurrent=N` (default: 3) — Number of parallel downloads
183-
- `--metadata` — Save playlist/album metadata as JSON
184-
- `--debug` — Show detailed download progress and debug info
218+
| Flag | Options | Default | Description |
219+
|------|---------|---------|-------------|
220+
| `--format` | `mp3`, `mp4` | `mp3` | Download format for all tracks |
221+
| `--out` | Directory path | `downloads` | Output directory for downloaded files |
222+
| `--concurrent` | `1-10` | `3` | Number of parallel downloads |
223+
| `--metadata` | - | `false` | Save playlist/album metadata as JSON |
224+
| `--debug` | - | `false` | Show detailed download progress and debug info |
185225

186226
### Examples
187227

@@ -206,11 +246,17 @@ Download all tracks from an Apple Music playlist or album URL.
206246

207247
### Troubleshooting
208248

209-
If you get a "404 Resource Not Found" error:
249+
#### 404 Resource Not Found Errors
210250
- The playlist/album may be region-locked
211-
- The content may have been removed
251+
- The content may have been removed
212252
- Try using a different storefront in the URL (e.g., `/us/`, `/gb/`, `/jp/`)
213253

254+
#### Download Failures
255+
- Ensure `yt-dlp` and `ffmpeg` are installed and up to date
256+
- Some tracks may not be available on YouTube
257+
- Try reducing `--concurrent` value if experiencing rate limits
258+
- Use `--debug` flag to see detailed error messages
259+
214260
</details>
215261

216262
<details>
@@ -242,49 +288,65 @@ Your credentials will be securely stored in `~/.songlink-cli/config.json`
242288
<details>
243289
<summary><strong>📚 Quick Examples</strong></summary>
244290

245-
### Link Retrieval
291+
### Link Retrieval from Clipboard
246292

247293
```bash
248294
# Get Songlink URL (default)
249-
./songlink
295+
songlink-cli
250296

251297
# Get Songlink URL without <> for Twitter
252-
./songlink -x
298+
songlink-cli -x
253299

254300
# Get Songlink URL with <> + Spotify URL for Discord
255-
./songlink -d
301+
songlink-cli -d
256302

257303
# Get only Spotify URL
258-
./songlink -s
304+
songlink-cli -s
259305
```
260306

261307
### Search Examples
262308

263309
```bash
264310
# Search for a song
265-
./songlink search "Bohemian Rhapsody"
311+
songlink-cli search "Bohemian Rhapsody"
266312

267313
# Search for an album with Discord format
268-
./songlink search -type=album -d "Abbey Road"
314+
songlink-cli search -type=album -d "Abbey Road"
269315

270316
# Search for both songs and albums
271-
./songlink search -type=both "Beatles"
317+
songlink-cli search -type=both "Beatles"
318+
319+
# Search with custom download directory
320+
songlink-cli search -out=~/Downloads "Imagine"
272321
```
273322

274323
### Download Examples
275324

276325
```bash
277326
# Download a single track as MP3
278-
./songlink download "Purple Rain"
327+
songlink-cli download "Purple Rain"
279328

280329
# Download a single track as MP4 with artwork
281-
./songlink download -format=mp4 "Imagine"
330+
songlink-cli download -format=mp4 "Imagine"
282331

332+
# Download to specific directory with debug output
333+
songlink-cli download -out=~/Music -debug "Let It Be"
334+
```
335+
336+
### Playlist/Album Download Examples
337+
338+
```bash
283339
# Download an entire album
284-
./songlink playlist "https://music.apple.com/us/album/abbey-road/401469823"
340+
songlink-cli playlist "https://music.apple.com/us/album/abbey-road/401469823"
341+
342+
# Download playlist with metadata
343+
songlink-cli playlist --metadata "https://music.apple.com/us/playlist/top-100-global/pl.d25f5d1181894928af76c85c967f8f31"
344+
345+
# Fast download with 5 workers and MP4 format
346+
songlink-cli playlist --concurrent=5 --format=mp4 "https://music.apple.com/album/..."
285347

286-
# Download album with metadata and custom settings
287-
./songlink playlist --metadata --out=my-music --concurrent=5 "https://music.apple.com/us/album/..."
348+
# Download with all options
349+
songlink-cli playlist --format=mp4 --out=my-music --concurrent=5 --metadata --debug "https://music.apple.com/playlist/..."
288350
```
289351

290352
</details>

0 commit comments

Comments
 (0)