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

# Setup & Prerequisites

> Install the CLI, an adapter, and a token

What you need before adding, authoring, or publishing facets. If you just want to try a facet, the [Quickstart](/quickstart) is faster.

> **Setting up the facet CLI? Read the CLI's own agent instructions first:**
>
> ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
> facet instructions usage   # install, adapters, and project setup, headless
> ```
>
> See [`facet instructions`](/cli/instructions).

<Steps>
  <Step title="Install the CLI">
    <CodeGroup>
      ```sh curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
      curl -fsSL https://agentfacets.io/install | bash
      ```

      ```sh npm theme={"theme":{"light":"github-light","dark":"github-dark"}}
      npm install -g agent-facets
      ```

      ```sh bun theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bun add -g agent-facets
      ```
    </CodeGroup>

    Keep it current with [`facet self-update`](/cli/self-update) — the newer authoring commands need **v0.24.0+**:

    ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
    facet --version
    facet self-update   # update in place if needed
    ```
  </Step>

  <Step title="Connect an adapter (required before adding facets)">
    A facet is only useful once it's materialized into an AI tool, which the <Tooltip tip="An adapter is the bridge between facet and a specific AI coding tool.">adapter</Tooltip> handles. Install one per machine with [`facet adapter install`](/cli/adapters/install):

    ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
    facet adapter install claude-code   # or: opencode, codex
    facet adapter list
    ```

    <Note>
      Without an adapter, [`facet add`](/cli/add) shows a picker in a terminal — and **fails** in a non-interactive shell (CI). Install one first.
    </Note>
  </Step>

  <Step title="Create a registry account + token">
    Adding public facets needs no account. A token is what unlocks the rest: **publishing** your own facets, plus **accessing private or organization-owned facets** you're authorized to use. Sign up at [agentfacets.io](https://agentfacets.io) and create a <Tooltip tip="A revocable credential you mint in the web UI to authenticate the CLI to the registry.">personal access token (PAT)</Tooltip> in your account settings. Sign in with [`facet login`](/cli/login) and confirm with [`facet whoami`](/cli/whoami):

    ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
    facet login                     # interactive; stores the token
    export FACET_TOKEN=fct_pub_…    # or, preferred for CI/scripts
    facet whoami                    # confirm the signed-in identity
    ```
  </Step>
</Steps>

## Verify your setup

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
facet --version        # CLI is installed and recent
facet adapter list     # at least one adapter connected
facet whoami           # signed in (needed to publish and to reach private facets)
```

## Next steps

<CardGroup cols={2}>
  <Card title="Install facets" icon="download" href="/guides/install-facets">
    Add, pin, reinstall, and remove facets.
  </Card>

  <Card title="Create your first facet" icon="hammer" href="/guides/create-your-first-facet">
    Scaffold, author, build, and verify.
  </Card>
</CardGroup>
