{"id":13615171,"url":"https://github.com/pluveto/upgit","last_synced_at":"2025-05-15T13:09:02.491Z","repository":{"id":41958211,"uuid":"453007042","full_name":"pluveto/upgit","owner":"pluveto","description":"Another upload hub that supports clipboard. It works well with Typora, Snipaste, VSCode.","archived":false,"fork":false,"pushed_at":"2025-03-25T05:37:09.000Z","size":267,"stargazers_count":580,"open_issues_count":15,"forks_count":47,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T03:49:56.495Z","etag":null,"topics":["chevereto","command","github","image","imgbb","imgur","obsidian","typora","upload","uploader"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pluveto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-28T09:21:24.000Z","updated_at":"2025-04-09T18:20:13.000Z","dependencies_parsed_at":"2024-09-16T06:04:33.651Z","dependency_job_id":"c76aa85d-b5b6-4e90-af4a-1020ef84df8a","html_url":"https://github.com/pluveto/upgit","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fupgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fupgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fupgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fupgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pluveto","download_url":"https://codeload.github.com/pluveto/upgit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346623,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chevereto","command","github","image","imgbb","imgur","obsidian","typora","upload","uploader"],"created_at":"2024-08-01T20:01:10.226Z","updated_at":"2025-05-15T13:08:57.484Z","avatar_url":"https://github.com/pluveto.png","language":"Go","readme":"# ![upgit](https://cdn.jsdelivr.net/gh/pluveto/upgit/logo.png)\r\n\r\n\u003cimg align=\"right\" src=\"https://img.shields.io/github/workflow/status/pluveto/upgit/Release?logo=go\u0026style=flat-square\" /\u003e\r\n\r\n\u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white\" /\u003e \u003cimg src=\"https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\u0026logo=ubuntu\u0026logoColor=white\" /\u003e \u003cimg src=\"https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=F0F0F0\" /\u003e\r\n\r\n**Languages**: English / [简体中文](docs/README.zh-CN.md)\r\n\r\n*Upgit* is a native \u0026 lightweight tool to helps you upload any file to your Github repository and then get a raw URL for it.\r\n\r\nThis is also useful with [Typora](https://support.typora.io/Upload-Image/#image-uploaders) as an image uploader.\r\n\r\n## Feature\r\n\r\n+ Integrate with VSCode via [extension](https://github.com/pluveto/upgit-vscode-extension)\r\n+ Support for Linux, Windows and macOS\r\n+ Upload any file to given remote github repo folder\r\n+ Upload from **clipboard**\r\n+ Custom auto **renaming** rules\r\n+ **CDN** via replacing rules\r\n+ Config via **Environment Variable**\r\n+ Output URL to stdout/clipboard, supports markdown image format\r\n\r\n### Supported Upload Extensions\r\n\r\n+ Github\r\n+ S3 Compatible Storages\r\n   \u003c!-- (AWS, MinIO, Cloudflare R2, etc.) --\u003e\r\n   + AWS S3\r\n   + MinIO\r\n   + Cloudflare R2\r\n   + Ceph\r\n   + Backblaze\r\n   + Flexify.IO\r\n   + IBM Cloud Object Storage\r\n   + DigitalOcean Spaces\r\n   + Wasabi\r\n+ Gitee\r\n+ Tencent QcloudCOS\r\n+ Qiniu Kodo\r\n+ Upyun\r\n+ Hello\r\n+ Niupic\r\n+ SM.MS\r\n+ Imgur\r\n+ ImgUrl.org\r\n+ CatBox\r\n+ LSkyPro\r\n+ Chevereto\r\n+ ImgBB\r\n+ Cloudinary\r\n+ EasyImage\r\n+ DALEXNI\r\n+ AliyunOSS\r\n\r\nMore: `./upgit ext ls`\r\n\r\n## Get started\r\n\r\n### Download\r\n\r\nDownload it from [Release](https://github.com/pluveto/upgit/releases).\r\n\r\n\u003e If you have no idea which to download:\r\n\u003e\r\n\u003e + For most Windows users, choose `upgit_win_amd64.exe`\r\n\u003e + For most macOS users, choose `upgit_macos_arm64`\r\n\u003e + Execute `chmod +x upgit` if permission is needed\r\n\r\nRename it 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.\r\n\r\n**Warning:** this program doesn't contain an auto-updater. If you need to keep updated, just give *upgit* a ⭐star.\r\n\r\n### Config\r\n\r\nCreate `config.toml` in the same directory of *upgit*, and fill it in following [this sample config file](https://github.com/pluveto/upgit/blob/main/config.sample.toml).\r\n\r\n### Use it\r\n\r\nTo upload file `logo.png` with rename rules, execute:\r\n\r\n```shell\r\n./upgit logo.png\r\n# for windows: .\\upgit.exe logo.png\r\n```\r\n\r\nThen you'll see a link to `logo.png`.\r\n\r\nTo upload file `logo.png` to remote folder `/my_images/demo`, execute:\r\n\r\n```shell\r\n./upgit logo.png -t /my_images/demo\r\n# for Windows: .\\upgit.exe logo.png -t /my_images/demo\r\n```\r\n\r\n---\r\n\r\nFor more help, type `-h` argument\r\n\r\n```\r\n\r\nUpload anything to github repo or other remote storages and then get its link.\r\nFor more information: https://github.com/pluveto/upgit\r\n\r\nUsage: upgit [--target-dir TARGET-DIR] [--verbose] [--size-limit SIZE-LIMIT] [--wait] [--config-file CONFIG-FILE] [--clean] [--raw] [--no-log] [--uploader UPLOADER] [--output-type OUTPUT-TYPE] [--output-format OUTPUT-FORMAT] [--application-path APPLICATION-PATH] FILE [FILE ...]\r\n\r\nPositional arguments:\r\n  FILE                   local file path to upload. :clipboard for uploading clipboard image\r\n\r\nOptions:\r\n  --target-dir TARGET-DIR, -t TARGET-DIR\r\n                         upload file with original name to given directory. if not set, will use renaming rules\r\n  --verbose, -V          when set, output more details to help developers\r\n  --size-limit SIZE-LIMIT, -s SIZE-LIMIT\r\n                         in bytes. overwrite default size limit (5MiB). 0 means no limit\r\n  --wait, -w             when set, not exit after upload, util user press any key\r\n  --config-file CONFIG-FILE, -c CONFIG-FILE\r\n                         when set, will use specific config file\r\n  --clean, -C            when set, remove local file after upload\r\n  --raw, -r              when set, output non-replaced raw url\r\n  --no-log, -n           when set, disable logging\r\n  --uploader UPLOADER, -u UPLOADER\r\n                         uploader to use. if not set, will follow config\r\n  --output-type OUTPUT-TYPE, -o OUTPUT-TYPE\r\n                         output type, supports stdout, clipboard [default: stdout]\r\n  --output-format OUTPUT-FORMAT, -f OUTPUT-FORMAT\r\n                         output format, supports url, markdown and your customs [default: url]\r\n  --application-path APPLICATION-PATH\r\n                         custom application path, which determines config file path and extensions dir path. current binary dir by default\r\n  --help, -h             display this help and exit\r\n\r\nManage extensions:\r\nupgit ext ACTION\r\n\r\nActions:\r\n  ls                     list all downloadable extensions\r\n  my                     list all local extensions\r\n  add smms.jsonc         install SMMS uploader\r\n  remove smms.jsonc      remove SMMS uploader\r\n```\r\n\r\n### Use it for Typora\r\n\r\n\u003e Assuming your *upgit* program is saved at `\"C:\\repo\\upgit\\upgit.exe\"`.\r\n\r\nSelect *File \u003e Preferences...*\r\n\r\n![image-20220128204217802](https://cdn.jsdelivr.net/gh/pluveto/0images@master/2022/01/upgit_20220128_1643373863.png)\r\n\r\nMove to *Image*. Choose *Custom Command* as your *Image Uploader*.\r\n\r\nInput *upgit* program location into *Command* textbox.\r\n\r\n\u003e You can click *Test Uploader* button to make sure it works.\r\n\r\n![image-20220128204418723](https://cdn.jsdelivr.net/gh/pluveto/0images@master/2022/01/upgit_20220128_1643373868.png)\r\n\r\nNow enjoy it!\r\n\r\n### Upload Clipboard Image\r\n\r\nUse `:clipboard` place holder for clipboard image. (Only supports **png** format)\r\n\r\n```shell\r\n./upgit :clipboard\r\n```\r\n\r\nShortcuts for screenshot:\r\n\r\n+ On macOS, use `Ctrl+Shift+Cmd+4`\r\n+ On Linux/Ubuntu, use `Ctrl+Shift+PrintScreen`\r\n+ On Windows, use `Shift+Win+s`\r\n\r\n### Upload Clipboard Files\r\n\r\n**Note:** This feature is only supported on Windows.\r\n\r\nUse `:clipboard-files` or `:clipboard-file` place holder for clipboard files. Both will upload all files in clipboard.\r\n\r\n```shell\r\n./upgit :clipboard-files\r\n```\r\n\r\nBecause golang doesn't support clipboard file list, so *upgit* will use [APIProxy-Win32](https://github.com/pluveto/APIProxy-Win32) to get clipboard file list. It will be downloaded automatically when you first use this feature.\r\n\r\n### Save URL to Clipboard\r\n\r\nUse `--output-type clipboard`:\r\n\r\n```shell\r\n./upgit logo.png --output-type clipboard\r\n# or .\\upgit.exe :clipboard -o clipboard\r\n```\r\n\r\n#### Copy as Markdown format\r\n\r\nAdd argument `--output-format markdown`:\r\n\r\n```shell\r\n./upgit logo.png --output-type clipboard --output-format markdown\r\n# or .\\upgit.exe :clipboard -o clipboard -f markdown\r\n```\r\n\r\nThen you'll get a markdown image link in your clipboard like:\r\n\r\n```\r\n![logo.png](!https://cdn.jsdelivr.net/gh/pluveto/upgit/logo.png)\r\n```\r\n\r\n### Best practice with AHK\r\n\r\nFor Windows user:\r\n\r\n1. Install AHK\r\n\r\n2. Create this script `upload_clipboard.ahk` and run:\r\n\r\n   ```ahk\r\n   ; Press Ctrl + F9 to upload clipboard image\r\n   ^F9::\r\n   RunWait, \"upgit.exe\" :clipboard --output-type clipboard --output-format markdown\r\n   return\r\n   ```\r\n\r\n3. Then press \u003ckbd\u003eWin\u003c/kbd\u003e\u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eS\u003c/kbd\u003e to take screenshot. \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eF9\u003c/kbd\u003e to upload it and get its link to your clipboard!\r\n\r\n**Compatible with Snipaste**\r\n\r\n(Windows Only, from v0.1.5) We recently added support for Snipaste bitmap format. Just copy screenshot and upload!\r\n\r\n## Config Instructions\r\n\r\n| Key                   | Desc                                                         |\r\n| --------------------- | ------------------------------------------------------------ |\r\n| username              | Your Github username, like `pluveto`                         |\r\n| repo                  | Your Github repository name, like `upgit`                    |\r\n| branch                | The branch for saving files, like `master` or `main`         |\r\n| pat                   | Personal Access Token. Visit [GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more info |\r\n| rename                | Renaming rule. Path separator `/` will create directories if not exists. Supporting: |\r\n| -- `{year}`           | -- Year like `2006`                                          |\r\n| -- `{month}`          | -- Month like `01`                                           |\r\n| -- `{day}`            | -- Day like `02`                                             |\r\n| -- `{hour}`            | -- Hours of current time                                              |\r\n| -- `{minute}`            | -- Minutes of current time  |\r\n| -- `{second}`            | -- Seconds of current time  |\r\n| -- `{unix_ts}`        | -- Unix timestamp in second. Like `1643373370`.              |\r\n| -- `{unix_tsms}`        | -- Unix timestamp in microsecond. Like `1644212979622`.              |\r\n| --- `{ext}`           | -- Extension like `.png`, and empty when the original file has no extension |\r\n| -- `{fname}`      | -- Original file base name like `demo` (without extension)   |\r\n| -- `{fname_hash}` | -- MD5 Hash in hex of `{fname}`                          |\r\n| -- `{fname_hash4}` | -- MD5 Hash in hex of `{fname}`, first 4 digits                          |\r\n| -- `{fname_hash8}` | -- MD5 Hash in hex of `{fname}`, first 8 digits                          |\r\n\r\nHere is a simplist sample config file:\r\n\r\n```toml\r\nrename = \"{year}/{month}/upgit_{year}{month}{day}_{unix_ts}{ext}\"\r\n[uploaders.github]\r\npat = \"ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\r\nrepo = \"repo-name\"\r\nusername = \"username\"\r\n```\r\n\r\n### Config via Environment Variables\r\n\r\n+ `UPGIT_TOKEN`\r\n+ `UPGIT_RENAME`\r\n+ `UPGIT_USERNAME`\r\n+ `UPGIT_REPO`\r\n+ `UPGIT_BRANCH`\r\n\r\n### Custome output format\r\n\r\nIn follwing way:\r\n\r\n```toml\r\n[output_formats]\r\n\"bbcode\" = \"[img]{url}[/img]\"\r\n\"html\" = '\u003cimg src=\"{url}\" /\u003e'\r\n\"markdown-simple\" = \"![]({url})\"\r\n```\r\n\r\nPlaceholder:\r\n\r\n+ `{url}`: URL to image\r\n+ `{fname}`: Original file basename\r\n+ `{url_fname}`: File basename from url\r\n\r\nExample usage:\r\n\r\n```\r\n# Upload clipboard and save link to clipboard as bbcode format\r\nupgit :clipboard -o clipboard -f bbcode\r\n```\r\n\r\n## Todo\r\n\r\n+ [x] Upload to specific folder\r\n+ [x] Upload and get raw URL that is not replaced.\r\n+ [x] Upload clipboard image\r\n+ [x] Save uploaded image link to clipboard\r\n+ [ ] Upload from link\r\n+ [x] Ignore uploaded file (link input)\r\n+ [x] Upload history\r\n","funding_links":[],"categories":["Go","工具"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fupgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpluveto%2Fupgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fupgit/lists"}