> ## 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.

# LLM Generation

> Generate scripts, themes, and layouts with AI

Flume can generate scripts, themes, and layouts from natural language descriptions using your own LLM API key.

## Setup

```
/generate init
```

This walks you through interactively:

1. Choose a provider — type `1` for Anthropic (Claude) or `2` for OpenAI (GPT)
2. Paste your API key — stored automatically in the encrypted vault

The provider and model are saved to `config.toml` and the key to the vault. Works immediately in the same session — no restart needed.

Or set up manually — see [LLM Configuration](/configuration/llm).

## Generate a Script

```
/generate script --name greeter greet users who join my channels
/generate script --python --name urlbot log all URLs posted in channels
/generate script auto-respond when someone mentions my nick
```

Use `--name <name>` to set the filename. Default language is Lua; use `--python` or `--lua` to choose.

## Generate a Theme

```
/generate theme --name midnight dark blue background with warm orange accents
/generate theme --name github-light light mode inspired by GitHub
/generate theme cyberpunk neon with purple and green
```

Use `--name <name>` to set the theme filename. Without it, the name is derived from your description.

## Generate a Layout

Layout generation creates a **split profile** — it picks which two buffers to show side-by-side and the split direction. It does not change the TUI chrome (panels, status bar).

```
/generate layout --name monitoring #ops on the left and #alerts on the right
/generate layout horizontal split with server on top and #general below
/generate layout --name dev 70/30 split with #main on the left and #logs on the right
```

## Review and Accept

Generated content appears in a split preview pane with line numbers. Then:

```
/generate accept    # save and apply
/generate reject    # discard
```

* **Scripts** are saved to `scripts/generated/` and auto-loaded
* **Themes** are saved to `themes/` and applied immediately
* **Layouts** are saved to `layouts/` for use with `/layout load`
