{"id":13582266,"url":"https://github.com/forestnode-io/oneshot","last_synced_at":"2025-04-06T14:12:26.739Z","repository":{"id":54523790,"uuid":"271395959","full_name":"forestnode-io/oneshot","owner":"forestnode-io","description":"A first-come first-served single-fire HTTP server. Easily transfer files to and from your terminal and any browser.","archived":false,"fork":false,"pushed_at":"2023-11-04T01:37:50.000Z","size":2658,"stargazers_count":328,"open_issues_count":3,"forks_count":9,"subscribers_count":11,"default_branch":"v2","last_synced_at":"2024-04-10T10:21:16.603Z","etag":null,"topics":["cli","command-line","file-transfer","nat-traversal","p2p","terminal","upnp-portmapper","webrtc"],"latest_commit_sha":null,"homepage":"https://www.oneshot.uno","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/forestnode-io.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}},"created_at":"2020-06-10T22:09:23.000Z","updated_at":"2024-05-20T00:00:08.585Z","dependencies_parsed_at":"2024-01-14T09:57:40.393Z","dependency_job_id":"db91cc35-9250-4bbf-a1ca-63348fd4b2ed","html_url":"https://github.com/forestnode-io/oneshot","commit_stats":null,"previous_names":["raphaelreyna/oneshot","forestnode-io/oneshot","oneshot-uno/oneshot"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestnode-io%2Foneshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestnode-io%2Foneshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestnode-io%2Foneshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestnode-io%2Foneshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forestnode-io","download_url":"https://codeload.github.com/forestnode-io/oneshot/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492557,"owners_count":20947545,"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":["cli","command-line","file-transfer","nat-traversal","p2p","terminal","upnp-portmapper","webrtc"],"created_at":"2024-08-01T15:02:33.310Z","updated_at":"2025-04-06T14:12:26.722Z","avatar_url":"https://github.com/forestnode-io.png","language":"Go","funding_links":[],"categories":["Go","cli"],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/forestnode-io/oneshot/raw/master/oneshot_banner.png\" width=\"744px\" height=\"384px\"\u003e\n\n## oneshot v2\n\nA single-fire first-come-first-serve HTTP server.\n\n### Features\n- Send and receive to and from stdin or stdout.\n- Use external executables to process and respond to HTTP requests.\n- Reverse proxy and redirect HTTP requests.\n- Multiple methods of NAT traversal: UPnP-IGD, STUN and TURN (ICE).\n- Support for cloud integration with built in discovery / signalling server to allow for self hosted instances.\n- Works with any HTTP client including browsers, only one person needs to have oneshot installed.\n- Support for rich, machine-readable output; easily integrate oneshot into your pipelines.\n- Highly configurable HTTP responses, custom upload clients, and more.\n\n\n#### A video overview of oneshot (v1) (thanks to Brodie Robertson)\n\u003ca href=\"https://www.youtube.com/watch?v=ZOHvdMgplz4\"\u003e\n  \u003cimg src=\"https://img.youtube.com/vi/ZOHvdMgplz4/maxresdefault.jpg\" height=\"150px\"/\u003e\n\u003c/a\u003e\n\n### Installation\nThere are multiple ways of obtaining oneshot:\n\n\n#### Download binary (easiest)\n```shell\ncurl -L https://github.com/forestnode-io/oneshot/raw/v2/v2/install.sh | sudo sh\n```\n\n#### Linux / macOS\nCopy and paste any of these commands into your terminal to install oneshot.\nFor some portion of Linux users, there are .deb and .rpm packages available in the [release page](https://github.com/forestnode-io/oneshot/releases).\n\n\n##### Brew\n```bash\nbrew tap forestnode-io/brew\nbrew install forestnode-io/brew/oneshot\n```\n\n##### Go get\n```bash\ngo get -u -v github.com/forestnode-io/oneshot/v2\n```\n\n##### Compiling from source\n```bash\ngit clone https://github.com/forestnode-io/oneshot\ncd oneshot/v2\nsudo make install\n```\n\n#### Windows\n\n##### Download executable\nHead over to the [release page](https://github.com/forestnode-io/oneshot/releases) and download the windows .zip file.\n\n##### Go get\n```powershell\ngo get -u -v github.com/forestnode-io/oneshot/v2\n```\n\n### Use Cases \u0026 Examples\n\n#### Send a file\n```bash\n$ oneshot send path/to/file.txt\n```\nThen, from a browser (or any HTTP client) simply go to your computers I.P. address and the file download will be triggered.\n\n#### Send a file securely\n```bash\n$ oneshot send -u username -W path/to/file.txt\n```\nThe `-W` option will cause oneshot to prompt you for a password.\nOneshot also supports HTTPS, simply pass in the key and certificate using the `--tls-key` and `--tls-cert` flags.\n\n#### Receive a file\n```bash\n$ oneshot receive .\n```\nThe `receive` subcommand is used for receiving data from the client. \nA connecting browser will be prompted to upload a file which oneshot then save to the current directory.\n\n#### Receive a file to standard out\n```bash\n$ oneshot receive | jq '.first_name'\n```\nIf the receive subcommand is used and no directory is given, oneshot will write the received file to its standard out.\n\n#### Serve up a first-come-first-serve web page\n```bash\n$ oneshot send -D my/web/page.html\n```\nThe `-D` flag tells oneshot to not trigger a download client-side.\n\n#### Send the results of a lengthy process\n```bash\n$ sudo apt update | oneshot send -n apt-update.txt\n```\nOneshot can transfer from its standard input; by default files are given a random name.\nThe optional flag `-n` sets the name of the file.\n\n#### Wait until someone provides credentials to start a process, then send its output\n```bash\n$ oneshot send -u foo -P password -c my_non-cgi_script.sh\n```\nOneshot can run your scripts and programs in a CGI flexible CGI environment.\nEven non-CGI executables may be used; oneshot will provide its own default headers or you can set your own using the `-H` flag.\n\n#### Create a single-fire api in a single line\n```bash\n$ oneshot exec -- 'echo \"Hello $(jq -r '.name')!\"'\n```\nHere, the `exec` subcommand tells oneshot to run its input as a shell command in a flexible CGI environment.\n\nIn another terminal we can test our api:\n```bash\n$ curl -X POST -H 'Content-Type: application/json' -d '{\"name\": \"world\"}' localhost:8080\nHello World!\n```\n\n#### Receive a file, do work on it locally and send back the results\n```bash\n$ oneshot -u | gofmt | oneshot -J\n```\nThe `-J` flag we are using here tells oneshot to only start serving HTTP once it has received an EOF from its stdin.\nThis allows us to create unix pipelines without needing to specify a different port for each instance of oneshot.\nIn this scenario, the user would upload or type in some Go code and upon hitting the back button (refresh won't work !) or going back to the original URL, the user will receive their formatted Go code.\n\n\n\n### Reporting Bugs, Feature Requests \u0026 Contributing\nPlease report any bugs or issues [here](https://github.com/forestnode-io/oneshot/issues).\n\nI consider oneshot to be *nearly* feature complete; feature requests and contributions are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforestnode-io%2Foneshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforestnode-io%2Foneshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforestnode-io%2Foneshot/lists"}