Command Line Tools
Netlify’s command line tools let you deploy sites or configure continuous deployment straight from the command line.
npm, the node package manager, to install the Netlify cli:
npm install netlify-cli -g
netlify deploy command will deploy a site, whether it’s a new site or an existing site.
The first time you deploy, a new site will be created and netlify will prompt for the path to deploy. Netlify stores the site id and the folder in a local
.netlify file. After the first deploy you can run
netlify deploy to deploy the same project again.
You can also deploy to a specific site_id by passing the
netlify deploy -s \\\[site_id\\\]
You can specify an environment for any command with the -e flag. Each environment can have its own settings. This makes it very easy to setup different sites for staging and production.
netlify deploy -e production
Further, you can set up overrides for some settings per-environment. See the deploy context section in our docs for more information.
To configure continuous deployment for a front end project or a static site generator, use
netlify init from the root of your project. Your project must be a GitHub repository.
Netlify init will guide you through the process of configuring continuous deployment.
Names, Domains and Passwords
You can update attributes on your site through the cli. Currently the name of the site (
netlify update -n my-test-site -d www.example.com -p my-password
You’ll need to configure the DNS settings for your custom domain separately from assigning the domain to your site.
The first time you use the cli tool, you’ll be asked to authenticate through the browser. After you authenticate we’ll store an access token in a global
You can specify a different access token for use with any command with the