CLI GIF

死轻松的终端GIF,来自终端。「Dead easy terminal GIFs, from the terminal.」

Github stars Tracking Chart

clif

基于 JS+Web 的跨平台 CLI GIF 制作器。

如何使用

运行

  $ clif out.gif

键入 exit 完成并保存录制内容。

特性

  • 易于安装: npm install -g clif。
  • 适用于OSX和Linux。
  • 小GIF。
  • 高品质(反锯齿字体)。
  • 使用 CSS/JS 进行渲染,可定制。
  • 实时并行渲染。
  • 框架聚合和可自定义的 FPS。
  • 支持标题为 Terminal.app-style。

工作原理

clif 主要建立在四个项目上:child_pty、term.js omggif和phantomjs。

child_pty 用来生成一个伪终端,我们可以从这个伪终端中捕获整个输入和输出。

捕捉到的每一帧画面都会被异步发送到 phantomjs 的无头浏览器,使用 term.js 和 screenshot 进行渲染。

用 omggif 对 GIF 进行合成,最后写入到文件系统中。

选项

  用法:clif [options] <outfile>
  选项:
    -h,--help 输出使用信息
    -V,--version 输出版本号
    -c,--cols <cols>术语[90]
    -r,--rows <rows>行[30]
    -s,--shell <shell> Shell使用[/bin/bash]
    -f,--fps <fps>每秒帧数[8]
    -q,--quality <q>画面质量1-30(1 =最佳|最慢)[5]

TODO

  • 将顶端呈现的终端替换为 phantom node-canvas 或低级图形 API。 terminal.js 似乎是添加 <canvas> 适配器的好候选。
  • 通过一些小的调整应该可以在 Windows 上工作。

致谢

许可证

MIT

(The first version translated by vz on 2020.08.16)

Main metrics

Overview
Name With Ownerrauchg/clif
Primary LanguageJavaScript
Program languageMakefile (Language Count: 3)
PlatformLinux, Mac
License:
所有者活动
Created At2015-02-13 06:15:13
Pushed At2016-02-23 20:25:13
Last Commit At2016-02-23 12:25:12
Release Count6
Last Release Name0.0.6 (Posted on 2015-11-17 19:51:06)
First Release Name0.0.1 (Posted on 2015-02-12 22:20:13)
用户参与
Stargazers Count449
Watchers Count10
Fork Count12
Commits Count17
Has Issues Enabled
Issues Count8
Issue Open Count3
Pull Requests Count1
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

clif

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

How to use

Run

$ 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