命令行录制工具 asciinema详解

| 选择喜欢的代码风格  

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

asciinema


asciinema 官网 https://asciinema.org,github 主页: https://github.com/asciinema

asciinema 直接使用 pip3 install asciinema 来安装,有可能会第一次失败提示你(具体可看 https://asciinema.org/docs/installation):

Collecting asciinema
  Downloading https://files.pythonhosted.org/packages/a7/71/771c859795e02c71c187546f34f7535487b97425bc1dad1e5f6ad2651357/asciinema-2.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-upAIm7/asciinema/setup.py", line 1, in <module>
        import asciinema
      File "asciinema/__init__.py", line 7, in <module>
        raise ImportError('Python < 3 is unsupported.')
    ImportError: Python < 3 is unsupported.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-upAIm7/asciinema/
You are using pip version 8.1.2, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.



[root@TestMaster /]
# pip install --upgrade pip
Collecting pip
  Downloading http://mirrors.aliyun.com/pypi/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 14.7MB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-19.1.1

执行 asciinema rec 开始录制,录制完成后 exit 退出或者按 Ctrl + D,可以保存到本地或者上传到 https://asciinema.org

$ asciinema rec

asciinema 录制过程在 https://asciinema.org/a/AdnqMX0QfOg5c7USOtwHZ4Hz1 可以看到了。

如果分享 asciinema 给他人可以用邮箱注册,它不需要密码就可以注册。CommandNotFound - 坑否 注册后的主页 https://asciinema.org/~CommandNotFound,视频链接后加 .png 是视频截图 https://asciinema.org/a/254348.png ,而链接后加 .js 就可以直接嵌入网站了。

<a href="https://asciinema.org/a/254348" target="_blank"><img src="https://asciinema.org/a/254348.svg" /></a>
<script src="https://asciinema.org/a/254348.js" id="asciicast-254348" async data-autoplay="true" data-size="big"></script>
 

asciinema 相关扩展阅读:




命令行录制工具 asciinema评论