> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flumeirc.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Script Commands

> Load, manage, and install Lua and Python scripts

## Local Scripts

### /script load

```
/script load <name>
/script load /path/to/script.lua
```

Load a script by name (searches autoload and available dirs) or by full path. Supports `.lua` and `.py` files.

### /script unload

```
/script unload <name>
```

Unload a script and remove its event handlers and commands.

### /script reload

```
/script reload <name>
```

Reload a script from disk (useful during development).

### /script autoload

```
/script autoload <name>
```

Add a script to the autoload directory so it loads on every startup.

### /script noautoload

```
/script noautoload <name>
```

Remove a script from autoload.

### /script list

```
/script list
```

Show loaded scripts with their versions and source (registry or local), plus any custom commands they registered.

```
Loaded scripts:
  8ball          v1.0.0 (registry)
  xauth          v1.0.0 (registry)
  my-custom      (local)
Script commands:
  /8ball
  /xauth
```

## Script Registry

Flume has a built-in script registry client that connects to [scripts.flumeirc.io](https://scripts.flumeirc.io) — a community-maintained collection of scripts.

### /script search

```
/script search <query>
```

Search the registry by name, description, tags, or author.

```
/script search weather
/script search auth
/script search fun
```

### /script install

```
/script install <name>
```

Download a script from the registry, save it to the autoload directory, and load it immediately.

```
/script install 8ball
```

The script is version-checked against your Flume version. If external dependencies are required (e.g., Python packages), you'll see a note.

### /script update

```
/script update           # update all registry scripts
/script update <name>    # update a specific script
```

Checks the registry for newer versions of installed scripts and downloads updates.

### /script info

```
/script info <name>
```

Show full details about a registry script: version, author, language, category, tags, dependencies, compatibility, and whether it's installed.

### /script registry refresh

```
/script registry refresh
```

Force-refresh the registry index cache. The cache is normally refreshed every 24 hours automatically.

## Script Command Help

Scripts can register commands with help text:

```lua theme={null}
flume.command.register("greet", function(args)
    flume.buffer.print("", "", "Hello " .. args)
end, "Greet someone by name")
```

Users can then type `/help greet` to see the help text.

## Script Directories

| Directory                                       | Purpose                          |
| ----------------------------------------------- | -------------------------------- |
| `~/.local/share/flume/scripts/lua/autoload/`    | Lua scripts loaded on startup    |
| `~/.local/share/flume/scripts/python/autoload/` | Python scripts loaded on startup |
| `~/.local/share/flume/scripts/available/`       | Installed but not auto-loaded    |
| `~/.local/share/flume/scripts/generated/`       | Created by `/generate script`    |

<Note>
  Scripts autoload **after** the vault is unlocked, so scripts that read secrets via `flume.vault.get()` at module load time will work correctly.
</Note>
