{"id":16843737,"url":"https://github.com/stevelauc/pup","last_synced_at":"2025-09-03T01:32:51.705Z","repository":{"id":42035771,"uuid":"480735601","full_name":"SteveLauC/pup","owner":"SteveLauC","description":"A command-line tool that automatically uploads images from the markdown document to the GitHub repo and replaces the paths with the returned URL.","archived":false,"fork":false,"pushed_at":"2025-01-13T12:47:39.000Z","size":13441,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T04:13:04.584Z","etag":null,"topics":["cli","command-line-tool","markdown","pic-uploader"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SteveLauC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-12T09:16:02.000Z","updated_at":"2025-03-25T21:47:46.000Z","dependencies_parsed_at":"2024-01-01T06:22:30.015Z","dependency_job_id":"7444670e-cc39-42ca-b8d9-d2966157192d","html_url":"https://github.com/SteveLauC/pup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SteveLauC/pup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2Fpup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2Fpup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2Fpup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2Fpup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SteveLauC","download_url":"https://codeload.github.com/SteveLauC/pup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2Fpup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273377130,"owners_count":25094525,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","command-line-tool","markdown","pic-uploader"],"created_at":"2024-10-13T12:53:23.417Z","updated_at":"2025-09-03T01:32:51.679Z","avatar_url":"https://github.com/SteveLauC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pup \n[![BUILD](https://github.com/stevelauc/pup/workflows/Rust/badge.svg)](https://github.com/stevelauc/pup/actions/workflows/ci.yml)\n\nA command-line tool that automatically uploads images from the markdown document to\nthe GitHub repo and replaces the paths with the returned URL.\n\n# Table of contents\n\n  * [TO DO](https://github.com/SteveLauC/pup#to-do)\n  * [Supported platforms](https://github.com/SteveLauC/pup#supported-platforms)\n  * [Usage and Demo](https://github.com/SteveLauC/pup#demo-video)\n  * [Getting Started](https://github.com/SteveLauC/pup#getting-started)\n  * [What pup can NOT do](https://github.com/SteveLauC/pup#what-pup-can-not-do)\n  * [Uninstallation](https://github.com/SteveLauC/pup#uninstallation)\n  * [How it works](https://github.com/SteveLauC/pup#how-it-works)\n\n# TO DO\n\n- [x] Use system password management to store TOKEN\n- [x] Multithreading file manipulation\n- [x] Relative image path support\n- [ ] Async I/O\n\n# Supported platforms\n\nTheoretically, all UNIX platforms should be supported. But only tested on Linux \nwith Gnome Desktop.\n\n# Usage and Demo \n\n```shell\n$ pup --help\nA command-line tool that automatically uploads images from the markdown document to the GitHub repo and replaces the paths with the returned URL\n\n\nUsage: pup [OPTIONS] [FILEPATH]\n\nArguments:\n  [FILEPATH]  The target markdown or image file\n\nOptions:\n      --set-token     Set the token\n      --update-token  Update the token\n      --delete-token  Delete the token\n  -h, --help          Print help\n  -V, --version       Print version\n```\n\n![demo](https://user-images.githubusercontent.com/96880612/163975456-fdebdee0-f68f-4227-8f11-b1c72cb4eaa3.gif)\n\n# Getting started\n\n1. Go to [token-settings](https://github.com/settings/tokens) to generate a new\n   token, make sure it has access to your picture repo.\n\n2. get the `pup` binary\n\n   ```shell\n   $ cargo install --git https://github.com/SteveLauC/pup\n   ```\n\n3. Double check you have pup installed\n\n   ```shell\n   $ which pup\n   /home/$USER/.cargo/bin/pup\n   ```\n4. init config file\n\n   ```shell\n   $ pup\n   name is unset.\n   repo is unset.\n   mail is unset.\n   ```\n\n5. On your first run, `pup` will create a configuration file and complain about \n   the incompleteness of it to you. If you have `$XDG_CONFIG_HOME` validly set, \n   then it is located in `$XDG_CONFIG_HOME/pup`; Otherwise, it is under \n   `$HOME/.config/pup`\n\n6. Then edit it to make it complete.\n\n   ```shell\n   # vim $XDG_CONFIG_HOME/pup/config.toml if you have $XDG_CONFIG_HOME set\n   $ vim $HOME/.config/pup/config.toml\n   ```\n   Make it something like the following one, remeber to replace each field with your own one.\n\n   ```\n   github_user_name = \"SteveLauC\"\n   github_repo_name = \"test-repo\"\n   mail = \"stevelauc@outlook.com\"\n   ```\n7. Let's try it again!\n\n   ```shell\n   $ pup\n   No TOKEN available.\n   Use `pup --set-token` to set it\n   ```\n   Ohhhh, since we haven't entered a token yet, pup asks us to do this.\n\n8. Set the token: enter the token and press enter to confirm.\n\n   ```shell\n   $ pup --set-token\n   Please input the new TOKEN:  \n   ```\n8. All configuration is done! Time to enjoy:)\n\n   ```shell\n   $ pup your-markdown-file.md\n\n   # or \n\n   $ pup image.jpeg/jpg/png/gif\n   ```\n   \n# What pup can NOT do\n\n1. Puting multi images in a single line is not supported.\n2. The causes of failure may be confusing. For example, you may upload a photo \n   that has already been uploaded, perhaps you are expecting something like \n   `[FAILED]: DuplicateFile`, but pup will tell you `[FAILED]: ValidationFaile`.\n   \n\n# Uninstallation\n\n  If you have set TOKEN in pup, use `pup --delete-token` to delete it first.\n\n  Then:\n \n  ```shell\n  $ cargo uninstall pup\n  ```\n\n# How it works\n![workflow](https://github.com/SteveLauC/pic/blob/main/Page%201.jpeg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevelauc%2Fpup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevelauc%2Fpup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevelauc%2Fpup/lists"}