Quickstart: build your first app
Create a full-stack app with the app preset, run it locally, then deploy it to Studio. You don't need any prior experience with the Mistral CLI.
1. Install the tools
Install the following tools first:
You also need a GitHub account to host the repository you deploy from.
Install the Mistral CLI:
curl -fsSL https://mistral.ai/cli/install.sh | bashAccept the installer's offer to add ~/.mistral/bin to your PATH. The change applies to new shells only, so open a new terminal or run source on the profile it names, then check the version:
source ~/.zshrc # zsh; bash: ~/.bashrc or ~/.bash_profile, fish: ~/.config/fish/config.fish
mistral --versionApps need Bun. If it's missing, the installer offers to install it. If you decline or run the installer without a terminal, follow the Bun command it prints. To install Bun without a prompt, set MISTRAL_INSTALL_BUN=1 for the installer. For more information, see CLI installation.
2. Sign in
mistral login
mistral context showmistral login signs you in through your browser. mistral context show prints the active organization and workspace. To switch, run mistral context set. The next steps use this sign-in to run, deploy, and publish the app. Without it, mistral deploy can use an API key, as Deploy with an API key describes.
3. Create the app
mistral init my-app --preset app
cd my-appThe app preset creates a web frontend in apps/web, a Python API in apps/api, a workflow worker in apps/worker, and a Postgres database. The CLI also adds the shared workspace capability, core, and commits the scaffold to a new Git repository.
Open the generated .env file and set MISTRAL_API_KEY to your API key. The worker uses it to connect to Mistral. Leave the database values as init wrote them. Git ignores .env, so your key stays out of the repository.
To start from a different set of components, see Selecting capabilities.
4. Run locally
Start Docker before you run mistral dev. Without Docker, the app starts without its database.
mistral devThe CLI starts the database, the API, the worker, and the web app behind a local gateway, then shows their status and logs. Open the URL it prints, such as http://my-app.apps.localhost:8080. If the worker stops with Authentication failed, check MISTRAL_API_KEY in .env.
Keep the command running while you edit. To stop it, press Ctrl-C. For API access and troubleshooting, see Local development.
5. Deploy
mistral deploy appears after you sign in with mistral login. Your organization's plan must include Apps: on the Free plan, or Pro and Team without pay-as-you-go, you can see the deployment commands but can't create apps. See Plan limits.
Create an empty repository in your GitHub account or organization. Then add it as the origin remote, push the app, and deploy:
git remote add origin https://github.com/YOUR-ORG/my-app.git
git push -u origin HEAD
mistral deployReplace YOUR-ORG with the repository owner. mistral deploy builds the pushed commit, so commit and push every change before you deploy. The working tree must be clean.
The platform clones the repository through your GitHub connection. If your Mistral account isn't connected to GitHub, or the Mistral GitHub app can't see the repository, the CLI stops before creating anything and offers to open the GitHub page that fixes it.
When prompted, select your organization and workspace. The CLI prints the destination, builds the app, and prints its URL when the deployment finishes. The first deployment also creates the database and deploys the worker as a managed workflows deployment, so it takes a few minutes longer than later ones.
The first deployment saves the deployment target in mistral.json. Accept the CLI's offer to commit and push it, or commit it yourself before your next deployment. The CLI doesn't upload .env: set the values the app needs, such as MISTRAL_API_KEY, in the Secrets tab of the app in Studio, on each module that needs them. For more information, see Deploy.
Next steps
- Publish to Vibe: make the deployed app available to users.
- Available capabilities: add or remove components.
- Local development: filter modules, read logs, and work with a coding agent.
- Quickstart: send your first trace: send a trace from your code and find it in Studio.