🧩
Seanime Extensions
🧩
Seanime Extensions
  • Seanime
    • Getting started
    • Core APIs
    • Changelog
  • Content Providers
    • Write, test, share
    • Anime torrent provider
    • Manga provider
    • Online streaming provider
  • Plugins
    • Introduction
    • Write, test, share
    • APIs
      • Helpers
      • Store
      • Storage
      • Database
      • AniList
      • System
        • Permissions
        • OS
        • Filepath
        • Commands
        • Buffers, I/O
        • MIME
    • UI
      • Basics
      • User Interface
        • Tray
        • Toast
        • Screen
        • Command Palette
        • Action
        • DOM
      • Anime/Library
        • Anime
        • Playback
        • Continuity
        • Auto Downloader
        • Auto Scanner
        • Filler Manager
        • External Player Link
      • Downloading
        • Downloader
        • Torrent Client
      • Other
        • Manga
        • Discord
        • MPV
    • Hooks
    • Example
  • Frequently asked
    • Feature requests
Powered by GitBook
On this page
  • Permissions
  • Allow lists
  • Paths
  1. Plugins
  2. APIs
  3. System

Permissions

The System APIs give you access to a set of methods for file operations, downloading and more.

Difficulty: Moderate

  • Some knowledge of the filesystem, platform differences is required

You can check out the type definition file to see the exhaustive list of methods available and use Go's documentation to learn how to use them.

The examples may use hardcoded paths but this is not recommended. Seanime is a cross-platform app, keep that in mind.

Permissions

system permission is required.

my-plugin.json
{
    //...
    "plugin": {
        "permissions": {
            "scopes": ["system"]
        }
    }
}

Allow lists

By default, all commands you may try to execute and all directories and files you may try to read to write to will be restricted. You need to explicitly declare which command and the arguments you want to execute and which directories/files you want to read or write to.

{
    //...
    "plugin": {
        "permissions": ["system", ...],
        "systemAllowList": {
            "allowReadPaths": ["$TEMP/*"],
            "allowWritePaths": ["$TEMP/*"],
            "commandScopes": []
        }
    }
}

Paths

  • /path/to/dir/ - Matches only the specific directory

  • /path/to/dir/* - Matches all files in the directory, but not subdirectories

  • /path/to/dir/** - Matches all files and directories recursively

  • /path/to/dir/**/* - Same as above, matches all files and directories recursively

Here are pre-defined directory variables

  • $TEMP - The temp directory

  • $CACHE - The cache directory (LocalAppData on Windows)

  • $HOME - The home directory (%USERPROFILE% on Windows)

  • $CONFIG - The user config directory (AppData on Windows)

  • $DOWNLOAD - The download directory

  • $DOCUMENT - The document directory

  • $DESKTOP - The desktop directory

  • $SEANIME_ANIME_LIBRARY - Any of the user's anime library paths

PreviousSystemNextOS

Last updated 24 days ago