Skip to content

Commit 3369368

Browse files
docs: add CLI documentation to TypeDoc (#90)
* docs: add CLI documentation to TypeDoc Add three comprehensive CLI guides (getting started, configuration, command reference) and configure TypeDoc to include them as project documents. This makes CLI documentation accessible alongside the SDK API reference. Also exclude CLI internals from the API docs to keep them focused on the SDK. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix: work around Readarr BookResource type incompatibility in CI The CI regenerates types from OpenAPI specs, producing BookResourceWritable as the body type which is structurally incompatible with BookResource due to deeply nested readonly variants. Use type assertions to bypass this. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent abb2506 commit 3369368

5 files changed

Lines changed: 424 additions & 4 deletions

File tree

docs/cli-commands.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
---
2+
title: CLI - Command Reference
3+
group: CLI
4+
---
5+
6+
# CLI Command Reference
7+
8+
Complete reference for all `tsarr` commands.
9+
10+
## Global Options
11+
12+
These flags are available on all service resource actions:
13+
14+
| Flag | Description |
15+
|------|-------------|
16+
| `--json` | Output as JSON |
17+
| `--table` | Output as formatted table |
18+
| `--quiet` / `-q` | Output only IDs |
19+
| `--yes` / `-y` | Skip confirmation prompts |
20+
21+
## Radarr (Movies)
22+
23+
```bash
24+
tsarr radarr <resource> <action> [args]
25+
```
26+
27+
| Resource | Action | Args | Description |
28+
|----------|--------|------|-------------|
29+
| `movie` | `list` | | List all movies |
30+
| `movie` | `get` | `<id>` | Get movie by ID |
31+
| `movie` | `search` | `<term>` | Search TMDB for movies |
32+
| `movie` | `delete` | `<id>` | Delete a movie |
33+
| `profile` | `list` | | List quality profiles |
34+
| `profile` | `get` | `<id>` | Get quality profile by ID |
35+
| `tag` | `list` | | List all tags |
36+
| `queue` | `list` | | Show download queue |
37+
| `queue` | `status` | | Queue overview |
38+
| `rootfolder` | `list` | | List root folders |
39+
| `system` | `status` | | System information |
40+
| `system` | `health` | | Health check issues |
41+
| `history` | `list` | | Recent activity |
42+
| `customformat` | `list` | | List custom formats |
43+
44+
## Sonarr (TV Shows)
45+
46+
```bash
47+
tsarr sonarr <resource> <action> [args]
48+
```
49+
50+
| Resource | Action | Args | Description |
51+
|----------|--------|------|-------------|
52+
| `series` | `list` | | List all series |
53+
| `series` | `get` | `<id>` | Get series by ID |
54+
| `series` | `search` | `<term>` | Search for TV series |
55+
| `series` | `delete` | `<id>` | Delete a series |
56+
| `episode` | `list` | | List all episodes |
57+
| `episode` | `get` | `<id>` | Get episode by ID |
58+
| `profile` | `list` | | List quality profiles |
59+
| `tag` | `list` | | List all tags |
60+
| `rootfolder` | `list` | | List root folders |
61+
| `system` | `status` | | System information |
62+
| `system` | `health` | | Health check issues |
63+
64+
## Lidarr (Music)
65+
66+
```bash
67+
tsarr lidarr <resource> <action> [args]
68+
```
69+
70+
| Resource | Action | Args | Description |
71+
|----------|--------|------|-------------|
72+
| `artist` | `list` | | List all artists |
73+
| `artist` | `get` | `<id>` | Get artist by ID |
74+
| `artist` | `search` | `<term>` | Search for artists |
75+
| `artist` | `delete` | `<id>` | Delete an artist |
76+
| `album` | `list` | | List all albums |
77+
| `album` | `get` | `<id>` | Get album by ID |
78+
| `album` | `search` | `<term>` | Search for albums |
79+
| `profile` | `list` | | List quality profiles |
80+
| `tag` | `list` | | List all tags |
81+
| `rootfolder` | `list` | | List root folders |
82+
| `system` | `status` | | System information |
83+
| `system` | `health` | | Health check issues |
84+
85+
## Readarr (Books)
86+
87+
```bash
88+
tsarr readarr <resource> <action> [args]
89+
```
90+
91+
| Resource | Action | Args | Description |
92+
|----------|--------|------|-------------|
93+
| `author` | `list` | | List all authors |
94+
| `author` | `get` | `<id>` | Get author by ID |
95+
| `author` | `search` | `<term>` | Search for authors |
96+
| `author` | `delete` | `<id>` | Delete an author |
97+
| `book` | `list` | | List all books |
98+
| `book` | `get` | `<id>` | Get book by ID |
99+
| `book` | `search` | `<term>` | Search for books |
100+
| `profile` | `list` | | List quality profiles |
101+
| `tag` | `list` | | List all tags |
102+
| `rootfolder` | `list` | | List root folders |
103+
| `system` | `status` | | System information |
104+
| `system` | `health` | | Health check issues |
105+
106+
## Prowlarr (Indexers)
107+
108+
```bash
109+
tsarr prowlarr <resource> <action> [args]
110+
```
111+
112+
| Resource | Action | Args | Description |
113+
|----------|--------|------|-------------|
114+
| `indexer` | `list` | | List all indexers |
115+
| `indexer` | `get` | `<id>` | Get indexer by ID |
116+
| `indexer` | `delete` | `<id>` | Delete an indexer |
117+
| `search` | `run` | `<query>` | Search across all indexers |
118+
| `app` | `list` | | List connected applications |
119+
| `app` | `get` | `<id>` | Get application by ID |
120+
| `tag` | `list` | | List all tags |
121+
| `system` | `status` | | System information |
122+
| `system` | `health` | | Health check issues |
123+
124+
## Bazarr (Subtitles)
125+
126+
```bash
127+
tsarr bazarr <resource> <action> [args]
128+
```
129+
130+
| Resource | Action | Args | Description |
131+
|----------|--------|------|-------------|
132+
| `series` | `list` | | List series with subtitle info |
133+
| `movie` | `list` | | List movies with subtitle info |
134+
| `episode` | `wanted` | | Episodes needing subtitles |
135+
| `provider` | `list` | | List subtitle providers |
136+
| `language` | `list` | | List available languages |
137+
| `language` | `profiles` | | List language profiles |
138+
| `system` | `status` | | System information |
139+
| `system` | `health` | | Health check issues |
140+
| `system` | `badges` | | Notification badges |
141+
142+
## Utility Commands
143+
144+
### Doctor
145+
146+
Test connectivity to all configured services:
147+
148+
```bash
149+
tsarr doctor
150+
```
151+
152+
### Config
153+
154+
Manage CLI configuration:
155+
156+
```bash
157+
tsarr config init # Interactive setup
158+
tsarr config set <key> <value> # Set a config value
159+
tsarr config get <key> # Get a config value
160+
tsarr config show # Show full merged config
161+
```
162+
163+
See [CLI Configuration](./cli-configuration.md) for details.
164+
165+
### Completions
166+
167+
Generate shell completions:
168+
169+
```bash
170+
tsarr completions bash
171+
tsarr completions zsh
172+
tsarr completions fish
173+
```

docs/cli-configuration.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: CLI - Configuration
3+
group: CLI
4+
---
5+
6+
# CLI Configuration
7+
8+
TsArr CLI supports three configuration sources, merged in order of precedence.
9+
10+
## Configuration Precedence
11+
12+
1. **Environment variables** (highest priority)
13+
2. **Local config** (`.tsarr.json` in project directory or parent)
14+
3. **Global config** (`~/.config/tsarr/config.json`)
15+
16+
## Config File Format
17+
18+
Both global and local config files use the same JSON format:
19+
20+
```json
21+
{
22+
"services": {
23+
"radarr": {
24+
"baseUrl": "http://localhost:7878",
25+
"apiKey": "your-api-key",
26+
"timeout": 30000,
27+
"headers": {
28+
"User-Agent": "MyApp/1.0"
29+
}
30+
},
31+
"sonarr": {
32+
"baseUrl": "http://localhost:8989",
33+
"apiKey": "your-api-key"
34+
}
35+
},
36+
"defaults": {
37+
"output": "table"
38+
}
39+
}
40+
```
41+
42+
### Service Properties
43+
44+
| Property | Type | Required | Description |
45+
|----------|------|----------|-------------|
46+
| `baseUrl` | `string` | Yes | Service URL (e.g. `http://localhost:7878`) |
47+
| `apiKey` | `string` | Yes | API authentication key |
48+
| `timeout` | `number` | No | Request timeout in milliseconds |
49+
| `headers` | `object` | No | Custom HTTP headers per request |
50+
51+
### Default Ports
52+
53+
| Service | Default Port |
54+
|---------|-------------|
55+
| Radarr | 7878 |
56+
| Sonarr | 8989 |
57+
| Lidarr | 8686 |
58+
| Readarr | 8787 |
59+
| Prowlarr | 9696 |
60+
| Bazarr | 6767 |
61+
62+
## Environment Variables
63+
64+
Each service supports four environment variables:
65+
66+
```bash
67+
TSARR_RADARR_URL=http://localhost:7878
68+
TSARR_RADARR_API_KEY=your-api-key
69+
TSARR_RADARR_TIMEOUT=30000
70+
TSARR_RADARR_HEADERS='{"User-Agent": "MyApp/1.0"}'
71+
```
72+
73+
Replace `RADARR` with the uppercase service name: `SONARR`, `LIDARR`, `READARR`, `PROWLARR`, `BAZARR`.
74+
75+
## Config Commands
76+
77+
### Interactive Setup
78+
79+
```bash
80+
tsarr config init
81+
```
82+
83+
Walks through service selection, URL/key input, and connection testing. Offers to save globally or locally.
84+
85+
### Set a Value
86+
87+
```bash
88+
# Set in global config (default)
89+
tsarr config set services.radarr.baseUrl http://localhost:7878
90+
91+
# Set in local config
92+
tsarr config set services.radarr.apiKey my-key --local
93+
```
94+
95+
### Get a Value
96+
97+
```bash
98+
tsarr config get services.radarr.baseUrl
99+
```
100+
101+
### Show Full Config
102+
103+
```bash
104+
tsarr config show
105+
```
106+
107+
Displays the merged configuration from all sources as formatted JSON.
108+
109+
## Local vs Global Config
110+
111+
- **Global** (`~/.config/tsarr/config.json`): Your default service connections, shared across all projects.
112+
- **Local** (`.tsarr.json`): Project-specific overrides. TsArr searches upward from the current directory. Useful for per-project service instances or team-shared configurations (commit it to your repo).

0 commit comments

Comments
 (0)