LoginSignup
11
11

More than 1 year has passed since last update.

Mac | asciinemaでターミナルの操作動画を記録・再生・シェアする (コピペも出来る)

Last updated at Posted at 2017-05-18

今日、 Docker チュートリアルをやっていたら気付いた。

この動画内の文字。。。ブラウザのテキスト検索に引っかかるぞ。

コピペも出来る!

image

シェルの入力を動画としてシェアできるサービスがあった

発音

アスキーネマ。

How is it pronounced?
[as-kee-nuh-muh].

FAQ - asciinema

インストール

$ brew install asciinema

録画開始

$ asciinema rec

(色々入力)

( exit か Ctrl-D で終了 )

終わると自動的にURLが生成される。

https://asciinema.org/a/c041ctmf8zaab5mq2c5ocx2lw

ファイルに記録する場合

$ asciinema rec demo.json

ファイルから再生

$ asciinema play demo.json

  • ちなみにあくまで再生だけで、実際に操作がおこなわれるわけではないっぽい
  • たとえばデモの中でファイル作成処理があっても、ファイルは作成されない

ファイルをアップロード

$ asciinema upload demo.json

URLから再生

$ asciinema play https://asciinema.org/a/b5gai4rnflh7r0kie01fx6lip.json

グローバルなURLからでも、手元で再生できる。

上記はDockerチュートリアルのもの。
適当にHTMLソースから抜き出してきて .js 拡張子を取り除いた奴。

ドキュメントを上下にスクロールしながらやるより、かなり分りやすい感じがした。
(それに、コマンドの履歴からいつでも再生できる)

アカウント登録

アカウントを登録すると、こんな風に録画したものをストックしていける。

ログインしながら録画をアップロードすると、自動的に public になるっぽいので注意。

image

削除 

ログインしてWebから可能。

image

ヒント

途中で入力に手間取ったら録画し直し?

録画時・再生時のどちらでも -w オプションで最大間隔秒数を指定できる。

2秒、3秒と何も出力されていない空白時間も、1秒に切り詰めてくれる。

なので特に気にしなくても良さそう。

パスワードもレコーディングされるの?

されない。

  • asciinemaは「目に見えるもの」しかレコーディングしない。
  • キー入力をレコーディングしているわけではない。

Does it record the passwords I type during recording?

asciinema records only terminal output - everything that you can actually see in a terminal window. It doesn’t record input (keys pressed). Some applications turn off “echo mode” when asking for a password, and because the passwords are not visible they are not recorded. Some applications display star characters instead of real characters and asciinema records only “**”. However, some applications don’t have any precautions and the actual password is visible to the user, and thus recorded by asciinema.

試してみる

手元でパスワード入力操作を録画してみると、確かにjson にはこのように「表示された文字」と「表示間隔の秒数」だけが記録されているようだ。

image

環境

  • zsh 5.3.1 (x86_64-apple-darwin15.6.0)
  • asciinema 1.4.0
  • Mac OS 10.12.4

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

11
11
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11