bitiful # 需要配置文件 bitiful "/example/example.png" bitiful "https://example.com/example.png" bitiful /path/to/1.png /path/to/2.jpg # 支持多文件批量上传
- 开发构建
git clone https://github.com/XRSec/bitiful-typora-upload-cli.git cd bitiful-typora-upload-cli # 编辑 bitifulUrl 变量 CGO_ENABLED=0 go build -o bitiful # mv bitiful /usr/local/bin # cd .. && rm -rf bitiful-typora-upload-cli
- 打开 Typora,
偏好设置->图片->上传图片->自定义命令->/home/xxx/bitiful
配置文件路径:~/Library/Application\ Support/bitiful.yml
Endpoint: s3.bitiful.net Region: cn-east-1 AccessKeyID: "xxxxxxxxxxx" AccessKeySecret: "xxxxxxxxxxxxxxxx" BucketName: "xxxxxxxxxx" Path: "/xxxxxxxx/"
如需自定义上传后的文件名(如封面图),可用 -n 参数:
bitiful -n "20220903.jpg" https://example.com/20220903.jpg
bitiful -n Test.png /Users/xxx/xxx.png- 仅当指定
-n时,才会用该名字覆盖同名文件。 - 未指定
-n时,自动生成唯一文件名,绝不覆盖。
直接在命令行追加多个文件或URL即可:
bitiful /path/to/1.png /path/to/2.jpg
加 -v 参数可显示详细日志,便于排查问题:
bitiful -v /path/to/1.png
- 本地文件上传
- URL 上传
- [?] ftp/smb/afs