update reame for readability

This commit is contained in:
2026-05-24 14:12:20 +00:00
Unverified
parent d56d4714db
commit e309c1d53c

159
README.md
View File

@@ -21,49 +21,28 @@ A simple, fast, and powerful CLI tool to search, view, and download guitar tabs
--- ---
## Installation & Compilation
Ensure you have [Go](https://go.dev/) (version 1.20 or higher) and [Node.js](https://nodejs.org/) installed (Node.js is used by the Songsterr download helper script).
1. Navigate to the project directory:
```bash
cd /srv/dev/tab-downloader
```
2. Build the binary:
```bash
go build -o tab-downloader main.go
```
---
## Running Tests
The project includes lightweight, zero-dependency unit tests for both the Go orchestrator and the TypeScript converter utilities.
### 1. Go Unit Tests
Run the Go test suite to verify GProTab path normalization, Songsterr name slugifying, and our multi-index selection range parser:
```bash
go test -v
```
### 2. TypeScript Unit Tests
Run the Node.js native test suite to verify Songsterr musical duration matching and General MIDI program mappings:
```bash
node --experimental-strip-types songsterr/duration-mapper.test.ts
```
---
## Usage ## Usage
### 1. Interactive TUI Mode ### Flags
Run the compiled binary with no arguments to launch the colorized interactive menu: The complete list of supported command-line flags:
| Flag | Type | Default | Description |
| ------------------ | -------- | ----------- | --------------------------------------------------------------------------------------------------------------- |
| `-site` | `string` | `songsterr` | Select source website: `'songsterr'` or `'gprotab'`. |
| `-search-artist` | `string` | `""` | Search for artists matching the query and print a beautiful Unicode table. |
| `-search-song` | `string` | `""` | Search for songs matching the query and print a beautiful Unicode table. |
| `-download-artist` | `string` | `""` | Download tabs for an artist (prompts with interactive selection). Accepts artist name query, slug, or full URL. |
| `-download-song` | `string` | `""` | Download a single song tab. Accepts song name query, slug, or full URL. |
| `-output` | `string` | `downloads` | Destination directory for downloaded files. |
| `-delay` | `int` | `1000` | Delay in milliseconds between downloads in batch/artist mode. |
---
### Interactive Mode
- Run the compiled binary with no arguments to launch the colorized interactive menu:
```bash ```bash
./tab-downloader ./tab-downloader
@@ -83,38 +62,35 @@ Example prompt:
Enter choice (1-6): Enter choice (1-6):
``` ```
--- ### Search
### 2. Automated CLI Mode (Flags) - **Search using Songsterr** (default)
For automated pipelines or direct searches, run the command with flags.
#### Search for Artists
# Search using Songsterr (default)
```bash ```bash
./tab-downloader -search-artist "The Eagles" ./tab-downloader -search-artist "The Eagles"
``` ```
# Search on GProTab.net specifically - **Search on GProTab.net**
```bash ```bash
./tab-downloader -search-artist "The Eagles" -site gprotab ./tab-downloader -search-artist "The Eagles" -site gprotab
``` ```
#### Search for Songs - **Search for Songs**
```bash ```bash
./tab-downloader -search-song "Hotel California" ./tab-downloader -search-song "Hotel California"
``` ```
#### Download a Specific Song ### Download
- **Downloads the song** (automatically falling back to GProTab.net if Songsterr fails)
# Downloads the song (automatically falling back to GProTab.net if Songsterr fails)
```bash ```bash
./tab-downloader -download-song "Hotel California" -output ./my_tabs ./tab-downloader -download-song "Hotel California" -output ./my_tabs
``` ```
#### Download All Tabs for an Artist - **Download All Tabs for an Artist**
Downloads tabs for an artist into a subdirectory named after the artist, with an interactive prompt allowing you to filter specific selections or download all by default: Downloads tabs for an artist into a subdirectory named after the artist, with an interactive prompt allowing you to filter specific selections or download all by default:
@@ -122,26 +98,77 @@ Downloads tabs for an artist into a subdirectory named after the artist, with an
./tab-downloader -download-artist "The Eagles" -output ./my_tabs ./tab-downloader -download-artist "The Eagles" -output ./my_tabs
``` ```
Terminal Prompt Example: Example:
```text ```bash
Enter selection (e.g., 1-5,7,10-12) or press Enter to download all [Default: all]: 1,3,5-7,10 wompmacho@docker:/srv/dev/tab-downloader$ ./tab-downloader -download-artist "Sky Eats Airplane"
[*] Trying Songsterr first for artist: Sky Eats Airplane
[*] Searching Songsterr for artist: Sky Eats Airplane
[+] Found 5 tabs for this artist on Songsterr.
┌─────┬──────────────────────┬───────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
│ Idx │ Song Title │ Artist │ URL │
├─────┼──────────────────────┼───────────────────┼───────────────────────────────────────────────────────────────────────────────────┤
│ 1 │ Giants In The Ocean │ Sky Eats Airplane │ https://www.songsterr.com/a/wsa/sky-eats-airplane-giants-in-the-ocean-tab-s386244 │
│ 2 │ She Is Just A Glitch │ Sky Eats Airplane │ https://www.songsterr.com/a/wsa/sky-eats-airplane-she-is-just-a-glitch-tab-s53681 │
│ 3 │ Photographic Memory │ Sky Eats Airplane │ https://www.songsterr.com/a/wsa/sky-eats-airplane-photographic-memory-tab-s79812 │
│ 4 │ Sound Of Symmetry │ Sky Eats Airplane │ https://www.songsterr.com/a/wsa/sky-eats-airplane-sound-of-symmetry-tab-s3385754 │
│ 5 │ Numbers │ Sky Eats Airplane │ https://www.songsterr.com/a/wsa/sky-eats-airplane-numbers-tab-s3799256 │
└─────┴──────────────────────┴───────────────────┴───────────────────────────────────────────────────────────────────────────────────┘
Enter selection (e.g., 1-5,7,10-12) or press Enter to download all [Default: all]:
[*] Downloading all songs.
[*] Downloading tabs to: downloads/Sky Eats Airplane
[1/5] Downloading: Giants In The Ocean
[+] Saved to: downloads/Sky Eats Airplane/Sky Eats Airplane - Giants In The Ocean.gp
[2/5] Downloading: She Is Just A Glitch
[+] Saved to: downloads/Sky Eats Airplane/Sky Eats Airplane - She Is Just A Glitch.gp
[3/5] Downloading: Photographic Memory
[+] Saved to: downloads/Sky Eats Airplane/Sky Eats Airplane - Photographic Memory.gp
[4/5] Downloading: Sound Of Symmetry
[+] Saved to: downloads/Sky Eats Airplane/Sky Eats Airplane - Sound Of Symmetry.gp
[5/5] Downloading: Numbers
[+] Saved to: downloads/Sky Eats Airplane/Sky Eats Airplane - Numbers.gp
[+] Finished downloading artist tabs from Songsterr!
``` ```
--- ---
## Technical Details & CLI Flags ## Development
The complete list of supported command-line flags: Ensure you have [Go](https://go.dev/) (version 1.20 or higher) and [Node.js](https://nodejs.org/) installed (Node.js is used by the Songsterr download helper script).
| Flag | Type | Default | Description | ### Build
| ------------------ | -------- | ----------- | --------------------------------------------------------------------------------------------------------------- |
| `-site` | `string` | `songsterr` | Select source website: `'songsterr'` or `'gprotab'`. | - **Navigate to the project directory**
| `-search-artist` | `string` | `""` | Search for artists matching the query and print a beautiful Unicode table. |
| `-search-song` | `string` | `""` | Search for songs matching the query and print a beautiful Unicode table. | ```bash
| `-download-artist` | `string` | `""` | Download tabs for an artist (prompts with interactive selection). Accepts artist name query, slug, or full URL. | cd /srv/dev/tab-downloader
| `-download-song` | `string` | `""` | Download a single song tab. Accepts song name query, slug, or full URL. | ```
| `-output` | `string` | `downloads` | Destination directory for downloaded files. |
| `-delay` | `int` | `1000` | Delay in milliseconds between downloads in batch/artist mode. | - **Build the binary**
```bash
go build -o tab-downloader main.go
```
### Test
The project includes lightweight, zero-dependency unit tests for both the Go orchestrator and the TypeScript converter utilities.
- **Go Unit Tests**
Run the Go test suite to verify GProTab path normalization, Songsterr name slugifying, and our multi-index selection range parser:
```bash
go test -v
```
- **TypeScript Unit Tests**
Run the Node.js native test suite to verify Songsterr musical duration matching and General MIDI program mappings:
```bash
node --experimental-strip-types songsterr/duration-mapper.test.ts
```
--- ---