tsarr 1.12.0 → 2.1.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 +82 -6
- 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 +16 -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 +26 -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 +16230 -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/clients/bazarr.d.ts.map +1 -1
- package/dist/clients/bazarr.js +10 -1
- package/dist/index.js +13 -13
- package/dist/tsarr-2.1.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,97 @@
|
|
|
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
|
|
32
38
|
```
|
|
33
39
|
|
|
34
|
-
##
|
|
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
|
|
83
|
+
```
|
|
84
|
+
|
|
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
|
+
See the [CLI Guide](./docs/cli.md) for full documentation including all commands, scripting examples, and shell completions.
|
|
97
|
+
|
|
98
|
+
## SDK
|
|
99
|
+
|
|
100
|
+
### Quick Start
|
|
35
101
|
|
|
36
102
|
```typescript
|
|
37
103
|
import { RadarrClient, SonarrClient, LidarrClient } from 'tsarr';
|
|
@@ -46,6 +112,15 @@ const movies = await radarr.getMovies();
|
|
|
46
112
|
const status = await radarr.getSystemStatus();
|
|
47
113
|
```
|
|
48
114
|
|
|
115
|
+
### Modular Imports
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
// Import only what you need
|
|
119
|
+
import { RadarrClient } from 'tsarr/radarr';
|
|
120
|
+
import { SonarrClient } from 'tsarr/sonarr';
|
|
121
|
+
import type { MovieResource } from 'tsarr/radarr/types';
|
|
122
|
+
```
|
|
123
|
+
|
|
49
124
|
## Development
|
|
50
125
|
|
|
51
126
|
Install dependencies:
|
|
@@ -75,8 +150,9 @@ bun run format
|
|
|
75
150
|
|
|
76
151
|
## 📖 Documentation
|
|
77
152
|
|
|
153
|
+
- [CLI Guide](./docs/cli.md) - Complete CLI documentation with all commands and scripting examples
|
|
154
|
+
- [SDK Usage Guide](./docs/usage.md) - SDK usage documentation with examples
|
|
78
155
|
- [API Documentation](https://robbeverhelst.github.io/Tsarr/) - Auto-generated TypeScript API docs
|
|
79
|
-
- [Usage Guide](./docs/usage.md) - Complete usage documentation with examples
|
|
80
156
|
- [Examples](./docs/examples.md) - Real-world automation examples
|
|
81
157
|
- [Examples Directory](./examples/) - Runnable example scripts
|
|
82
158
|
|
|
@@ -86,7 +162,7 @@ Perfect for building:
|
|
|
86
162
|
- **Automation scripts** - Bulk movie imports, library maintenance, and media organization
|
|
87
163
|
- **Management tools** - Custom dashboards, backup utilities, and monitoring scripts
|
|
88
164
|
- **Integration scripts** - Connect Servarr apps with other services and workflows
|
|
89
|
-
- **CLI
|
|
165
|
+
- **CLI usage** - Manage your media servers directly from the terminal
|
|
90
166
|
|
|
91
167
|
## Contributing
|
|
92
168
|
|
|
@@ -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,16 @@
|
|
|
1
|
+
export declare const doctor: import("citty").CommandDef<{
|
|
2
|
+
readonly json: {
|
|
3
|
+
readonly type: "boolean";
|
|
4
|
+
readonly description: "Output as JSON";
|
|
5
|
+
};
|
|
6
|
+
readonly table: {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
readonly description: "Output as table";
|
|
9
|
+
};
|
|
10
|
+
readonly quiet: {
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
readonly alias: "q";
|
|
13
|
+
readonly description: "Output service names only";
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;EA2EjB,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,uDAgIzB"}
|
|
@@ -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,26 @@
|
|
|
1
|
+
import type { ServarrClientConfig } from '../core/types.js';
|
|
2
|
+
export interface ServiceConfig {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
apiKey: string;
|
|
5
|
+
apiKeyFile?: string;
|
|
6
|
+
timeout?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TsarrCliConfig {
|
|
9
|
+
services: Record<string, ServiceConfig>;
|
|
10
|
+
defaults?: {
|
|
11
|
+
output?: 'json' | 'table' | 'quiet';
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const SERVICES: readonly ["radarr", "sonarr", "lidarr", "readarr", "prowlarr", "bazarr"];
|
|
15
|
+
declare const GLOBAL_CONFIG_PATH: string;
|
|
16
|
+
declare const LOCAL_CONFIG_NAME = ".tsarr.json";
|
|
17
|
+
export declare function loadConfig(): TsarrCliConfig;
|
|
18
|
+
export declare function getServiceConfig(serviceName: string): ServarrClientConfig | null;
|
|
19
|
+
export declare function saveGlobalConfig(config: TsarrCliConfig): void;
|
|
20
|
+
export declare function saveLocalConfig(config: TsarrCliConfig): void;
|
|
21
|
+
export declare function getConfigValue(key: string): string | undefined;
|
|
22
|
+
export declare function setConfigValue(key: string, value: string, global?: boolean): void;
|
|
23
|
+
export declare function getConfiguredServices(): string[];
|
|
24
|
+
export declare function loadScopedConfig(scope: 'global' | 'local'): Partial<TsarrCliConfig>;
|
|
25
|
+
export { SERVICES, GLOBAL_CONFIG_PATH, LOCAL_CONFIG_NAME };
|
|
26
|
+
//# 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,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;KACrC,CAAC;CACH;AAED,QAAA,MAAM,QAAQ,0EAA2E,CAAC;AAE1F,QAAA,MAAM,kBAAkB,QAAyC,CAAC;AAClE,QAAA,MAAM,iBAAiB,gBAAgB,CAAC;AAsExC,wBAAgB,UAAU,IAAI,cAAc,CA+B3C;AA0CD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAsBhF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAG7D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAI5D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS9D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,IAAI,CAoB9E;AAcD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAKhD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAMnF;AAED,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|