另一个支持剪贴板的上传中心。它与 Typora、Snipaste 和 VSCode 兼容。
Languages: English / 简体中文
Development: 开发手册(中文)
Upgit is a native & lightweight tool that helps you upload any file to your Github repository and then get a raw URL for it.
This is also useful with Typora as an image uploader, and with the VSCode extension.
Github
GitLab
S3 Compatible Storages
Gitee (they block public image-bed repos; prefer SM.MS / S3 / OSS)
Tencent QcloudCOS
Qiniu Kodo
Upyun
AliyunOSS
Hello
Niupic
SM.MS
Imgur
ImgUrl.org
CatBox
LSkyPro
Chevereto
ImgBB
Cloudinary
EasyImage
DALEXNI
img.tg
Juejin
Moetu
NetEase
Sogou
upload.cc
Lsky Pro v2
More: upgit uploaders
Download the latest zip from Releases.
If you have no idea which to download:
- For most Windows users, choose
upgit_win_amd64.zip- For Windows ARM, choose
upgit_win_arm64.zip- For Windows 32-bit, choose
upgit_win_386.zip- For Linux x64, choose
upgit_linux_amd64.zip- For Linux arm64, choose
upgit_linux_arm64.zip- For Linux 32-bit, choose
upgit_linux_386.zip- For Linux ARM, choose
upgit_linux_arm.zip- For most macOS users, choose
upgit_macos_arm64.zip- For macOS Intel, choose
upgit_macos_amd64.zip- Execute
chmod +x upgitif permission is needed
Unzip it, rename the binary to upgit (For Windows users, upgit.exe), save it to somewhere you like. To access it from anywhere, add its directory to the PATH environment variable.
Run upgit update to replace this binary with the latest stable GitHub release. upgit update --beta / --alpha opt into those channels. config.toml and customized recipes are left in place.
Run upgit init. It writes a GitHub config.toml and prints the path. You can also create config.toml in the same directory of upgit.
Fill it in following this sample config file.
The repository must be public. Private repos make raw URLs 404.
Personal Access Token (PAT): a classic token with the repo scope, or a fine-grained token with Contents: Read and write on that repository. Create a token at GitHub Settings → Developer settings → Personal access tokens.
To upload file logo.png with rename rules, execute:
./upgit logo.png
# for windows: .\\upgit.exe logo.png
Then you'll see a link to logo.png.
To upload file logo.png to remote folder /my_images/demo, execute:
./upgit logo.png -t /my_images/demo
# for Windows: .\\upgit.exe logo.png -t /my_images/demo
FILE can be a local path or an http(s) URL (downloaded, then uploaded).
For more help, type -h argument
…
Assuming your upgit program is saved at
"C:\repo\\upgit\\upgit.exe".
Select File > Preferences...
Move to Image. Choose Custom Command as your Image Uploader.
Input upgit program location into Command textbox.
You can click Test Uploader button to make sure it works.
Now enjoy it!
Upload the clipboard image as png:
./upgit --clipboard
Shortcuts for screenshot:
Ctrl+Shift+Cmd+4Ctrl+Shift+PrintScreenShift+Win+sOn Linux, clipboard access needs xclip (X11) or wl-clipboard (Wayland).
Compatible with Snipaste (Windows): Snipaste bitmap screenshots can be uploaded the same way.
Note: This feature is only supported on Windows.
Upload files copied in Explorer (CF_HDROP):
./upgit --clipboard-files
Use --output clipboard (alias --output-type):
upgit logo.png --output clipboard
# or .\\upgit.exe --clipboard -o clipboard
Add argument -f markdown (alias --output-format):
upgit logo.png --output clipboard -f markdown
# or .\\upgit.exe --clipboard -o clipboard -f markdown
Then you'll get a markdown image link in your clipboard like:
For Windows user:
Install AHK
Create this script upload_clipboard.ahk and run:
; Press Ctrl + F9 to upload clipboard image
^F9::
RunWait, "upgit.exe" --clipboard --output clipboard --format markdown
return
Then press WinShiftS to take screenshot. CtrlF9 to upload it and get its link to your clipboard!
| Key | Desc |
|---|---|
| username | Your Github username, like pluveto |
| repo | Your Github repository name, like upgit |
| branch | The branch for saving files, like master or main |
| pat | Personal Access Token. Visit GitHub Docs for more info |
| rename | Renaming rule. Path separator / will create directories if not exists. Supporting: |
-- {year} |
-- Year like 2006 |
-- {month} |
-- Month like 01 |
-- {day} |
-- Day like 02 |
-- {hour} |
-- Hours of current time |
-- {minute} |
-- Minutes of current time |
-- {second} |
-- Seconds of current time |
-- {unix_ts} |
-- Unix timestamp in second. Like 1643373370. |
-- {unix_tsms} |
-- Unix timestamp in millisecond. Like 1644212979622. |
--- {ext} |
-- Extension like .png, and empty when the original file has no extension |
-- {fname} |
-- Original file base name like demo (without extension) |
-- {fname_hash} |
-- xxHash32 (seed 0) hex of {fname} (name without extension) |
-- {fname_hash4} |
-- xxHash32 hex of {fname}, first 4 digits |
-- {fname_hash8} |
-- xxHash32 hex of {fname} (full 8-digit digest) |
-- {content_hash} |
-- xxHash32 (seed 0) hex of the file contents |
-- {content_hash4} |
-- xxHash32 hex of the file contents, first 4 digits |
-- {content_hash8} |
-- xxHash32 hex of the file contents (full 8-digit digest) |
-- {hmac} |
-- HMAC-SHA256 hash of hmac_format, truncated to hmac_len |
| hmac_key | Secret key for calculation {hmac} |
| hmac_format | Format string for {hmac} calculation. Supporting all above placeholders. |
| hmac_len | Length of {hmac} hash. 0 means no truncation. |
Here is a simplist sample config file:
rename = "{year}/{month}/upgit_{year}{month}{day}_{unix_ts}{ext}"
[uploaders.github]
pat = "ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
repo = "repo-name"
username = "username"
branch = "main"
The config file is searched in this order:
--config / --config-file./config.toml$XDG_CONFIG_HOME/upgit/config.toml or %APPDATA%\\upgit\config.toml~/.upgit.config.toml~/.config/upgitrcconfig.toml and upgit.toml next to the binary--application-path changes the binary-dir lookup. After each upload, history.log and upgit.log are written in that directory unless --no-log. Uploads run one at a time unless --jobs is set.
UPGIT_TOKENUPGIT_RENAMEUPGIT_USERNAMEUPGIT_REPOUPGIT_BRANCHAny config key can also be set with UPGIT_ and __ for nesting (Kong-style):
export UPGIT_DEFAULT=smms
export UPGIT_UPLOADERS__GITHUB__PAT=PASTE_YOUR_TOKEN
export UPGIT_UPLOADERS__GITHUB__USERNAME=your-user
export UPGIT_NAMING='{year}/{month}/{fname}_{unix}{ext}'
In following way:
[output_formats]
"bbcode" = "[img]{url}[/img]"
"html" = ''
"markdown-simple" = ""
Placeholder:
{url}: URL to image{fname}: Original file basename{url_fname}: File basename from urlExample usage:
# Upload clipboard and save link to clipboard as bbcode format
upgit --clipboard -o clipboard -f bbcode
If you used the previous Go 0.2 upgit, flags such as :clipboard and --output-type, config paths, and Qiniu credentials changed. There is no extensions/ directory. See Upgrading from 0.2.
Optional: cargo install --git https://github.com/pluveto/upgit
暂无开放 Issues,或尚未同步最近议题。