These are Netlify's official setup instructions for AI agents. Follow them to get the user ready to build and deploy on Netlify.
Run every step yourself, except where a step says to check with the user. If install or login fails, stop and tell the user. If a later step fails, report it and keep going with the rest.
---
## 1. Install the Netlify CLI
Check with `netlify --version`. If it's missing or older than 27.20.0, install the latest:
```
npm install -g netlify-cli@latest
```
Older versions skip some of the setup in step 3.
---
## 2. Log in
Run `netlify status` to see if you're already logged in. If not:
- On the user's computer, run `netlify login`. It opens their browser to sign in.
- Anywhere else, run `netlify login --request "{AGENT_NAME} wants to login"`. Give the user the login URL it prints. Then run the `netlify login --check` command it prints. It says "Status: pending" until the user approves, so repeat it until that changes.
---
## 3. Set up the project and deploy
Work from the user's project folder. A new, empty folder works.
1. Run: `netlify init`
Do not pass `--skip-agent-setup` or `--skip-mcp-setup`. It installs the Netlify skills, adds the Netlify MCP server, and prints your next commands.
If it shows an interactive menu instead, you have a terminal. Cancel it. Do not answer it. The skills and MCP server are already installed by then, so do not run init again.
If the output prints an `npx add-mcp` command instead of "Added the Netlify MCP server", your agent is not one init can configure. Run that command with `-y -a <your agent name>`, or tell the user.
2. If the user's task does not need a deploy, stop here.
3. Link or create a project. If init printed next commands, follow them in this order of preference. If you cancelled a menu, use the commands in brackets.
- If the folder is already linked, go to step 4. [`netlify status --json` shows `"linked": true`. Ignore its exit code.]
- If the folder has a git remote, link by it. If it links, go to step 4. [`netlify link --git-remote-url <origin url>`]
- Otherwise create a project. For the name, take the folder name, replace anything that isn't a letter, number, or hyphen with a hyphen, and keep it under 64 characters. [`netlify teams:list --json`, then `netlify sites:create --name <project name> --account-slug <team slug>`. Always pass both flags.]
If there is more than one team, ask the user one question, "Which Netlify team should this project go in?", and list them. Wait. When the answer arrives, run the create command with that team's slug. Do not run init again.
If the user does not answer, stop and report that the project still needs a team.
If it asks for a project name, the name is taken. Cancel it and run the command again with a short suffix on the name.
4. Deploy. If the folder has nothing to deploy yet, stop and tell the user the project is ready.
If you created the project in step 3, run: `netlify deploy --prod`
Nothing is live yet, so this puts the site on its main URL. Give the user that URL from the output.
If the project already existed, run: `netlify deploy`
This publishes a draft and leaves the live site alone. Give the user the "Draft URL" from the output. Run `netlify deploy --prod` only if the user asked for a production deploy.
5. Offer the next step: "Want every push to deploy automatically? Run `netlify init` in your own terminal. It connects your Git repository and asks you to authorize GitHub." Do not run it yourself.
---
## Help
Run `netlify --help` to see everything the CLI can do. Netlify's docs for agents are at https://docs.netlify.com/llms.txt.
Deploy to the web with a single command from Netlify. Give your AI agent the ability to create sites, deploy apps, and manage serverless infrastructure — no human in the loop.
The preferred web platform for millions of agent-built sites.
Start shipping
Copy this instruction and give it to your agent
fetch https://netlify.ai to start deploying
FAQ
Is it free?
Yes. Netlify has a generous free tier that includes hosting, serverless functions, edge functions, and more.
Do I need a Netlify account?
Agents can build and deploy static sites without needing a Netlify account. For more complex setups, sign up for a free Netlify account.
Can I use my own domain?
Yes. You can connect custom domains to any Netlify site, with automatic HTTPS included. You can also buy domains directly through your Netlify account.
What agents/tools does this work with?
All of them. Claude Code, Cursor, Codex, Gemini CLI, or any AI agent that can run commands.
What can my agent deploy to Netlify?
Anything that runs on the web: websites, web apps, APIs, dashboards, games, blogs, storefronts, documentation, prototypes, portfolios, and more.
What does my agent get access to?
The full Netlify platform - instant deploys, serverless functions, edge functions, environment variables, forms, identity, and more.
Can my agent manage existing sites?
Yes. Your agent can deploy updates, manage environment variables, configure settings, and access the Netlify API for any site on your account.