{"id":15062821,"url":"https://github.com/crewdevio/piwo","last_synced_at":"2025-08-24T19:26:05.269Z","repository":{"id":48583054,"uuid":"386755010","full_name":"crewdevio/Piwo","owner":"crewdevio","description":"🍺 Piwo is a friendly command-line HTTP client written in Deno environment","archived":false,"fork":false,"pushed_at":"2022-06-27T18:45:57.000Z","size":127,"stargazers_count":9,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T09:58:31.756Z","etag":null,"topics":["cli","deno","http","piwo","typescript"],"latest_commit_sha":null,"homepage":"https://crewdevio.mod.land/projects/piwo","language":"TypeScript","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/crewdevio.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}},"created_at":"2021-07-16T20:21:20.000Z","updated_at":"2023-02-04T09:05:40.000Z","dependencies_parsed_at":"2022-09-04T07:30:57.266Z","dependency_job_id":null,"html_url":"https://github.com/crewdevio/Piwo","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewdevio%2FPiwo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewdevio%2FPiwo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewdevio%2FPiwo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewdevio%2FPiwo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crewdevio","download_url":"https://codeload.github.com/crewdevio/Piwo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198885,"owners_count":21063628,"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","deno","http","piwo","typescript"],"created_at":"2024-09-24T23:46:59.005Z","updated_at":"2025-04-10T10:11:22.647Z","avatar_url":"https://github.com/crewdevio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePiwo\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://cdn.discordapp.com/attachments/845424135018250283/869636557328482344/unknown.png\" width=\"800\"\u003e\n\u003c/p\u003e\n\n## About\n\nPiwo is a friendly command-line tool to do HTTP request to a API server. Sending\nrequest body as JSON.\n\n## Installation\n\n```console\ndeno install -A --import-map=https://deno.land/x/piwo/import_map.json -n piwo --no-check https://deno.land/x/piwo/cli.ts\n```\n\nThe permissions that Piwo uses are:\n\n- --allow-net\n- --allow-read\n- --allow-write\n- --allow-env\n\n## Updating Piwo\n\n```console\ndeno install -f -r -A --import-map=https://deno.land/x/piwo/import_map.json -n piwo --no-check https://deno.land/x/piwo/cli.ts\n```\n\nCheck if Piwo has been updated\n\n```console\npiwo --version\n```\n\n## Using without install\n\n```console\ntrex exec piwo [...args] or trex exec piwo@[version] [...args]\n```\n\n## Usage\n\n### Syntax\n\n```console\npiwo [METHOD] [URL] [BODY]\n```\n\n`METHOD`: must be uppercase and they can be `GET`, `POST`, `PUT`, `PATCH` and\n`DELETE`. If you don't send a method Piwo will make a `GET` (default) request.\n\n`URL`: you can omit the protocol in the url (http or https).\n\n`BODY`: the body is JSON (default).\n\n### Make a GET request\n\n```console\npiwo GET https://api.github.com/\n```\n\nA shortest way:\n\n```console\npiwo api.github.com\n```\n\n### Make a POST, PATCH or PUT request sending a body/JSON\n\n```console\npiwo POST localhost:3000/send_your_foo foo=bar\n```\n\nIf you need to send a value with spaces, use quotes.\n\n```console\npiwo PATCH localhost:3000/update_your_foo foo=\"this is my bar\"\n```\n\nYou can also send multiple values, just separing with spaces\n\n```console\npiwo POST localhost:3000/signup username=foo password=bar\n```\n\n### Make a DELETE request\n\n```console\npiwo DELETE localhost:3000/your_foo/remove\n```\n\n### Sendin a property with object value type\n\n```console\npiwo POST localhost:3000/cli/registry cli={name=piwo description=\"your friendly HTTP cli tool\"}\n```\n\n### Sending a property with array value type\n\n```console\npiwo PATCH localhost:3000/cli/piwo tags=[typescript deno cli http]\n```\n\n### Send a form/body\n\nYou just need to add the --form flag\n\n```console\npiwo --form POST localhost:3000/ search_query=\"foo bar\"\n```\n\n## Run command usage\n\nCreate a `request.json` file in your project. The keys that piwo are expecting\nfrom the file are names or aliases that can be called in the console, and this\naliases should have as value a config similar to the\n[fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#headers)\nconsidering that it is not possible to execute javascript code in a json file\n\n#### Example\n\n```json\n{\n  \"github\": {\n    \"method\": \"GET\",\n    \"url\": \"https://api.github.com\"\n  }\n}\n```\n\nRun the next code in your command-line:\n\n```console\npiwo run github\n```\n\n### Send a JSON\n\n```json\n{\n  \"new-task\": {\n    \"method\": \"POST\",\n    \"url\": \"http://localhost:8080/task/\",\n    \"headers\": {\n      \"Content-Type\": \"application/json\"\n    },\n    \"body\": {\n      \"name\": \"read a json file\",\n      \"description\": \"piwo should read a json file to simplify a request\"\n    }\n  }\n}\n```\n\n```console\npiwo run new-task\n```\n\n### Send a Form\n\n```json\n{\n  \"foo:form\": {\n    \"method\": \"POST\",\n    \"url\": \"http://localhost:8080/\",\n    \"headers\": {\n      \"Content-Type\": \"application/x-www-form-urlencoded\"\n    },\n    \"body\": {\n      \"foo\": \"bar\"\n    }\n  }\n}\n```\n\n```console\npiwo run foo:form\n```\n\n`Content-Type` value can be `multipart/form-data`;\n\n## Some nice tips\n\n### How URL argument works\n\nWhen you're doing a request you can omit the protocol, Piwo will make a request\nwith https, if get not response then will try with the http protocol and then\nwill output the response of the server or a msg that couldn't connect when no\nserver is found.\n\nWhen you send the URL with protocol Piwo will not check the other protocol.\n\nIf you're sure that the server is on http protocol, we recommend you to pass the\nprotocol in the url, is faster because piwo will do a direct request with the\nprocotol and will not check the https procotol.\n\nIf the url is a localhost, then will first try with HTTP.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewdevio%2Fpiwo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrewdevio%2Fpiwo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewdevio%2Fpiwo/lists"}