Skip to content

tryy3/netlifyctl

 
 

Repository files navigation

Build Status

Introduction

Netlify's CLI to manage and deploy sites on Netlify without leaving your terminal.

It uses the OpenAPI definitions to interact with Netlify's API.

Installation

Binary Distribution

GitHub Releases

Prebuilt binaries are available for Windows, OS X and Linux.

Homebrew

brew tap netlify/netlifyctl
brew install netlifyctl

Source

netlifyctl can be installed from source:

$ go get github.com/tryy3/netlifyctl

Usage

Overview

netlifyctl --help

or to get details on a subcommand:

netlifyctl site update --help

Quickstart

  1. Use netlifyctl login to create an API token for your personal use. This command requires you to have access to a browser. Your access token will be stored in %HOME%/.config/netlify when you run the command directly.

  2. Use netlifyctl sites to display the list of sites you have access to.

  3. Use netlifyctl deploy to deploy changes on a site. This command must run from the root directory where you have your site's source code. The interactive guides will take your site ID and deploy path and incorporate them into that config file.

Thereafter, you can run unattended and headless using the flag -y to auto confirm the current settings: netlifyctl -y deploy.

Debugging

Netlifyctl generates debug logs with all the request and response interations when there is an error running any command. Those logs are stored in a file called netlifyctl-debug.log in the directory where you ran the command. These logs include your access token for the API! Please make sure you don't share them with anyone without masking those first.

You can force the CLI to generate these logs even when there are no errors with the -D flag: netlifyctl -D deploy.

Logging in & creating authentication tokens via a browser instead of the command line

You can get an access token from https://app.netlify.com/applications. Once you've created it, you can store it in your computer. The default location where netlifyctl tries to find this token is within your home directory, inside a file called netlify within a directory called .config. The path in a Unix system looks like ~/.config/netlify. This file uses JSON formatting, you can see an example below:

{
  "access_token": "my secret access token"
}

You can also set this token with the flag -A in each command call if you don't want to store it in a file: netlifyctl -A "my secret access token" deploy.

Contributions and Bug Reports

Contributions are welcome via Pull Request.

Bug Reports are welcome as Issues filed on this repository, but feel free to chat with support@netlify.com about issues as well - often we'll have faster advice to help you succeed.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.7%
  • Makefile 4.3%