
Introduction
netlifyctl is a proof of concept to rewrite Netlify's CLI in Go.
It uses the OpenAPI definitions
to interact with Netlify's API.
Installation
Binary Distribution
GitHub Releases
Prebuilt binaries are available for osx and linux. Other architectures available upon request to support@netlify.com.
Homebrew
brew tap netlify/netlifyctl
brew install netlifyctl
Source
netlifyctl can be installed from source:
$ go get github.com/netlify/netlifyctl
Usage
Overview
netlifyctl --help
or to get details on a subcommand:
netlifyctl site update --help
Quickstart
- create an API token for your deploys here: https://app.netlify.com/applications (and save it)
- find your site ID - most easily done at the bottom of your site's settings page
- do one deploy manually, which will create a new config file (or add to an existing one):
netlify.toml
. You'll want to run this command on a system with both your code checked out AND a browser to interact with (for login purposes).
netlifyctl -A YOURAPITOKEN deploy
...and 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 (though you should check the return code from running, in case there is some error):
netlifyctl -y -A YOURAPITOKEN deploy
Logging in & creating authentication tokens via a browser instead of the command line
We use the package https://github.com/skratchdot/open-golang to support browser-based auth with netlify if you want to use that path instead via netlifyctl login
. The client portion of the authentication token will then be available in ~/.config/netlify
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 too!
License
MIT