Getting Started

Your First Margarita Agent

Lets walk through building a simple hello world Margarita script. So you can start learning Margarita.

Margarita
1
Install Margarita
Install it with uv for a fast, isolated install that won't touch your system Python.
Check here for how to install uv
install
uv tool install margarita
verify the install
margarita --version
2
Write your first .mgx file
Create a file called hello.mgx. The << >> block builds the prompt and @effect run sends it to the LLM.
hello.mgx
<<
Write out a simple Greeting!
>>

@effect run
3
Run it
Pass the file to margarita run. Margarita executes the script top to bottom — logging, setting state, rendering the prompt, and calling the LLM at @effect run. The agent's response is printed to stdout.
terminal
margarita run hello.mgx

What's next?

Learn about state and variables.