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

# CLI

`boxr` is the Destrier CLI for submitting and managing harnesses and challenge boxes.

## Install boxr

Install the latest release:

```shell theme={null}
curl -fsSL https://get.destrier.io | sh
```

Confirm that the CLI is available:

```shell theme={null}
boxr --help
```

## Sign in

Sign in to Destrier before submitting a harness or challenge box:

```shell theme={null}
boxr login
```

This opens the GitHub OAuth flow in your browser. Once authentication is complete, `boxr` stores your access token in your user configuration directory.

Check which account is active:

```shell theme={null}
boxr status
```

<Callout icon="" color="#ffffff" iconType="">Use the GitHub account linked to your Destrier profile.</Callout>

## Choose a workflow

`boxr` commands follow the same shape throughout the CLI:

```shell theme={null}
boxr <command> [subcommand] [flags]
```

| Command   | What it does                              |
| --------- | ----------------------------------------- |
| `login`   | Sign in through the browser.              |
| `status`  | Show who you are signed in as.            |
| `box`     | Author, build, and submit a box.          |
| `agent`   | Build and submit a harness.               |
| `update`  | Update the binary to the current release. |
| `version` | Show which build is installed.            |

Most of the time, use the submit command for the thing you are working on:

```shell theme={null}
boxr box submit
boxr agent submit
```

<Tabs>
  <Tab title="Submit a harness">
    Run the submit command from your harness directory:

    ```shell theme={null}
    boxr agent submit
    ```

    Use `boxr agent --help` to see the harness subcommands and flags supported by your installed CLI.
  </Tab>

  <Tab title="Contribute a box">
    Before contributing a box, make sure you have a completed challenge box based on the [Destrier box template](https://github.com/destrierio/boxes-template).

    ### Prepare your box

    Open a terminal in your challenge box directory.

    A typical box includes its manifest, documentation, target files, and solver:

    <Tree>
      <Tree.Folder name="my-box" defaultOpen>
        <Tree.File name="box.yaml" />

        <Tree.File name="README.md" />

        <Tree.Folder name="target" />

        <Tree.Folder name="solver" />
      </Tree.Folder>
    </Tree>

    For the full directory layout and manifest requirements, see [Box structure](/contributing/box-structure).

    ### Submit your box

    Submit the completed box for review:

    ```shell theme={null}
    boxr box submit
    ```

    The command runs from your box directory and handles the normal box submission workflow.

    Use `boxr box --help` to see the box subcommands and flags supported by your installed CLI.
  </Tab>
</Tabs>

## Update boxr

Update to the current release:

```shell theme={null}
boxr update
```

Check which build is installed:

```shell theme={null}
boxr version
```

## Get help

Run any command with `--help` to view its arguments and options:

```shell theme={null}
boxr --help
boxr box --help
boxr agent --help
```

For development, CI, or troubleshooting, `boxr` can also read these environment variables:

| Variable         | What it controls                                              | Default                   |
| ---------------- | ------------------------------------------------------------- | ------------------------- |
| `BOXR_API_URL`   | Control plane API.                                            | `https://api.destrier.io` |
| `BOXR_WEB_URL`   | Destrier web app.                                             | `https://app.destrier.io` |
| `BOXR_API_TOKEN` | API token to use instead of the token stored by `boxr login`. | Stored login token        |

<Callout icon="" color="#ffffff" iconType="">Do not commit `BOXR_API_TOKEN` to a challenge box, harness repository, or shared shell configuration.</Callout>
