|
| 1 | +<p align="center"> |
| 2 | +<h1 align="center"><img style="color:#36BCF7; width:38px; height:38px;" src="https://raw.githubusercontent.com/adamhl8/inspectarr/refs/heads/main/assets/logo.svg"> Inspectarr</h1> |
| 3 | +</p> |
| 4 | + |
| 5 | +A CLI tool for querying and inspecting the media in your Radarr and Sonarr instances |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <img alt="demo" src="https://github.com/adamhl8/inspectarr/blob/main/assets/demo.gif"> |
| 9 | +</p> |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +<!-- toc --> |
| 14 | + |
| 15 | +- [Installation](#installation) |
| 16 | + - [Homebrew (macOS/Linux)](#homebrew-macoslinux) |
| 17 | + - [Scoop (Windows)](#scoop-windows) |
| 18 | + - [Manual](#manual) |
| 19 | +- [Usage](#usage) |
| 20 | + - [Setup](#setup) |
| 21 | + - [Basic Usage](#basic-usage) |
| 22 | + - [Queries](#queries) |
| 23 | + - [Inspectarr Flags](#inspectarr-flags) |
| 24 | + |
| 25 | +<!-- tocstop --> |
| 26 | + |
| 27 | +If you're looking for a tool to manage/change your \*arrs, check out [managarr](https://github.com/Dark-Alex-17/managarr). |
| 28 | + |
| 29 | +## Installation |
| 30 | + |
| 31 | +### Homebrew (macOS/Linux) |
| 32 | + |
| 33 | +```sh |
| 34 | +brew install adamhl8/inspectarr/inspectarr |
| 35 | +``` |
| 36 | + |
| 37 | +### Scoop (Windows) |
| 38 | + |
| 39 | +```sh |
| 40 | +scoop bucket add inspectarr https://github.com/adamhl8/scoop-inspectarr.git |
| 41 | +scoop install inspectarr |
| 42 | +``` |
| 43 | + |
| 44 | +### Manual |
| 45 | + |
| 46 | +Binaries are available on the [releases](https://github.com/adamhl8/inspectarr/releases) page. |
| 47 | + |
| 48 | +<details> |
| 49 | + <summary><i>Why are the binaries so big?</i></summary> |
| 50 | + This project is written in TypeScript and the binaries are generated via <a href="https://bun.com/docs/bundler/executables">Bun's compile feature</a>. The Bun runtime itself is included in the binary, hence the size. |
| 51 | +</details> |
| 52 | + |
| 53 | +## Usage |
| 54 | + |
| 55 | +### Setup |
| 56 | + |
| 57 | +Inspectarr requires your Radarr/Sonarr URL and API key to connect to your instances. You can provide these via: |
| 58 | + |
| 59 | +- Environment variables: `RADARR_URL`, `RADARR_API_KEY`, `SONARR_URL`, `SONARR_API_KEY` |
| 60 | +- Or directly when running Inspectarr: |
| 61 | + - e.g. `inspectarr radarr --url "your-radarr-url" --api-key 'your-api-key'` |
| 62 | + |
| 63 | +### Basic Usage |
| 64 | + |
| 65 | +Using Inspectarr generally looks like this: `inspectarr <radarr|sonarr> [flags]... [query]` |
| 66 | + |
| 67 | +- Use `--help` to see all of the available flags on a subcommand: `inspectarr sonarr --help` |
| 68 | + |
| 69 | +Running Inspectarr without a query will display _all_ of your downloaded media: |
| 70 | + |
| 71 | +```sh |
| 72 | +inspectarr radarr |
| 73 | +``` |
| 74 | + |
| 75 | +- By default, Inspectarr outputs a markdown table of the results. |
| 76 | + |
| 77 | +You can also output the results as JSON if you want to do some further processing (pipe it to another command, etc.): |
| 78 | + |
| 79 | +```sh |
| 80 | +inspectarr sonarr --output json | json_pp |
| 81 | +``` |
| 82 | + |
| 83 | +### Queries |
| 84 | + |
| 85 | +Inspectarr uses [FilterQL](https://github.com/adamhl8/filterql) to filter/transform the results. See the [FilterQL readme](https://github.com/adamhl8/filterql#queries) for all of the available features. |
| 86 | + |
| 87 | +**Examples:** |
| 88 | + |
| 89 | +```sh |
| 90 | +# display media with a bluray source and 1080p (resolution starts with 1920) |
| 91 | +inspectarr radarr 'source == bluray && resolution ^= 1920' |
| 92 | + |
| 93 | +# display media from specific release groups |
| 94 | +inspectarr sonarr 'releaseGroup == AMZN || releaseGroup == NF' |
| 95 | + |
| 96 | +# display media where the title contains 'star wars' (case-insensitive) |
| 97 | +inspectarr sonarr 'title i*= "star wars"' |
| 98 | + |
| 99 | +# display media released after 1990 (media year is contained in the title column), then sort by title |
| 100 | +inspectarr radarr 'title *= 1990 | SORT title' |
| 101 | + |
| 102 | +# displayed media where monitored is true and where the video codec is x265 (contains '265') |
| 103 | +inspectarr radarr 'monitored && videoCodec *= 265' |
| 104 | +``` |
| 105 | + |
| 106 | +#### Fields |
| 107 | + |
| 108 | +**General fields:** |
| 109 | + |
| 110 | +- `title` (alias: `t`) - Media title |
| 111 | +- `monitored` (alias: `m`) - Whether the media is monitored |
| 112 | +- `releaseGroup` (alias: `rg`) - Release group name |
| 113 | +- `source` (alias: `src`) - Media source (bluray, webdl, etc.) |
| 114 | +- `videoCodec` (alias: `vc`) - Video codec (x264, x265, etc.) |
| 115 | +- `audioCodec` (alias: `ac`) - Audio codec with audio channel info |
| 116 | +- `resolution` (alias: `rs`) - Video resolution |
| 117 | +- `size` (alias: `sz`) - File size |
| 118 | + |
| 119 | +**Sonarr-specific fields:** |
| 120 | + |
| 121 | +- `type` - Series type (standard, anime, daily) |
| 122 | +- `season` (alias: `s`) - Season number |
| 123 | +- `episode` (alias: `e`) - Episode number |
| 124 | + |
| 125 | +#### Operations |
| 126 | + |
| 127 | +In addition to the [built-in FilterQL operations](https://github.com/adamhl8/filterql#operations), the following operations are available: |
| 128 | + |
| 129 | +- `EXCLUDE`: Exclude the given fields/columns from the output |
| 130 | + - `EXCLUDE [field]...` |
| 131 | + |
| 132 | +```sh |
| 133 | +# display media with a bluray source and exclude the 'resolution' and 'size' columns |
| 134 | +inspectarr radarr 'source == bluray | EXCLUDE resolution size' |
| 135 | +``` |
| 136 | + |
| 137 | +### Inspectarr Flags |
| 138 | + |
| 139 | +**General flags:** |
| 140 | + |
| 141 | +- `--url`: The URL of the instance (default: the "\<SERVICE\>\_URL" environment variable) |
| 142 | +- `--api-key`: The API key for the instance (default: the "\<SERVICE\>\_API_KEY" environment variable) |
| 143 | +- `--output <md|json>`: The type of output to generate ("json" implies --quiet) (default: "md") |
| 144 | +- `--quiet`: Suppress all output except the markdown/JSON |
| 145 | +- `--short-headers`: Use the field aliases as the markdown table headers (can help reduce the width of the table) |
| 146 | + |
| 147 | +**Sonarr-specific flags:** |
| 148 | + |
| 149 | +By default, media from Sonarr is displayed by series. |
| 150 | + |
| 151 | +- `--by-season`: Display media by individual season |
| 152 | +- `--by-episode`: Display media by individual episode |
0 commit comments