tsarr 1.12.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -5
- package/dist/cli/commands/bazarr.d.ts +2 -0
- package/dist/cli/commands/bazarr.d.ts.map +1 -0
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/lidarr.d.ts +2 -0
- package/dist/cli/commands/lidarr.d.ts.map +1 -0
- package/dist/cli/commands/prowlarr.d.ts +2 -0
- package/dist/cli/commands/prowlarr.d.ts.map +1 -0
- package/dist/cli/commands/radarr.d.ts +2 -0
- package/dist/cli/commands/radarr.d.ts.map +1 -0
- package/dist/cli/commands/readarr.d.ts +2 -0
- package/dist/cli/commands/readarr.d.ts.map +1 -0
- package/dist/cli/commands/service.d.ts +23 -0
- package/dist/cli/commands/service.d.ts.map +1 -0
- package/dist/cli/commands/sonarr.d.ts +2 -0
- package/dist/cli/commands/sonarr.d.ts.map +1 -0
- package/dist/cli/completions.d.ts +8 -0
- package/dist/cli/completions.d.ts.map +1 -0
- package/dist/cli/config.d.ts +25 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +16105 -0
- package/dist/cli/output.d.ts +12 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/prompt.d.ts +11 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/tsarr-2.0.0.tgz +0 -0
- package/package.json +14 -4
- package/dist/tsarr-1.12.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -7,31 +7,95 @@
|
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
[](https://github.com/robbeverhelst/Tsarr/actions)
|
|
9
9
|
|
|
10
|
-
**Type-safe TypeScript SDK for Servarr APIs (Radarr, Sonarr, etc.)**
|
|
10
|
+
**Type-safe TypeScript SDK and CLI for Servarr APIs (Radarr, Sonarr, etc.)**
|
|
11
11
|
|
|
12
|
-
Tsarr provides type-safe TypeScript clients for all Servarr APIs, generated from their Swagger/OpenAPI specifications.
|
|
12
|
+
Tsarr provides type-safe TypeScript clients and a CLI for all Servarr APIs, generated from their Swagger/OpenAPI specifications. Use it as an SDK in your code or as a standalone CLI tool.
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
15
|
|
|
16
16
|
- 🛡️ **Type-safe** - Generated from official Swagger/OpenAPI specs
|
|
17
17
|
- ⚡ **Bun-optimized** - Leverages native fetch API
|
|
18
18
|
- 📦 **Modular** - Separate clients for each Servarr app
|
|
19
|
+
- 💻 **CLI included** - Manage all Servarr apps from the terminal
|
|
19
20
|
|
|
20
21
|
## Supported Servarr Apps
|
|
21
22
|
|
|
22
23
|
- **Radarr** - Movie collection manager
|
|
23
|
-
- **Sonarr** - TV series collection manager
|
|
24
|
+
- **Sonarr** - TV series collection manager
|
|
24
25
|
- **Lidarr** - Music collection manager
|
|
25
26
|
- **Readarr** - Book collection manager
|
|
26
27
|
- **Prowlarr** - Indexer manager
|
|
28
|
+
- **Bazarr** - Subtitle manager
|
|
27
29
|
|
|
28
30
|
## Installation
|
|
29
31
|
|
|
30
32
|
```bash
|
|
33
|
+
# As a dependency (SDK)
|
|
31
34
|
bun add tsarr
|
|
35
|
+
|
|
36
|
+
# As a global CLI
|
|
37
|
+
bun add -g tsarr
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## CLI
|
|
41
|
+
|
|
42
|
+
### Setup
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Interactive setup wizard
|
|
46
|
+
tsarr config init
|
|
47
|
+
|
|
48
|
+
# Or configure manually
|
|
49
|
+
tsarr config set services.radarr.baseUrl http://localhost:7878
|
|
50
|
+
tsarr config set services.radarr.apiKey your-api-key
|
|
51
|
+
|
|
52
|
+
# Or use environment variables
|
|
53
|
+
export TSARR_RADARR_URL=http://localhost:7878
|
|
54
|
+
export TSARR_RADARR_API_KEY=your-api-key
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Config is stored in `~/.config/tsarr/config.json` (global) or `.tsarr.json` (local project). Environment variables take priority over config files.
|
|
58
|
+
|
|
59
|
+
### Usage
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
tsarr <service> <resource> <action> [options]
|
|
63
|
+
|
|
64
|
+
# Examples
|
|
65
|
+
tsarr radarr movie list
|
|
66
|
+
tsarr radarr movie search --term "Interstellar"
|
|
67
|
+
tsarr sonarr series list
|
|
68
|
+
tsarr prowlarr indexer list
|
|
69
|
+
tsarr lidarr artist search --term "Radiohead"
|
|
70
|
+
|
|
71
|
+
# Output formats
|
|
72
|
+
tsarr radarr movie list --table # Table (default in terminal)
|
|
73
|
+
tsarr radarr movie list --json # JSON (default when piped)
|
|
74
|
+
tsarr radarr movie list --quiet # IDs only
|
|
75
|
+
|
|
76
|
+
# Diagnostics
|
|
77
|
+
tsarr doctor # Test all configured connections
|
|
78
|
+
|
|
79
|
+
# Shell completions
|
|
80
|
+
tsarr completions bash >> ~/.bashrc
|
|
81
|
+
tsarr completions zsh >> ~/.zshrc
|
|
82
|
+
tsarr completions fish > ~/.config/fish/completions/tsarr.fish
|
|
32
83
|
```
|
|
33
84
|
|
|
34
|
-
|
|
85
|
+
### Available Commands
|
|
86
|
+
|
|
87
|
+
| Service | Resources |
|
|
88
|
+
|---------|-----------|
|
|
89
|
+
| `radarr` | movie, profile, tag, queue, rootfolder, system, history, customformat |
|
|
90
|
+
| `sonarr` | series, episode, profile, tag, rootfolder, system |
|
|
91
|
+
| `lidarr` | artist, album, profile, tag, rootfolder, system |
|
|
92
|
+
| `readarr` | author, book, profile, tag, rootfolder, system |
|
|
93
|
+
| `prowlarr` | indexer, search, app, tag, system |
|
|
94
|
+
| `bazarr` | series, movie, episode, provider, language, system |
|
|
95
|
+
|
|
96
|
+
## SDK
|
|
97
|
+
|
|
98
|
+
### Quick Start
|
|
35
99
|
|
|
36
100
|
```typescript
|
|
37
101
|
import { RadarrClient, SonarrClient, LidarrClient } from 'tsarr';
|
|
@@ -46,6 +110,15 @@ const movies = await radarr.getMovies();
|
|
|
46
110
|
const status = await radarr.getSystemStatus();
|
|
47
111
|
```
|
|
48
112
|
|
|
113
|
+
### Modular Imports
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// Import only what you need
|
|
117
|
+
import { RadarrClient } from 'tsarr/radarr';
|
|
118
|
+
import { SonarrClient } from 'tsarr/sonarr';
|
|
119
|
+
import type { MovieResource } from 'tsarr/radarr/types';
|
|
120
|
+
```
|
|
121
|
+
|
|
49
122
|
## Development
|
|
50
123
|
|
|
51
124
|
Install dependencies:
|
|
@@ -86,7 +159,7 @@ Perfect for building:
|
|
|
86
159
|
- **Automation scripts** - Bulk movie imports, library maintenance, and media organization
|
|
87
160
|
- **Management tools** - Custom dashboards, backup utilities, and monitoring scripts
|
|
88
161
|
- **Integration scripts** - Connect Servarr apps with other services and workflows
|
|
89
|
-
- **CLI
|
|
162
|
+
- **CLI usage** - Manage your media servers directly from the terminal
|
|
90
163
|
|
|
91
164
|
## Contributing
|
|
92
165
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bazarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/bazarr.ts"],"names":[],"mappings":"AA6FA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAmKA,eAAO,MAAM,MAAM,qDAWjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,MAAM,qDAyCjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lidarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lidarr.ts"],"names":[],"mappings":"AAqHA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prowlarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/prowlarr.ts"],"names":[],"mappings":"AA4FA,eAAO,MAAM,QAAQ,qDAKpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/radarr.ts"],"names":[],"mappings":"AA4IA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/readarr.ts"],"names":[],"mappings":"AAqHA,eAAO,MAAM,OAAO,qDAKnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ServarrClientConfig } from '../../core/types.js';
|
|
2
|
+
export interface ActionArg {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
type?: 'string' | 'number';
|
|
7
|
+
}
|
|
8
|
+
export interface ActionDef {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
args?: ActionArg[];
|
|
12
|
+
columns?: string[];
|
|
13
|
+
idField?: string;
|
|
14
|
+
confirmMessage?: string;
|
|
15
|
+
run: (client: any, args: Record<string, any>) => Promise<any>;
|
|
16
|
+
}
|
|
17
|
+
export interface ResourceDef {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
actions: ActionDef[];
|
|
21
|
+
}
|
|
22
|
+
export declare function buildServiceCommand(serviceName: string, description: string, clientFactory: (config: ServarrClientConfig) => any, resources: ResourceDef[]): import("citty").CommandDef<import("citty").ArgsDef>;
|
|
23
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,GAAG,EACnD,SAAS,EAAE,WAAW,EAAE,uDAwHzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sonarr.ts"],"names":[],"mappings":"AA8GA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/cli/completions.ts"],"names":[],"mappings":"AA4NA,eAAO,MAAM,WAAW;;;;;;EA4BtB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ServarrClientConfig } from '../core/types.js';
|
|
2
|
+
export interface ServiceConfig {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
apiKey: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TsarrCliConfig {
|
|
8
|
+
services: Record<string, ServiceConfig>;
|
|
9
|
+
defaults?: {
|
|
10
|
+
output?: 'json' | 'table' | 'quiet';
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const SERVICES: readonly ["radarr", "sonarr", "lidarr", "readarr", "prowlarr", "bazarr"];
|
|
14
|
+
declare const GLOBAL_CONFIG_PATH: string;
|
|
15
|
+
declare const LOCAL_CONFIG_NAME = ".tsarr.json";
|
|
16
|
+
export declare function loadConfig(): TsarrCliConfig;
|
|
17
|
+
export declare function getServiceConfig(serviceName: string): ServarrClientConfig | null;
|
|
18
|
+
export declare function saveGlobalConfig(config: TsarrCliConfig): void;
|
|
19
|
+
export declare function saveLocalConfig(config: TsarrCliConfig): void;
|
|
20
|
+
export declare function getConfigValue(key: string): string | undefined;
|
|
21
|
+
export declare function setConfigValue(key: string, value: string, global?: boolean): void;
|
|
22
|
+
export declare function getConfiguredServices(): string[];
|
|
23
|
+
export declare function loadScopedConfig(scope: 'global' | 'local'): Partial<TsarrCliConfig>;
|
|
24
|
+
export { SERVICES, GLOBAL_CONFIG_PATH, LOCAL_CONFIG_NAME };
|
|
25
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,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