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

# CLI platform mode vs. legacy mode

> Understand the CLI's platform and legacy authentication modes, and when the legacy path is still needed.

# CLI platform mode vs. legacy mode

This page is specific to the Landbase CLI. The CLI supports two authentication and routing modes. Most users will never need to think about this distinction — platform mode is the default and is the right choice for almost everyone. MCP clients use the remote OAuth connection described in [Connect Landbase MCP](https://www.landbase.com/docs/install-mcp.md), not the CLI mode switch described here.

***

## Platform mode (default)

In platform mode, landbase-cli routes requests through the Landbase cloud gateway at `api.landbase.com`. Authentication uses an OAuth session — you log in via browser and a short-lived token is stored in `~/.landbase/platform.json`.

Credentials in platform mode:

* Session token prefix: `lbs_`
* Stored at: `~/.landbase/platform.json`
* Created by: `landbase-cli auth login` (browser OAuth)

Platform mode is the default. It is enabled automatically unless you have set `LANDBASE_LEGACY_MODE=1`.

***

## Legacy mode

Legacy mode connects directly to the AgentOS backend, bypassing the cloud gateway. Authentication uses long-lived API keys.

Credentials in legacy mode:

* API key prefix: `lbk_`
* Stored at: `~/.landbase/config.json`
* Created by: `landbase-cli auth login --key`

To enable legacy mode:

```bash theme={null}
export LANDBASE_LEGACY_MODE=1
```

To disable it:

```bash theme={null}
unset LANDBASE_LEGACY_MODE
```

***

## Who should use legacy mode?

Legacy mode exists for backward compatibility. You might need it if:

* You have an existing automation using a `lbk_` API key and cannot migrate yet
* You have been explicitly instructed by Landbase support to use it for a specific integration
* You are running a version of landbase-cli that predates platform mode

If you are starting fresh, use platform mode.

***

## How to check which mode you are in

```bash theme={null}
landbase-cli auth status
```

The output will indicate whether you are authenticated via platform session or API key, and which base URL is being used.

***

## What changes between modes

| | Platform mode | Legacy mode |
| - | - | - |
| Auth method | OAuth (browser) | API key |
| Token type | `lbs_*` | `lbk_*` |
| Config file | `~/.landbase/platform.json` | `~/.landbase/config.json` |
| Base URL | `api.landbase.com` | AgentOS direct |
| Enable with | Default | `LANDBASE_LEGACY_MODE=1` |

***

## Related

* [How to troubleshoot authentication](https://www.landbase.com/docs/guides/cli/troubleshoot-auth.md)
* [environment variables reference](https://www.landbase.com/docs/reference/cli/env-vars.md) — `LANDBASE_LEGACY_MODE` and related vars
* [Connect Landbase MCP](https://www.landbase.com/docs/install-mcp.md) — MCP connection and OAuth setup


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.