Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/halo-sigs/attachment-upload-cli
Attachment Upload CLI - 支持在 Terminal 中上传文件到 Halo 并得到链接,兼容 Typora 编辑器的图片上传。
https://github.com/halo-sigs/attachment-upload-cli
cli halo node-cli typora
Last synced: 3 days ago
JSON representation
Attachment Upload CLI - 支持在 Terminal 中上传文件到 Halo 并得到链接,兼容 Typora 编辑器的图片上传。
- Host: GitHub
- URL: https://github.com/halo-sigs/attachment-upload-cli
- Owner: halo-sigs
- Created: 2023-05-20T14:18:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-21T15:22:53.000Z (about 1 year ago)
- Last Synced: 2024-12-09T03:39:45.315Z (4 days ago)
- Topics: cli, halo, node-cli, typora
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-halo - attachment-upload-cli - 支持在 Terminal 中上传文件到 Halo 并得到链接,兼容 Typora 编辑器的图片上传。 (Halo 2.0 / 其他)
README
# Halo Attachment Upload CLI
> 在 Terminal 中上传文件到 Halo 并得到链接,兼容 Typora 编辑器的图片上传。
[![asciicast](https://asciinema.org/a/NVnIamnx3WrQNnDSOHKLDqDic.svg)](https://asciinema.org/a/NVnIamnx3WrQNnDSOHKLDqDic)
## 安装
```bash
npm install @halo-dev/attachment-upload-cli -g
```安装完成之后,就可以在 Terminal 中使用 `halo-attachment-upload` 命令,或者 `hau`,以下使用 `hau` 为例。
## 配置
```bash
hau setup
```> 配置文件存储位置:`~/.config/@halo-dev/attachment-upload-cli/config.json`
## 上传文件
```bash
hau upload -f /path/to/file
```## 在 Typora 中使用
1. 找到 Node 和 hau 的实际路径
```bash
which node
which hau# 以下为例子
/opt/homebrew/opt/node@18/bin/node
/opt/homebrew/bin/hau
```2. 拼接上传命令
```bash
/opt/homebrew/opt/node@18/bin/node /opt/homebrew/bin/hau upload -f
```3. 打开 Typora 设置,进入 **图像 -> 上传服务设定**,将上传服务改为自定义命令,并将上面拼接的命令填入即可。
## 帮助
```bash
❯ hau --help
Usage: halo-attachment-upload|hau [options] [command]Options:
-V, --version output the version number
-h, --help display help for commandCommands:
upload|u [options] Upload a file to Halo
setup|s Setup your Halo site url, username and password
help [command] display help for command
```