SkillOpen
netlify-cli
Use the Netlify CLI to deploy sites, manage serverless functions, configure environment variables, and manage forms. Use this instead of the Netlify MCP server.
Front matter
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.
- Official repo: https://github.com/netlify/cli
- Docs: https://docs.netlify.com/cli/get-started/
Authentication
netlify login # Browser-based login
netlify status # Check auth and linked siteCommon Commands
Deployments
netlify deploy # Deploy draft
netlify deploy --prod # Deploy to production
netlify deploy --dir=./dist # Deploy specific directory
netlify deploy --build # Build then deploy
netlify watch # Watch for deploy completionSites
netlify sites:list # List all sites
netlify sites:create --name my-site # Create new site
netlify link # Link to existing site
netlify unlink # Unlink current directory
netlify open # Open site in browser
netlify open:admin # Open admin panelDev Server
netlify dev # Start local dev server
netlify dev --port 8888 # Custom port
netlify dev --live # Share via live tunnelEnvironment Variables
netlify env:set KEY value
netlify env:get KEY
netlify env:unset KEY
netlify env:list
netlify env:import .env # Import from fileFunctions
netlify functions:create my-func # Scaffold new function
netlify functions:serve # Serve functions locally
netlify functions:invoke my-func # Invoke locally
netlify functions:list # List deployed functionsAgent Best Practices
- Use
netlify deploy(without --prod) first to get a preview URL - Use
netlify devfor local development with serverless functions - Use
--jsonflag for machine-readable output - Check
netlify statusto confirm linked site before deploying - Use
netlify env:import .envto sync environment from file - Use
--dirflag 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=./distSource: written by One Giant Leap.
Related entries
There are more like this in the members library
The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.