@@ -25,6 +25,7 @@ A Go program that retrieves Songlink and Spotify links for a given URL using the
25
25
- Supports command line arguments for customizing the output format
26
26
- Automatically copies the output to the clipboard for easy sharing
27
27
- Includes a loading indicator to provide visual feedback during the retrieval process
28
+ - Comprehensive built-in help system (` songlink-cli --help ` )
28
29
- Thoroughly tested with unit tests to ensure reliability and correctness
29
30
30
31
## Installation
@@ -46,8 +47,8 @@ brew install songlink-cli
46
47
1 . Clone the repository: ` git clone https://github.com/guitaripod/songlink-cli.git `
47
48
2 . Navigate to the project directory: ` cd songlink-cli `
48
49
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 `
51
52
52
53
### Download Pre-built Binaries
53
54
@@ -81,15 +82,23 @@ sudo pacman -S yt-dlp ffmpeg
81
82
82
83
## Usage
83
84
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
+
84
93
<details >
85
94
<summary ><strong >📋 Process URL from Clipboard</strong ></summary >
86
95
87
96
1 . Copy the URL of the song or album you want to retrieve links for.
88
97
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
93
102
3 . The program will automatically retrieve the Songlink and/or Spotify link for the song or album and copy it to your clipboard.
94
103
95
104
</details >
@@ -100,24 +109,40 @@ sudo pacman -S yt-dlp ffmpeg
100
109
### Basic Search
101
110
102
111
1 . Configure your Apple Music API credentials (first time only):
103
- ```
104
- ./ songlink config
112
+ ``` bash
113
+ songlink-cli config
105
114
```
106
115
107
116
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"
110
119
```
111
120
112
121
3 . Select from the search results by entering the number.
113
122
114
123
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
118
127
119
128
5 . If you choose to download, the file(s) will be saved in the ` downloads/ ` directory by default.
120
129
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
+
121
146
### Search Flags
122
147
123
148
- ` -type=song ` : Search for songs only (default)
@@ -142,14 +167,27 @@ Download individual tracks as audio files or videos with artwork.
142
167
143
168
### Flags
144
169
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 |
148
176
149
- ### Example
177
+ ### Examples
150
178
151
179
``` 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"
153
191
```
154
192
155
193
</details >
@@ -177,11 +215,13 @@ Download all tracks from an Apple Music playlist or album URL.
177
215
178
216
### Flags
179
217
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 |
185
225
186
226
### Examples
187
227
@@ -206,11 +246,17 @@ Download all tracks from an Apple Music playlist or album URL.
206
246
207
247
### Troubleshooting
208
248
209
- If you get a " 404 Resource Not Found" error:
249
+ #### 404 Resource Not Found Errors
210
250
- The playlist/album may be region-locked
211
- - The content may have been removed
251
+ - The content may have been removed
212
252
- Try using a different storefront in the URL (e.g., ` /us/ ` , ` /gb/ ` , ` /jp/ ` )
213
253
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
+
214
260
</details >
215
261
216
262
<details >
@@ -242,49 +288,65 @@ Your credentials will be securely stored in `~/.songlink-cli/config.json`
242
288
<details >
243
289
<summary ><strong >📚 Quick Examples</strong ></summary >
244
290
245
- ### Link Retrieval
291
+ ### Link Retrieval from Clipboard
246
292
247
293
``` bash
248
294
# Get Songlink URL (default)
249
- ./ songlink
295
+ songlink-cli
250
296
251
297
# Get Songlink URL without <> for Twitter
252
- ./ songlink -x
298
+ songlink-cli -x
253
299
254
300
# Get Songlink URL with <> + Spotify URL for Discord
255
- ./ songlink -d
301
+ songlink-cli -d
256
302
257
303
# Get only Spotify URL
258
- ./ songlink -s
304
+ songlink-cli -s
259
305
```
260
306
261
307
### Search Examples
262
308
263
309
``` bash
264
310
# Search for a song
265
- ./ songlink search " Bohemian Rhapsody"
311
+ songlink-cli search " Bohemian Rhapsody"
266
312
267
313
# Search for an album with Discord format
268
- ./ songlink search -type=album -d " Abbey Road"
314
+ songlink-cli search -type=album -d " Abbey Road"
269
315
270
316
# 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"
272
321
```
273
322
274
323
### Download Examples
275
324
276
325
``` bash
277
326
# Download a single track as MP3
278
- ./ songlink download " Purple Rain"
327
+ songlink-cli download " Purple Rain"
279
328
280
329
# Download a single track as MP4 with artwork
281
- ./ songlink download -format=mp4 " Imagine"
330
+ songlink-cli download -format=mp4 " Imagine"
282
331
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
283
339
# 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/..."
285
347
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 /..."
288
350
```
289
351
290
352
</details >
0 commit comments