Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

How to Build an Astro Website With Gemini

Use Google's Gemini to build an Astro site, in the free chat or with Antigravity, Google's coding agent that replaced the Gemini CLI in 2026.

Tested on Astro 7.4

Cover image for How to Build an Astro Website With Gemini
In this guide
  1. Which way should you use?
  2. Before you start: make the project yourself
  3. Option 1: Build with the Gemini chat
  4. Option 2: Build with Antigravity
  5. Connect Gemini to the Astro docs
  6. Check the work
  7. Where to go next
  8. Frequently asked questions

Gemini is Google’s AI assistant. Like Claude and ChatGPT, it can build an Astro site with you in two ways. You can chat and paste the code in yourself. Or you can use Antigravity, Google’s coding agent, which edits your project for you.

Which way should you use?

Chat at gemini.google.com Antigravity CLI
Where it runs In your browser In your terminal
Who edits the files You The agent, with your approval
Can it run commands? No Yes
Cost Free plan Free, Pro and Ultra plans
Best for Learning, small changes Building and changing whole sites

New to all of this? Read Start from zero first. It explains the words used here.

Before you start: make the project yourself

Make the Astro project with Astro’s own tool. It is always up to date, and AI tools sometimes reach for old patterns:

npm create astro@latest my-site -- --template basics

The project comes with an AGENTS.md file. It’s a note for AI tools about how the project works.

Option 1: Build with the Gemini chat

Step 1: Tell Gemini what you have

Open gemini.google.com and start a new chat. Say your version in the first message. Astro changed a lot in 2026, and this one line saves you from most old-code mistakes:

I'm a beginner using Astro 7.4. I made the project with "npm create astro@latest"
and the basics template. I want a simple site with a home page, an about page
and a blog. Give me one step at a time, with the full contents of each file.
Use only current Astro APIs. If you're not sure something is current, say so.

Step 2: One file at a time

Make each file as Gemini gives it to you. Save it. Look at your site. Then tell Gemini what you see before asking for the next step.

Step 3: Paste errors exactly

When something breaks, copy the whole error and paste it. Don’t describe it in your own words. See how to fix Astro errors with AI.

Option 2: Build with Antigravity

Antigravity is Google’s coding agent. It took over from the Gemini CLI for personal use on June 18, 2026, according to Google’s own README for the old tool. Its command is agy.

Step 1: Install it

On a Mac or Linux, run this in your terminal:

curl -fsSL https://antigravity.google/cli/install.sh | bash

Windows has a PowerShell command in Google’s getting-started guide. Then open a new terminal window and check it worked:

agy --version

Step 2: Start it inside your project

cd my-site
agy

The first time, sign in with your Google account. Google’s docs list Free, Pro and Ultra personal plans. Type /usage inside the tool to see what your plan allows.

Step 3: Give it the job

Read AGENTS.md first. Then add an about page at /about with a short bio, and
add a link to it in the navigation. Start the dev server and check the page
loads before you finish.

Antigravity shows you what it wants to change and asks before doing it. Check the page yourself when it’s done.

Connect Gemini to the Astro docs

Astro runs an official docs server for AI tools, and Astro’s guide includes setup steps for Antigravity. Once it’s connected, the agent reads the current docs instead of guessing. See how to connect AI tools to the Astro docs.

Check the work

  1. Run npm run build. It must pass.
  2. Open every page on a phone-sized window.
  3. Look for old patterns. Mistakes AI makes with Astro lists them.

Where to go next

Frequently asked questions

Is Gemini free to use for this?

The Gemini chat at gemini.google.com has a free plan. Google's Antigravity CLI lists Free, Pro and Ultra plans for personal Google accounts. Run /usage inside it to see your limits.

What happened to the Gemini CLI?

Google's own README says free personal use moved to the Antigravity CLI on June 18, 2026. The Gemini CLI is now aimed at paid Google Cloud customers. Older tutorials that say "install gemini-cli" are out of date.

Does Gemini know Astro 7?

Not reliably from memory. Tell it your Astro version, and connect it to the Astro docs. Astro's docs include setup steps for Antigravity.

Stuck on a step?

Check the common errors guide, look up a word in the glossary, or ask the friendly people in the official Astro and EmDash Discords. How to ask so people can help.

Keep reading

  1. How to Get Your Astro Site Cited by ChatGPT, Claude and Google AI

    AI assistants answer with links. What makes a site easy for them to read and cite: clear pages, structured data, a sitemap, Bing and llms.txt. Honest about what's proven.

    Build with AI, 7 minute read, November 8, 2026

  2. Can I Build an Astro Site With Grok, Kimi, DeepSeek or Qwen?

    Yes. Any AI chat can write Astro code for you. Here's the method that works with all of them, and which ones also have a coding agent that edits your project.

    Build with AI, 7 minute read, November 7, 2026

  3. How to Build an Astro Website With Claude (Step by Step)

    Use Claude to build a real Astro site, in the chat at claude.ai or with Claude Code in your terminal. This very site was built that way.

    Build with AI, 9 minute read, November 6, 2026

Try "blog", "deploy" or "EmDash".