Misskey クライアントの sayaka ちゃんは sixel で画像が表示できとても便利ですが,投稿ができません.
Terminal から投稿もしたいので他の cli クライアントの misskey-cli を試してみました.
早速導入します.
今回 go install で導入しましたが, Releases に各種環境向けのバイナリも用意されています.自分の環境にあったバイナリをダウンロードして実行権を付与してあげれば簡単に利用できます.hash や 署名は無さそうです.
install
$ go install github.com/mikuta0407/misskey-cli@latest $ ~/go/bin/misskey-cli misskey-cli Misskey CLI Client Usage: misskey-cli [command] Available Commands: help Help about any command note Create/Reply/Delete note renote Renote note by noteId stream streaming timeline tl Show timelime (local/home/global) version Show version and build revision. Flags: --config string config file (default "/home/matoken/.config/misskey-cli.toml") -h, --help help for misskey-cli -i, --instance string connect instance name(not host name) -t, --toggle Help message for toggle Use "misskey-cli [command] --help" for more information about a command. $ misskey-cli version misskey-cli version:
設定ファイルを用意します.
~/.config/misskey-cli.toml
を作成します.host は Misskey の url ,name は任意の名前,token は Misskey の「設定」→「API」→「アクセストークンの発行」から発行したものを使います.
複数の Misskey を登録できます.以下は2つの Misskey を登録しました.実行時に一番上の設定がデフォルトになるのでよく使う Misskey を一番上にするといいです.
$ vi ~/.config/misskey-cli.toml $ cat ~/.config/misskey-cli.toml [[Instance]] host = "https://msky.ospn.jp/" name = "OSPN" token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" [[Instance]] host = "https://misskey.io/" name = "misskey.io" token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
早速使ってみます.
misskey-cli をで note や 閲覧
$ misskey-cli note 'misskey-cli から note https://github.com/mikuta0407/misskey-cli' misskey-cli Create Note: @ (https://msky.ospn.jp/) =============================================================================================================================================================================================================================================== Note Success! id : 9rcgksz5uzfb00f6 "misskey-cli から note https://github.com/mikuta0407/misskey-cli" $ misskey-cli tl -l1 misskey-cli Timeline: local @ (https://msky.ospn.jp/) =============================================================================================================================================================================================================================================== 2024/03/27 06:33:58 matoken(@matoken) misskey-cli から note https://github.com/mikuta0407/misskey-cli (9rcgksz5uzfb00f6)
複数のインスタンスを登録している場合は -i name
(name は設定の tolm の name )で任意のインスタンスを指定できます.
$ misskey-cli -i misskey.io stream misskey-cli Stream: local @ (https://misskey.io/) =============================================================================================================================================================================================================================================== 2024/03/27 06:59:02 Connected to server :
その他詳細は README.md に日本語で書かれています.
とりあえず一通りのことはできそうです.
環境
$ misskey-cli version misskey-cli version: $ ls ~/go/pkg/mod/github.com/mikuta0407/ misskey-cli@v0.0.0-20230730142608-ab80e8e6583c $ dpkg-query -W golang golang:armhf 2:1.19~1 $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm $ arch aarch64