Netlify Cheatsheet
#
Netlify is a cloud platform that automates deployment, scaling, and management of modern web projects, including static sites and serverless functions.
General Commands
#
Command/Option | Example | Description |
---|
netlify login | netlify login | Log in to your Netlify account |
netlify whoami | netlify whoami | Show information about the currently logged-in user |
netlify regions | netlify regions | List available regions for deployments |
Site Management
#
Command/Option | Example | Description |
---|
netlify sites:list | netlify sites:list | List all Netlify sites |
netlify sites:create | netlify sites:create --name <site_name> | Create a new site |
netlify sites:delete | netlify sites:delete <site_id> | Delete a site |
netlify sites:info | netlify sites:info <site_id> | Show information about a specific site |
Deployment
#
Command/Option | Example | Description |
---|
netlify deploy | netlify deploy --prod | Deploy the current directory to production |
netlify deploy --draft | netlify deploy --draft | Deploy the current directory as a draft |
netlify deploy:history | netlify deploy:history | View deployment history |
netlify deploy:rollback | netlify deploy:rollback <deploy_id> | Roll back to a previous deployment |
Environment Variables
#
Command/Option | Example | Description |
---|
netlify env:list | netlify env:list | List environment variables for the current site |
netlify env:set | netlify env:set <variable_name>=<value> | Set an environment variable for the current site |
netlify env:unset | netlify env:unset <variable_name> | Unset an environment variable for the current site |
Functions Management
#
Command/Option | Example | Description |
---|
netlify functions:list | netlify functions:list | List all serverless functions |
netlify functions:create | netlify functions:create <function_name> | Create a new serverless function |
netlify functions:delete | netlify functions:delete <function_id> | Delete a serverless function |
netlify functions:invoke | netlify functions:invoke <function_name> | Invoke a serverless function |
Redirects and Rewrites
#
Command/Option | Example | Description |
---|
netlify redirects:list | netlify redirects:list | List all redirects for the current site |
netlify redirects:add | netlify redirects:add /old-path /new-path | Add a new redirect |
netlify redirects:delete | netlify redirects:delete /old-path | Delete a redirect |
Domain Management
#
Command/Option | Example | Description |
---|
netlify domains:list | netlify domains:list | List all domains for the current site |
netlify domains:add | netlify domains:add <domain_name> | Add a new domain |
netlify domains:delete | netlify domains:delete <domain_name> | Delete a domain |
This cheatsheet covers the most commonly used Netlify commands and options, helping you manage sites, deployments, functions, redirects, and domains efficiently.