{"id":16895692,"url":"https://github.com/ytti/pc","last_synced_at":"2025-08-01T07:34:46.998Z","repository":{"id":67967361,"uuid":"193762657","full_name":"ytti/pc","owner":"ytti","description":"command line client for pastebin et al.","archived":false,"fork":false,"pushed_at":"2019-06-25T18:32:50.000Z","size":298,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T10:23:50.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ytti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2019-06-25T18:30:33.000Z","updated_at":"2023-07-04T08:21:53.000Z","dependencies_parsed_at":"2023-05-17T17:00:52.056Z","dependency_job_id":null,"html_url":"https://github.com/ytti/pc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ytti/pc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytti","download_url":"https://codeload.github.com/ytti/pc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fpc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268185561,"owners_count":24209392,"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-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2024-10-13T17:25:31.218Z","updated_at":"2025-08-01T07:34:46.961Z","avatar_url":"https://github.com/ytti.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pc\n\npc (paste-client) is a command line tool for uploading text to a pastebin\nserver. It supports many different pastebin style servers, and is highly\nconfigurable.  It aims to be simple, work with stdin/stdout, and adhere to the\nunix philosophy.\n\nPlease note that until v1 is released, the command line args api and config\nfile specification should be considered unstable. Anything could change without\nnotice. Please avoid using this non-interactively if you plan to update it\noften and do not want to debug failures because of api changes.\n\n## Features\n\n- Many supported servers. If your favourite pastebin isn't supported, please\n  open an issue.\n- Configuration file for providing defaults and server configurations.\n- Comprehensive command line help. Quickly list configured servers, backends,\n  full config, detailed backend information.\n- Comprehensive graceful error handling.\n- Baked in, sane defaults for use without config file.\n- Optional paste url history.\n- Optional arguments for servers that support extra features, such as title,\n  filetype, private pastes, expire time, etc.\n\n\n## Installation\n\nBuild from source:\n\n```\ngit clone git@github.com:swalladge/pc.git\ncd pc\ncargo build --release\n./target/release/pc --help\n# copy the binary ^ to your path to use from anywhere\n```\n\nInstall from crates.io with cargo:\n\n```\ncargo install pc\n```\n\nArch user repository: [pc-git](https://aur.archlinux.org/packages/pc-git/),\n[pc](https://aur.archlinux.org/packages/pc/).\n\n\n## Usage examples\n\nSimplest, out of the box usage:\n\n```\n$ echo \"Hello\" | pc\nhttps://paste.rs/saC\n```\n\nSelect a custom server:\n\n```\n$ pc vpaste \u003c code.txt\nhttp://vpaste.net/example\n```\n\nEach configured server accepts cli args to override defaults, depending on\nwhich backend is used. Here, the `fedora` server block uses the `modern_paste`\nbackend, which allows setting a custom title for the paste.\nNote: can only use server-specific args if specifying the server on the cli.\n\n```\n$ pc fedora --title \"foo debug log\" \u003c debug.log\nhttps://paste.fedoraproject.org/paste/7Taaazf88VimfqOnriOsFg\n```\n\nTo see a server block's configuration, backend, and allowed args:\n\n```\n$ pc fedora --help\n[servers.fedora]\nbackend = \"modern_paste\"\nurl = \"https://paste.fedoraproject.org/\"\ntitle = \"my paste\"\nexpires = \"10m\"\nsyntax = \"python\"\npassword = \"password123\"\napikey = \"BbK1F09sZZXL2335iqDGvGeQswQUcvUmzxMoWjp3yvZDxpWwRiP4YQL6PiUA8gy2\"\n---\n\nmodern_paste backend\n\nUSAGE:\n    fedora [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -k, --apikey \u003capikey|NONE\u003e        Upload paste as authenticated user\n    -e, --expires \u003cduration|NONE\u003e     Time to live as a duration\n    -P, --password \u003cpassword|NONE\u003e    Protects paste access with a password\n    -s, --syntax \u003cfiletype|NONE\u003e      Filetype for syntax highlighting\n    -t, --title \u003ctitle|NONE\u003e          Title for the paste\n    -u, --url \u003curl\u003e                   Overrides url set in config\n```\n\nShow a concise list of configured servers available to use:\n\n```\n$ pc list\nrs =\u003e paste_rs | https://paste.rs/ [default]\nvpaste =\u003e vpaste | http://vpaste.net/\nhaste =\u003e haste | https://hastebin.com/\n...\n```\n\nList all supported backends:\n\n```\n$ pc list-backends\npaste_rs\nhaste\nvpaste\n...\n```\n\nShow info and configuration help for a particular backend:\n\n```\n$ pc show-backend fiche\nFiche backend.\nSupports any servers running fiche \u003chttps://github.com/solusipse/fiche\u003e.\n(for example: termbin.com)\n\nExample config block:\n\n    [servers.termbin]\n    backend = \"fiche\"\n    url = \"termbin.com\"\n\n    # Optional values\n\n    # default port if missing is 9999\n    port = 9999\n\n```\n\nDump the current config as interpreted. Helpful for debugging.\n\n```\n$ pc dump-config\n\u003ctoml config as currently used\u003e\n```\n\nCopy the default config to the user config file. Could be useful for first\nsetup (although the [example config](./example_config.toml) with comments may\nbe more helpful).\n\n```\n$ mkdir -p ~/.config/pc/ \u0026\u0026 pc -c NONE dump-config \u003e ~/.config/pc/config.toml\n```\n\nHistfile feature can also be disabled temporarily with args:\n\n```\n$ echo \"hi\" | pc --histfile NONE\nhttp://vpaste.net/example\n```\n\n\n## Configuration\n\nConfiguration is via a toml file. The configuration file is determined by the\nfollowing:\n\n1. file given to the `-c` command line arg\n  a) if filename is `NONE`, skip to 5\n  b) if file isn't found, exit with error\n2. otherwise use `$XDG_CONFIG_HOME/pc/config.toml` if exists\n3. otherwise use `$HOME/.config/pc/config.toml` if exists\n5. finally, no files found; use defaults (see what defaults\n   are with `pc -c NONE dump-config` or see the default config file in this\n   repo.\n\nSee [example_config.toml](./example_config.toml) for an example config file\nwith an exhaustive listing of options.  See also\n[default_config.toml](./default_config.toml), which gets compiled into the\nbinary and used as the default config if no config file found.\n\n\n## Supported server backends\n\n| server spec                                                         | backend         | example instance                 |\n| ------                                                              | -------         | ---------------                  |\n| [dpaste.com](http://dpaste.com/api/v2/)                             | `dpaste_com`    | http://dpaste.com/               |\n| [dpaste](https://github.com/bartTC/dpaste)\\*                        | `dpaste`        | https://dpaste.de/               |\n| [fiche](https://github.com/solusipse/fiche)\\*                       | `fiche`         | https://termbin.com/             |\n| [haste](https://github.com/seejohnrun/haste-server)\\*               | `haste`         | https://hastebin.com/            |\n| [ix.io](http://ix.io/)                                              | `ix`            | http://ix.io/                    |\n| [modern paste](https://github.com/LINKIWI/modern-paste)\\*           | `modern_paste`  | https://paste.fedoraproject.org/ |\n| [one-time secret](https://github.com/onetimesecret/onetimesecret)\\* | `onetimesecret` | https://onetimesecret.com/       |\n| [p.ip.fi](http://p.ip.fi/)                                          | `pipfi`         | http://p.ip.fi/                  |\n| [paste.rs](https://paste.rs/web)                                    | `paste_rs`      | https://paste.rs/                |\n| [sprunge](https://github.com/rupa/sprunge)\\*                        | `sprunge`       | http://sprunge.us/               |\n| [ubuntu](https://paste.ubuntu.com/)                                 | `ubuntu`        | https://paste.ubuntu.com/        |\n| [vpaste](http://pileus.org/tools/vpaste)\\*                          | `vpaste`        | http://vpaste.net/               |\n\n\\*: open source; possible to self-host or find alternate public servers.\n\nSee the [server list](docs/server-list.md) for a list of public server instances supported.\n\nSee also the [feature matrix page](docs/feature-matrix.md) for which features\neach backend supports.\n\n\n## Development\n\nStandard cargo project. `cargo build`, `cargo run`, et al.\n\nThere is a Makefile for some other common tasks. Eg. `make fmt` will run\nrustfmt on all source files. `make test` will run some basic tests.\n\n\n## Related projects\n\n- [pastebinit](https://launchpad.net/pastebinit): similar concept, supports\n  config file, several pastebin servers, and options like private paste, set\n  title, etc. An advantage is that this is available in several distros'\n  official repos.\n- curl: most lightweight pastebins support uploading text in a curl-friendly\n  way. Eg. `\u003ccommand\u003e | curl -F 'sprunge=\u003c-' http://sprunge.us` for sprunge.\n  This is the simplest and most lightweight option, but requires remembering\n  the specific curl arguments or setting up a shell alias for easy use.\n- server/site-specific clients include: [ix](http://ix.io/client),\n  [gist](https://github.com/defunkt/gist),\n  [fb](https://git.server-speed.net/users/flo/fb/) (paste.xinu.at), ...\n\nSee the [archwiki list of pastebin clients](https://wiki.archlinux.org/index.php/List_of_applications/Internet#Pastebin_clients) for other related projects.\n\n\n## License\n\nCopyright © 2019 Samuel Walladge\n\nDual licensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytti%2Fpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fpc/lists"}