# @lbatchelor/netlify-cli

> Netlify builds, deploys and hosts your front-end straight from Github.

Latest version **1.2.2-patched.9** (published 2018-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lbatchelor/netlify-cli
pnpm add @lbatchelor/netlify-cli
yarn add @lbatchelor/netlify-cli
bun add @lbatchelor/netlify-cli
```

Provides the command `netlify-patched`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.2-patched.9 |
| Published | 2018-09-14 |
| First published | 2017-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 70.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1920 |
| Author | Netlify |
| Maintainers | lbatchelor |
| Keywords | netlify, hosting, cdn, deploy |

## Links

- npm: https://www.npmjs.com/package/@lbatchelor/netlify-cli
- Repository: https://github.com/netlify/netlify-cli
- Issues: https://github.com/netlify/netlify-cli/issues
- npm.io page: https://npm.io/package/@lbatchelor/netlify-cli

## Dependencies (10)

- [open](https://npm.io/package/open.md) 0.0.5
- [when](https://npm.io/package/when.md) ^3.7.5
- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [github](https://npm.io/package/github.md) ^0.2.4
- [prompt](https://npm.io/package/prompt.md) ^0.2.14
- [home-dir](https://npm.io/package/home-dir.md) ^0.2.0
- [inquirer](https://npm.io/package/inquirer.md) ^0.11.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^0.6.0
- [@lbatchelor/netlify](https://npm.io/package/@lbatchelor/netlify.md) 1.2.0-patched.7

## Recent versions

- 1.2.2-patched.9 (latest) — 2018-09-14
- 1.2.2-patched.8 — 2018-09-14
- 1.2.2-patched.7 — 2017-12-08
- 1.2.2-patched.6 — 2017-11-16
- 1.2.2-patched.5 — 2017-11-16
- 1.2.2-patched.3 — 2017-11-16
- 1.2.2-patched.2 — 2017-11-16
- 1.2.2-patch — 2017-11-16
- 1.2.2-patched — 2017-11-16

## README

# Netlify CLI

The Netlify CLI tools lets you create, deploy, and delete new sites straight from your terminal.

---

# Why does this fork exist?

This fork exists due to errors we are getting when using the normal client. Some times the permalink
we get back doesn't actually work. This fork simply fetches that url a second time to ensure that
we are logging the correct one.

It also adds the ability to set a `WRITE_PERMALINK_TO_FILE` environment variable to write the url
to a file as well.

```
WRITE_PERMALINK_TO_FILE="permalink.txt" yarn netlify-patched -t $NETLIFY_TOKEN deploy --site-id $NETLIFY_SITE_ID_STAGING -p dist.zip
```

---

## Installation

To install the CLI tools:

```bash
npm install netlify-cli -g
```

## Usage

Deploy a front-end project that lives in `my-project` and builds to `dist` directory:

```bash
cd my-project/
netlify deploy dist
```

## Configuration and Authentication

The first time you use the netlify cli command you'll be asked to authenticate.

Your access token is stored in `~/.netlify/config`.

Netlify also stores a local `.netlify` file in the folder where you run `netlify deploy` from where the `site_id` is stored.

## Environments

You can easily setup different environments like `staging` or `production`. Just use the `-e` flag:

```bash
netlify deploy dist -e production
```

Netlify creates different sites with each their own URL for each of your environments and keeps track of them in the `.netlify` config file.

## Caveats

- netlify-cli is known to hang with an "ECONNRESET" error (parsed as JSON, it will look odd) when used from many CI environments.  This is a known issue that is only fixed in our alternate and current CLI:  https://github.com/netlify/netlifyctl

- netlify-cli is known to hang when used with Node.js version 8.1.0.  Version 8.1.2 works well

---
_Source: https://npm.io/package/@lbatchelor/netlify-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
