クラウドストレージサービスが多数あり、それらのサービスを使い分けている、またはそれぞれ好きなサービスがあったりします。そして知り合いにファイルを送ったりするのもクラウドサービスを経由して行っているのではないでしょうか。 そんな時に便利なコマンドがsharecmdです。CLIで簡単にファイルを共有できます。

sharecmdの使い方

まず最初は設定を行います。任意のクラウドストレージサービスを選んで、そのOAuth2トークンを設定します。

$ share
✔ dropbox
You choose "dropbox"
1. Go to https://www.dropbox.com/1/oauth2/authorize?client_id=40em1t168bc5aay&response_type=code&state=state
2. Click "Allow" (you might have to log in first).
3. Copy the authorization code.
Authorization Cod...QnYM
✔ none
write config...
Saving config to ~/.config/sharecmd/config.json

後はファイルを指定するだけで共有のためのリンクがクリップボードにコピーされます。

$ share /path/to/file
Uploading 11 KiB/11 KiB
URL: https://www.dropbox.com/s/06...SE?dl=1
URL copied to clipboard!

sharecmdはDropbox、Google Drive、Seafile、Nextcloud/Owncloudに対応しています。これらのサービスを登録することで、後は share コマンドだけでファイル共有が実現します。とても簡単で、さくっと動かせるので便利です。

sharecmdはGo製のオープンソース・ソフトウェア(Apache Licnese 2.0)です。

mschneider82/sharecmd: Cmdline tool written in Golang to share file links using cloud providers like dropbox, googledrive, seafile, nextcloud