| name | netlify-cli |
| description | Use the Netlify CLI to deploy sites, manage serverless functions, configure environment variables, and manage forms. Use this instead of the Netlify MCP server. |
Netlify CLI
Official CLI for Netlify. Deploy sites, manage functions, env vars, and forms.
Authentication
netlify login
netlify status
Common Commands
Deployments
netlify deploy
netlify deploy --prod
netlify deploy --dir=./dist
netlify deploy --build
netlify watch
Sites
netlify sites:list
netlify sites:create --name my-site
netlify link
netlify unlink
netlify open
netlify open:admin
Dev Server
netlify dev
netlify dev --port 8888
netlify dev --live
Environment Variables
netlify env:set KEY value
netlify env:get KEY
netlify env:unset KEY
netlify env:list
netlify env:import .env
Functions
netlify functions:create my-func
netlify functions:serve
netlify functions:invoke my-func
netlify functions:list
Agent Best Practices
- Use
netlify deploy (without --prod) first to get a preview URL
- Use
netlify dev for local development with serverless functions
- Use
--json flag for machine-readable output
- Check
netlify status to confirm linked site before deploying
- Use
netlify env:import .env to sync environment from file
- Use
--dir flag to explicitly specify the build output directory
Example Workflows
Deploy and preview
URL=$(netlify deploy --dir=./dist --json | jq -r '.deploy_url')
echo "Preview: $URL"
Deploy to production
netlify deploy --prod --dir=./dist