Quickstart: install the Mistral CLI and create a project

In this quickstart, you install the Mistral CLI, sign in, check which organization and workspace your commands use, and scaffold a workflows project. It takes about 5 minutes. For what the CLI does, see Mistral CLI.

Before you begin

Before you begin

1. Install the CLI

1. Install the CLI

Run the installer:

curl -fsSL https://mistral.ai/cli/install.sh | bash

Accept the installer's offer to add ~/.mistral/bin to your PATH. It also offers to install Bun, which runs workflows and apps on your machine: accept it too. The PATH change applies to new shells only, so open a new terminal or source the profile that the installer names, then check the version:

source ~/.zshrc   # zsh; bash: ~/.bashrc or ~/.bash_profile, fish: ~/.config/fish/config.fish
mistral --version
2. Sign in

2. Sign in

Sign in through your browser, then check who you are and where your commands run:

mistral login
mistral whoami
mistral context show

mistral login opens your browser to sign in. If no organization and workspace are selected yet, it selects the default ones of your account. mistral whoami prints the signed-in identity, and mistral context show prints the active organization and workspace. To use another workspace, run mistral context set.

Tip

On a machine without a browser, run mistral login --device. If no OS keychain is available, add --insecure-storage to keep the sign-in in a file. In CI, save an API key with mistral login --api-key -, which reads it from standard input. An API key belongs to one workspace, and mistral apps publish and mistral apps unpublish still need the browser sign-in. Don't commit credentials.

3. Create a project

3. Create a project

Scaffold a workflows project with mistral init:

mistral init my-workflow --preset workflow --yes

--preset workflow picks the capabilities of a workflows project, and --yes accepts the defaults without asking. To build a full-stack app with a database instead, use --preset app.

You should see

You should see

The CLI installs the project dependencies, creates a Git repository, and ends with a summary that starts with:

Created my-workflow: workflows, apps (core included)

  cd my-workflow

The new my-workflow directory holds a Python worker in apps/worker and a .env file. The summary also reminds you to set MISTRAL_API_KEY in .env before you run the worker.

If mistral isn't found, open a new terminal: the PATH change from step 1 applies to new shells only.

Clean up

Clean up

Keep my-workflow for the Workflows quickstart, which starts from this project. Otherwise, delete the directory. To sign out, run mistral logout.

Going further

Going further