# `Beamlet.CLI`
[🔗](https://github.com/aaronrussell/beamlet/blob/v0.1.0/lib/beamlet/cli.ex#L1)

The command line for setting up the owner and managing tokens and
policies on your beamlet.

## Commands

### `beamlet setup`

Sets the owner's email and password, which sign in to the app at
`/beamlet`. Run it again to change either. A blank password keeps
the current one, and a new password signs every browser out.

### `beamlet tokens`

Lists every token with its id, policy and expiry. Tokens created
here show their name. Tokens a chat client received through OAuth
show the client's host.

### `beamlet tokens.create <NAME> [--policy POLICY]`

Creates a token and prints its secret. The secret is shown only
this once, so copy it into your MCP client now. The token gets
the `default` policy unless `--policy` names another.

### `beamlet tokens.update <ID> [--name NEW_NAME] [--policy POLICY]`

Renames a token or changes its policy, from the client's next
request. OAuth tokens cannot be changed. Delete one and connect
the client again instead.

### `beamlet tokens.delete <ID>`

Deletes a token of either kind. A client using it is refused from
its next request.

### `beamlet policies`

Lists the policies you can give a token: `default`, and any
declared in config.

### `beamlet policies.show <POLICY>`

Shows what a policy allows: its tools, its rules, and the modules
it denies or grants only in part.

### `beamlet reset`

Deletes everything agents have built: the routes, the agent
database, the code dir with its history, and the files dir. The
owner, the tokens and your `config.exs` are kept. Restart the
beamlet afterwards, since until then it keeps running what it had
loaded.

# `main`

```elixir
@spec main([String.t()]) :: :ok | :error
```

Runs one command from its arguments, printing the outcome.

Usage goes to stdout, errors to stderr. Returns `:ok` when the
command ran and `:error` when it did not, for the caller to turn
into an exit status.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
