# Command line

bsln version: `0.0.1b40`

SDK source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln`

Page source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln/docs/customer/CLI.md`

[Read on the web](https://docs.baseline-robotics.com/cli/) | [Markdown](https://docs.baseline-robotics.com/cli.md) | [Documentation index](https://docs.baseline-robotics.com/llms.txt)

## Sign in and check your identity

<a id="bsln-login"></a>
<a id="bsln-get-identity"></a>
<a id="bsln-whoami"></a>
<a id="bsln-logout"></a>
<a id="multiple-accounts-and-workspaces"></a>

Sign in and check that the CLI selected the right account:

```bash
bsln login
bsln get identity --json
```

Use `bsln logout` to remove the selected login. See [Quickstart](https://docs.baseline-robotics.com/index.md#2-sign-in) for the browser approval step.

## Connection settings

Set `BSLN_URL` and `BSLN_TOKEN` together for automation. An environment token bypasses saved directory bindings. API commands reject that token when `--profile` or `BSLN_PROFILE` is also set. A saved login is bound to the API origin used at sign-in.

## Profiles for accounts and workspaces

`bsln --profile work login` saves a named login. In a project directory, `bsln activate profile work` selects it for that directory and its descendants. Selection order is `--profile`, `BSLN_PROFILE`, the nearest directory binding, then the default login. Use `bsln list profile` to see saved profiles and `bsln deactivate profile` to remove a binding.

<a id="common-commands"></a>
<a id="all-commands"></a>
<a id="consolidated-commands"></a>
<a id="errors-that-every-command-can-show"></a>
<a id="how-to-use-this-guide"></a>

## Output and pagination

Add `--debug` before the command for a traceback. For commands that support `--json`, the result goes to stdout and errors go to stderr. Paginated list commands default to 100 rows. Use `--limit N` with a value from 1 to 500 or `--all` to fetch every page.

## API tokens

<a id="bsln-create-token"></a>
<a id="bsln-token-create"></a>
<a id="bsln-list-token"></a>
<a id="bsln-token-ls"></a>
<a id="bsln-revoke-token"></a>
<a id="bsln-token-revoke"></a>

`bsln create token --name monitor --scopes read --ttl-days 30` requests a read-only token. The issued token can carry only scopes held by the caller and can expire earlier than requested. Save the value when it is printed. `bsln list token` shows IDs, scopes and expiry, and `bsln revoke token TOKEN_ID` revokes the selected token.
