Permissions

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

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

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

Last updated