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

# Baseten command-line tools

> The Baseten CLI deploys and operates models while the Truss CLI authors model code: what each is for, where they overlap, and how to use them together.

The **Baseten CLI** deploys and operates your models: `baseten model push` packages a model directory and deploys it, `baseten model push --watch` runs a live-patch development loop, and the rest of the command tree manages deployments, environments, autoscaling schedules, and replicas alongside organizations, API keys, and secrets. It also calls models and the raw Baseten API. All commands except the `baseten truss` passthrough support `--output json` and `--jq` filtering, so the same command works interactively and in a script or CI job. Install with [Homebrew](/reference/cli/baseten/overview#install).

The **Truss CLI** authors model code and runs the Chains, Training, and Loops workflows: `config.yaml` and `model.py` are Truss artifacts, and [`truss chains`](/reference/cli/chains/chains-cli), [`truss train`](/reference/cli/training/training-cli), and [`truss loops`](/reference/cli/loops/loops-cli) cover multi-step pipelines, training jobs, and Loops runs. Install with `uvx truss` or `pip install truss`.

The **Baseten Switch CLI** <span className="preview-badge">Beta</span> routes Claude Code and Codex CLI to [Model APIs](/inference/model-apis/overview) through a local gateway, and can install Pi's direct Baseten provider. See [Baseten Switch CLI](/reference/cli/baseten-switch).

Truss and the Baseten CLI are open source and authenticate against the same Baseten backend. Switch authenticates with the current Baseten CLI profile.

## Which one do I use?

| Task | CLI |
| - | - |
| Deploying a model, from your editor or from CI | Baseten CLI (`baseten model push`) |
| Iterating on a running deployment with live patches | Baseten CLI (`baseten model push --watch`, `baseten model watch`) |
| Authoring `model.py` or `config.yaml` | Neither. These are Truss artifacts; write them in your editor and deploy with the Baseten CLI. See the [Truss configuration reference](/reference/truss-configuration) |
| Authoring a Chain, Training job, or Loop | Truss (`truss chains`, `truss train`, `truss loops`), or `baseten train`/`baseten loops` which delegate to truss for config-file commands |
| Creating or deleting an org API key | Baseten CLI (`baseten org api-key`) |
| Promoting a development deployment to production | Baseten CLI (`baseten model deployment promote`) |
| Querying a model from a shell pipeline | Baseten CLI (`baseten model predict --jq ...`) |
| Managing org secrets | Baseten CLI (`baseten org secret`) |
| Terminating a deployment replica | Baseten CLI (`baseten model deployment replica`) |
| Routing Claude Code or Codex CLI to Model APIs | Baseten Switch (`baseten-switch`) |

## Overlapping commands

A few commands exist in both CLIs:

| Action | Truss | Baseten CLI | Pick based on |
| - | - | - | - |
| Authenticate | `truss login` | `baseten auth login` | Baseten CLI. If you also run truss, `baseten truss` forwards the CLI's credentials, so you don't log in twice. |
| Deploy a model | `truss push` | `baseten model push` | Baseten CLI. Both support `--watch`; the CLI adds `--output json`, `--jq`, and an exit code that fails a CI step. Use `truss push` only if you already have truss installed and no CLI. |
| Tail logs | `truss model-logs` | `baseten model deployment logs` | Baseten CLI. |

## Use both together

`baseten truss` runs truss through `uv tool run` and forwards this CLI's credentials, so `baseten truss push` works as a synonym for `truss push` without a separate `truss login`. Truss commands that import your own Python code, such as `chains push`, need `--truss-executable` pointed at a truss installed in your project, because `uv tool run` uses an isolated environment that can't see your dependencies.

The `baseten train` and `baseten loops` command trees manage training jobs and Loops runs natively, and delegate to truss for the commands that need a Python config file (`train push`, `train init`, `loops checkpoint deploy`).

## Next steps

<CardGroup cols={2}>
  <Card title="Deploy a model" icon="code" href="/development/model/build-your-first-model">
    Build and deploy your first model with the Baseten CLI.
  </Card>

  <Card title="Manage your workspace" icon="terminal" href="/reference/cli/baseten/overview">
    Use the Baseten CLI for orgs, deployments, and automation.
  </Card>

  <Card title="Build a Chain" icon="link" href="/development/chain/getting-started">
    Create multi-step inference pipelines with `truss chains`.
  </Card>

  <Card title="Wire CI/CD" icon="gear" href="/deployment/ci-cd">
    Use `baseten model push` in GitHub Actions and other pipelines.
  </Card>

  <Card title="Baseten Switch CLI" icon="shuffle" href="/reference/cli/baseten-switch">
    Route Claude Code, Codex CLI, or Pi to Model APIs.
  </Card>
</CardGroup>
