CLI GIF

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

Github星跟蹤圖

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)

主要指標

概覽
名稱與所有者rauchg/clif
主編程語言JavaScript
編程語言Makefile (語言數: 3)
平台Linux, Mac
許可證
所有者活动
創建於2015-02-13 06:15:13
推送於2016-02-23 20:25:13
最后一次提交2016-02-23 12:25:12
發布數6
最新版本名稱0.0.6 (發布於 2015-11-17 19:51:06)
第一版名稱0.0.1 (發布於 2015-02-12 22:20:13)
用户参与
星數449
關注者數10
派生數12
提交數17
已啟用問題?
問題數8
打開的問題數3
拉請求數1
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

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