{"id":19544645,"url":"https://github.com/freshlybrewedcode/aniorg","last_synced_at":"2026-05-15T15:34:05.349Z","repository":{"id":124155416,"uuid":"550753081","full_name":"FreshlyBrewedCode/aniorg","owner":"FreshlyBrewedCode","description":"A simple CLI for organizing your anime collection","archived":false,"fork":false,"pushed_at":"2022-10-17T20:08:33.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T19:20:15.442Z","etag":null,"topics":["anime","cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreshlyBrewedCode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-13T09:15:28.000Z","updated_at":"2022-10-14T10:39:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe95a2e8-9128-49ad-b599-deb44ebc05d8","html_url":"https://github.com/FreshlyBrewedCode/aniorg","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreshlyBrewedCode%2Faniorg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreshlyBrewedCode%2Faniorg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreshlyBrewedCode%2Faniorg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreshlyBrewedCode%2Faniorg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreshlyBrewedCode","download_url":"https://codeload.github.com/FreshlyBrewedCode/aniorg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240801039,"owners_count":19859727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anime","cli"],"created_at":"2024-11-11T03:30:16.167Z","updated_at":"2026-05-15T15:34:00.324Z","avatar_url":"https://github.com/FreshlyBrewedCode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- [![Contributors][contributors-shield]][contributors-url] --\u003e\n\u003c!-- [![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url] --\u003e\n[![NPM][npm-shield]][npm-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- \u003ca href=\"https://github.com/FreshlyBrewedCode/aniorg\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e --\u003e\n\n  \u003ch1 align=\"center\"\u003eAniorg\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    A simple CLI for organizing your anime collection\n    \u003cbr /\u003e\n    \u003c!-- \u003ca href=\"https://github.com/FreshlyBrewedCode/aniorg\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e --\u003e\n    \u003c!-- \u003cbr /\u003e --\u003e\n    \u003c!-- \u003cbr /\u003e --\u003e\n    \u003ca href=\"#installation\"\u003eInstall\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/FreshlyBrewedCode/aniorg/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/FreshlyBrewedCode/aniorg/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [About The Project](#about-the-project)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Basic usage](#basic-usage)\n  - [Config file](#config-file)\n  - [Using templates](#using-templates)\n  - [Fetching meta data from Anilist](#fetching-meta-data-from-anilist)\n  - [Manually passing options](#manually-passing-options)\n  - [Subtitles](#subtitles)\n- [License](#license)\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n\u003c!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) --\u003e\n\nMedia servers like Plex or Jellyfin are great for accessing your local collection of movies and shows. They even provide options for automatically downloading and displaying metadata for your media from online databases like IMDB, AniDB, etc. However, these media servers work best if you organize your media in a clean and predictable way on disk. \n\nAniorg is a super simple CLI for organizing your media. It allows you to specify a naming template and copyies/moves/links media files to a new path based on the template and different meta information. I created aniorg specifically for organizing anime. It allows you to pass in the [Anilist][anilist-url] ID of a show which will fetch additional meta information for the show (e.g. title, episode count, year, studio, etc.) which can be used in the naming template. However, aniorg could also be used to organize other types of media or files.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n## Installation\n\nIf you have not already, install [Node](https://nodejs.org/en/download/).\n\nInstall aniorg globally from npm:\n```\nnpm install -g aniorg\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n## Usage\n\nYou can run `aniorg --help` to get an overview of the available options:\n```\nUsage: aniorg [options]\n\nOptions:\n  -V, --version                 output the version number\n  -c, --config \u003cpath\u003e           path to config file\n  --verbose                     verbose output (default: false)\n  -s, --search \u003cquery\u003e          search for an anime on anilist\n  -i, --info \u003cid\u003e               get anime info by id\n  --season \u003cseason index\u003e       the season used for the template (default: 1)\n  --silent                      don't ask for confirmation (default: false)\n  -m --mode [copy|move|link]    the mode used to rename the file (default: \"move\")\n  -g, --glob \u003cpattern\u003e          glob pattern used to find episode files\n  -t, --template \u003ctemplate\u003e     template used to rename files\n  -o, --options \u003ckey=value...\u003e  options used in the template (default: {})\n  -a, --anilist                 anilist id used to fetch meta data for the template\n  -h, --help                    display help for command\n```\n\n### Basic usage\n\nYou run aniorg from within your unorganized media directory. All configuration can be passed in as options:\n```\naniorg --glob \"*.mkv\" --template \"/anime/{{title}}/{{title}} {{episode}}.{{ext}}\" --mode copy --anilist \u003cid\u003e \n```\n\n### Config file\n\nTypically you would also want to use very similar options when running aniorg. You can create a config file that serves like a set of default options. You can still override them by explicitly passing them to the command. Aniorg will search up the directory tree for a config file so you could put the config file in the parent directory for your unorganized media:\n```yaml\n# .aniorgrc.yml\ntemplate: \"{{env.MEDIA_PATH}}/{{title}}/{{title}} {{episode}}.{{ext}}\"\nglob: \"*.{mp4,mkv}\" # include mp4 and mkv files\n\n# default values for env variables used in the template\n# you can override these values using the environment variables of your shell\nenv: \n    MEDIA_PATH: /media \n```\n\nThe config file can be a `yaml`, `json`, or `js` file. To be auto discovered it should be called `.aniorgrc.\u003cext\u003e`. You can also explicity pass the path to the config file using the `--config` flag.\n\nUsing a `js` file gives you the most flexibility. You could e.g. have a base configuration and import it in another config file:\n```js\n// .aniorgrc.js\nconst baseConfig = require(\"./baseConfig.js\");\n\n// Use base config but override a specific variable\nmodule.exports = {\n  ...baseConfig,\n  env: {\n    SOME_VAR_USED_IN_BASE_CONFIG: \"new value\"\n  }\n}\n``` \nSee the subtitles section below for a practical example.\n\n### Using templates\n\nAniorg uses a template for organizing media files. The template is a [mustache][mustache-url] template that determines the new path of each media file. The template can inject meta information for the current anime and file:\n\n| Key           | Type     | Description                                                                                                                    |\n| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| `filename`    | string   | the name of the original file                                                                                                  |\n| `ext`         | string   | the file extension (without leading period character) of the original file                                                     |\n| `title`       | string*  | the english title of the anime                                                                                                 |\n| `titleRomaji` | string*  | the ramaji title of the anime                                                                                                  |\n| `titleNative` | string*  | the native japanese title (i.e. in kana/kanji) of the anime                                                                    |\n| `episode`     | number** | the episode index of the current file                                                                                          |\n| `season`      | number** | the season index of the current anime. This is NOT determined automatically but has to be configured using the `--season` flag |\n| `year`        | number   | the year in which the anime aired                                                                                              |\n| `anime`       | object   | the `media` object returned by the Anilist API for the specified anime                                                         |\n| `env`         | object   | an object containing all environment variables                                                                                 |\n\n\\*some strings include \"simplified\" (no special characters) and \"safe\" (no special characters and whitespaces) variants e.g. `titleSimple` and `titleSafe`.\n\n\\*\\*some numbers include zero padded variants (i.e. `01`, `001`) e.g. `episode0`, `episode00`\n\n### Fetching meta data from Anilist\n\nSince I built aniorg mainly for organizing anime, I added the option to fetch meta information from Anilist. You can search for a specific anime using the `--search` flag:\n```\naniorg --search \"K on\"\nID         English                 Romaji                          Native                                            \n5680       K-ON!                   K-ON!                           けいおん!                                             \n14467      K                       K                               K                                                 \n7791       K-ON! Season 2          K-ON!!                          けいおん!!                                            \n9617       K-ON!: The Movie        K-ON! Movie                     映画けいおん！                                           \n6862       K-ON!: Live House!      K-ON!: Live House!              けいおん! ライブハウス!                                     \n109670     N/A                     K: Seven Stories - The Idol K   K Seven Stories ザ・アイドルK                           \n9203       K-ON! Season 2 Shorts   K-ON!!: Ura-On!!                うらおん!!                                            \n9734       K-ON! Season 2: Plan!   K-ON!!: Keikaku!                けいおん!! 計画!                                        \n115437     N/A                     K×Drop!!                        K×Drop!!                                          \n7017       K-ON! Season 1 Shorts   K-ON!: Ura-On!                  うらおん!\n```\nit will show you the 10 top results and you can copy the id of the matching anime.\n\nThen when you run aniorg for your media files you can pass the id:\n```\naniorg --mode copy --anilist 5680 \n```\n\nThis will make the meta information for the show available in your template:\n```\n{{title}} -\u003e K-ON! \n```\n\n### Manually passing options\n\nYou don't have to pass an Anilist id. You can also provide the template options manually:\n```\naniorg --mode copy --options \"title=K-ON!\" year=2009\n```\n```\n{{title}} -\u003e K-ON!\n{{year}} -\u003e 2009\n```\n\n### Subtitles\n\nSometimes you may want to also move subtitle files (or any other additional file) to the new path. Aniorg does not provide a specific option for that but you could just run aniorg with a different glob and template. You could even create a custom config for subs that you can reference using the `--config` flag whenever you want to organize subs. If you use a `js` config file you can even share a common config between media and substile files:\n```js\n// common.js\n// common config file\nconst dirTemplate =\n  \"{{env.ANIME}}/{{title}}\";\nconst fileNameTemplate =\n  \"{{title}} - {{episode0}}\";\n\nmodule.exports = {\n  dirTemplate,\n  fileNameTemplate,\n  template: `${dirTemplate}/${fileNameTemplate}.{{ext}}`,\n  glob: \"*.{mkv,mp4}\",\n};\n```\n\n```js\n// .aniorgrc.js\n// main config file for media\nmodule.exports = require(\"./common\");\n```\n\n```js\n// subs.js\n// config file for (japanese) subtitles\nconst common = require(\"./common\");\nconst { dirTemplate, fileNameTemplate } = common;\n\nmodule.exports = {\n  ...common,\n  template: `${dirTemplate}/${fileNameTemplate}.{{env.SUBS_LANG}}.{{ext}}`,\n  glob: \"*.{ass,srt}\",\n  env: {\n    ...common.env,\n    SUBS_LANG: \"jp\",\n  },\n};\n```\nIf you look at `subs.js` you can see that the the template is based on the template defined in `common.js`.\n\nThen when you organize your media just run aniorg two times:\n```bash\n# organize media\naniorg --mode copy -a \u003cid\u003e \n\n# organize subs\naniorg --config ./subs.js --mode copy -a \u003cid\u003e \n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/FreshlyBrewedCode/aniorg.svg?style=for-the-badge\n[contributors-url]: https://github.com/FreshlyBrewedCode/aniorg/graphs/contributors\n[npm-shield]: https://img.shields.io/npm/v/aniorg?style=for-the-badge\n[npm-url]: https://www.npmjs.com/package/aniorg\n[forks-shield]: https://img.shields.io/github/forks/FreshlyBrewedCode/aniorg.svg?style=for-the-badge\n[forks-url]: https://github.com/FreshlyBrewedCode/aniorg/network/members\n[stars-shield]: https://img.shields.io/github/stars/FreshlyBrewedCode/aniorg.svg?style=for-the-badge\n[stars-url]: https://github.com/FreshlyBrewedCode/aniorg/stargazers\n[issues-shield]: https://img.shields.io/github/issues/FreshlyBrewedCode/aniorg.svg?style=for-the-badge\n[issues-url]: https://github.com/FreshlyBrewedCode/aniorg/issues\n[license-shield]: https://img.shields.io/github/license/FreshlyBrewedCode/aniorg.svg?style=for-the-badge\n[license-url]: https://github.com/FreshlyBrewedCode/aniorg/blob/master/LICENSE\n[anilist-url]: https://anilist.co/\n[mustache-url]: https://github.com/janl/mustache.js\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreshlybrewedcode%2Faniorg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreshlybrewedcode%2Faniorg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreshlybrewedcode%2Faniorg/lists"}