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

# Extensions

> What an extension is, installing one without a build toolchain, checking a manifest before you trust it, writing your own, and what happens when a plugin command collides with a built-in.

An extension adds commands to base. A manifest declares them, a handler implements them, and once installed `base <name>` works like anything else.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension list
```

`base ext` is the short alias, and it works everywhere the full name does.

## Installing one someone published

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension add ./base-extension.toml
```

**Why it works.** This reads the manifest's `[dist]` block, fetches the prebuilt binary for your machine from its GitHub release, verifies the checksum, unpacks it and installs it. No Rust, no build step, no toolchain.

**The gotcha.** If no prebuilt asset matches your machine, it falls back to building from local source, which does need a toolchain. That fallback is why the command sometimes takes minutes instead of seconds.

## Installing one from a local manifest

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension validate ./base-extension.toml
base extension install ./base-extension.toml
base extension install ./base-extension.toml --bundle
```

**Why `--bundle` matters.** Without it, the installed manifest points back at wherever the handler currently sits on disk. Move that folder, delete the repository, or clean a build directory, and the command breaks. With `--bundle`, the handler is copied into `~/.base-gbl/plugins/<name>/` and the manifest is repointed there, so the install is self-contained.

Use `--bundle` for anything you intend to keep.

**The gotcha.** Validate anything you did not write. `base extension validate` reads the manifest and reports whether it conforms without installing it, and it costs one command.

## Writing one

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension scaffold weather
base extension scaffold weather --path ~/dev --build --git
base extension scaffold weather --bootstrap
```

**Why it works.** The scaffold writes a conformant cross-platform plugin skeleton. The name you pass becomes the command, so `base extension scaffold weather` gives you `base weather`.

`--bootstrap` is the whole kickoff in one flag: write the files, build them, initialize a repository, create a private GitHub repository, wire the remote and push. It is the same as passing `--build --git --create-repo` together.

**Next rung.** `--repo owner/name` sets where releases come from, defaulting to `ChristopherKahler/<name>-cli`. Set it before your first release rather than after.

## When a name collides

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension run weather
```

**Why it works.** This runs a plugin command explicitly by name, and everything after the name is forwarded to the handler untouched. Where the bare `base weather` might be ambiguous, this form never is.

**The gotcha.** Collisions are quiet. If a plugin command shares a name with a built-in, the built-in is what you get. `base extension run` is the way to reach the plugin anyway.

## Extensions and domains

An installed extension can declare domains of its own. They merge into the same pool as yours, at the lowest priority, so a domain you define with the same name wins.

**Why this matters.** It means installing an extension can change what gets injected, not just what commands exist. `base domain list` shows the merged result, so check there after installing something that ships domains.

## Removing one

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base extension remove weather
```

No preview. The manifest goes; a bundled handler under `~/.base-gbl/plugins/` goes with it.

## Next

<CardGroup cols={2}>
  <Card title="Standards" icon="clipboard-check" href="/guides/standards">
    Protocols that fire when you edit a matching file.
  </Card>

  <Card title="Setup reference" icon="wrench" href="/reference/setup">
    Every `base extension` verb and flag.
  </Card>
</CardGroup>
