# Mastra Quickstart The `create mastra` CLI command is the quickest way to get started. It walks you through setup and creates example agents, workflows, and tools for you to run locally or adapt. If you need more control over the setup, see the [manual installation guide](https://mastra.ai/docs/getting-started/manual-install/llms.txt). You can also use [`mastra init`](https://mastra.ai/reference/cli/mastra/llms.txt) for existing projects. ## Before you begin - You'll need an API key from a supported [model provider](https://mastra.ai/models/llms.txt). If you don't have a preference, use [OpenAI](https://mastra.ai/models/providers/openai/llms.txt). ## Initialize Mastra You can run `create mastra` anywhere on your machine. When prompted, choose a provider (e.g. OpenAI) and enter your key: ```bash npm create mastra@latest ``` ```bash pnpm create mastra ``` ```bash yarn create mastra ``` ```bash bunx create-mastra ``` This creates a new directory for your project with a `src/mastra` folder containing an example weather agent and the following files: - `index.ts` - Mastra config, including memory - `tools/weather-tool.ts` - a tool to fetch weather for a given location - `agents/weather-agent.ts` - a weather agent with a prompt that uses the tool You can use [flags](https://mastra.ai/reference/cli/create-mastra/llms.txt) with `create mastra` like `--no-example` to skip the example weather agent or `--template` to start from a specific [template](https://mastra.ai/templates). ## Test your agent Once setup is complete, follow the instructions in your terminal to start the Mastra dev server, then open Studio at [localhost:4111](http://localhost:4111). Try asking about the weather. If your API key is set up correctly, you'll get a response: [Studio](https://mastra.ai/docs/getting-started/studio/llms.txt) lets you rapidly build and prototype agents without needing to build a UI. Once you're ready, you can integrate your Mastra agent into your app using the guides below. ## Next steps - Integrate Mastra with your frontend framework: [Next.js](https://mastra.ai/guides/getting-started/next-js/llms.txt), [React](https://mastra.ai/guides/getting-started/vite-react/llms.txt), or [Astro](https://mastra.ai/guides/getting-started/astro/llms.txt) - Read more about [Mastra's features](https://mastra.ai/docs/llms.txt) - Build an agent from scratch following one of our [guides](https://mastra.ai/guides/llms.txt) - Watch conceptual guides on our [YouTube channel](https://www.youtube.com/@mastra-ai) and [subscribe](https://www.youtube.com/@mastra-ai?sub_confirmation=1)