# @surge/clif

> Cross-platform CLI GIF maker based on JS+Web.

Latest version **0.2.0** (published 2015-05-27) · 0 weekly downloads

## Install

```sh
npm install @surge/clif
pnpm add @surge/clif
yarn add @surge/clif
bun add @surge/clif
```

Provides the command `clif`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-05-27 |
| First published | 2015-05-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 (+6 in 3 direct dependencies) |
| Install scripts | yes |
| Maintainers | surge |

## Links

- npm: https://www.npmjs.com/package/@surge/clif
- npm.io page: https://npm.io/package/@surge/clif

## Dependencies (17)

- [ws](https://npm.io/package/ws.md) 0.7.2
- [6to5](https://npm.io/package/6to5.md) 3.5.3
- [uid2](https://npm.io/package/uid2.md) 0.0.3
- [babel](https://npm.io/package/babel.md) ^5.2.15
- [clone](https://npm.io/package/clone.md) 1.0.0
- [osenv](https://npm.io/package/osenv.md) 0.1.0
- [pngjs](https://npm.io/package/pngjs.md) 0.4.0
- [surge](https://npm.io/package/surge.md) latest
- [omggif](https://npm.io/package/omggif.md) 1.0.5
- [queue3](https://npm.io/package/queue3.md) 1.0.3
- [express](https://npm.io/package/express.md) 4.11.2
- [term.js](https://npm.io/package/term.js.md) 0.0.4
- [keypress](https://npm.io/package/keypress.md) 0.2.1
- [child_pty](https://npm.io/package/child_pty.md) github:gottox/child_pty
- [commander](https://npm.io/package/commander.md) 2.6.0
- [phantomjs](https://npm.io/package/phantomjs.md) 1.9.15
- [browserify-middleware](https://npm.io/package/browserify-middleware.md) 4.1.0

## Recent versions

- 0.2.0 (latest) — 2015-05-27

## README

# clif

Cross-platform CLI GIF maker based on JS+Web.

![](https://cldup.com/Iu3VmK9SVy.gif)

## Getting started

On OS X, install latest Xcode command line tools, even if you think you already have them:

```
xcode-select --install
```

Then, go through the Apple dialogue to download and install them. Now, you’re ready to install Surge’s version of clif with:

```sh
npm install -g @surge/clif
```

Note, you’ll need to be running npm@2.0.0 or greater to do this. You can check what version you’re using with:

```sh
npm --version
```

…and upgrade with:

```sh
sudo npm install -g npm
```

You can omit `sudo` if you are using Windows.

## How to use

Run

```sh
clif out.gif
```

type `exit` to finish and save the recording.

## Features

- Easy to install: `npm install -g clif`.
- Works on OSX and Linux.
- Small GIFs.
- High quality (anti-aliased fonts).
- Rendered with CSS/JS, customizable.
- Realtime parallel rendering.
- Frame aggregation and customizable FPS.
- Support for titles Terminal.app-style.

## How it works

clif builds mainly on four projects: `child_pty`, `term.js`
`omggif` and `phantomjs`.

`child_pty` is used to spawn a pseudo terminal from
which we can capture the entirety of input and output.

Each frame that's captured is asynchronously sent to
a `phantomjs` headless browser to render using `term.js`
and screenshot.

The GIF is composited with `omggif` and finally written
out to the filesystem.

## Options

```

  Usage: clif [options] <outfile>

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -c, --cols <cols>    Cols of the term [90]
    -r, --rows <rows>    Rows of the term [30]
    -s, --shell <shell>  Shell to use [/bin/bash]
    -f, --fps <fps>      Frames per second [8]
    -q, --quality <q>    Frame quality 1-30 (1 = best|slowest) [5]

```

## Contributing

You can edit the styles in `lib/client.js` and the recompiling:

```sh
npm run compile
```

## TODO

- Substitute `phantom` with a terminal rendered on top
  of `node-canvas` or low-level graphic APIs.
  [terminal.js](https://github.com/Gottox/terminal.js) seems like a good
  candidate to add a `<canvas>` adaptor to.
- Should work on Windows with some minor tweaks.
- There's an issue with Node 0.12 and IO.js on Mac
  where stdout sometimes buffers for no reason `¯\_(ツ)_/¯`

## Credits

- Inspired by [KeyboardFire](https://github.com/KeyboardFire)'s [mkcast](https://github.com/KeyboardFire/mkcast).
- Borrows GIF palette neuquant indexing from
  [sole](https://github.com/sole)'s [animated_GIF.js](https://github.com/sole/Animated_GIF).

## License

MIT

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