gist をコマンドラインから利用しやすくするツール。 ファイルの新規投稿や、投稿したファイルをローカルにクローンできる。
おおまかな手順は以下のとおり。
- インストール
- GitHub API アクセストークン取得
- GitHub SSH 公開鍵登録
- 環境変数設定
% gem install gisty
こちらの解説を参考に以下の
username
部分を GitHub アカウントIDに変えて実行する。
続けてパスワードをきかれるので入力するとアクセストークンが取得できる。
% curl -u 'username' -d '{"scopes":["gist"],"note":"gisty"}' https://api.github.com/authorizations
https://github.com/settings/tokens で取得したアクセストークンが表示されていれば成功。
こちらを参考に登録。 既に登録済みのかたはスキップ。
環境変数に gist を保存するディレクトリとアクセストークンを登録。
export GISTY_DIR="$HOME/dev/gists"
export GISTY_ACCESS_TOKEN="アクセストークン"
git も設定。
% git config --global github.user アカウントID
% git config --global github.token アクセストークン
特に問題がここまでの手順で gisty が使用できるようになる。
2015/8/14 作成