# Libraries

CLI, AI engine, and runtime engines shipped with Frakment.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

Frakment ships three runtime layers beyond the component registry. Each is MIT licensed, fully in-repo, and independently installable.

## Layers [#layers]

| Layer            | Import                    | Purpose                                  | Status                 |
| ---------------- | ------------------------- | ---------------------------------------- | ---------------------- |
| **frakment CLI** | `npx frakment@latest ...` | Install components + theme               | Stable                 |
| **AI engine**    | `@frakment/ai`            | Deterministic chat engine (`createChat`) | Stable |

## Design principles [#design-principles]

- **Zero external engine dependencies.** Every runtime layer is a first-party Frakment package, published on npm.
- **Deterministic.** No network calls, no model invocations. Same input → same output.
- **Composable.** CLI, AI engine, and React engine are independently installable.
- **Contract-first.** When replacing an existing library, the public API and behaviour match the contract consumers already rely on — no surprises.

## Distribution [#distribution]

| Layer                            | Installed via                    |
| -------------------------------- | -------------------------------- |
| Components (`button`, `card`, …) | `npx frakment@latest add <name>` |
| Theme (tokens + utilities)       | `npx frakment@latest init`       |
| AI engine (`@frakment/ai`)       | `npm install @frakment/ai`       |

## Quick links [#quick-links]

- **[CLI](/docs/libraries/cli)** — `init`, `add`, `list` commands and flags
- **[AI engine](/docs/libraries/ai)** — `createChat()` chainable API, transport, tools, approvals