{"id":29491105,"url":"https://github.com/alp1n3-dev/cast","last_synced_at":"2026-05-08T10:32:23.613Z","repository":{"id":304470548,"uuid":"930513019","full_name":"alp1n3-dev/cast","owner":"alp1n3-dev","description":"A CLI tool to enable easy HTTP requests to be completed via the CLI or file-based workflows.","archived":false,"fork":false,"pushed_at":"2025-05-27T20:00:08.000Z","size":349371,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T20:54:50.846Z","etag":null,"topics":["api","api-client","assertions","brew","cli","command-line-tool","http","http-requests","https","macos","testing","tool"],"latest_commit_sha":null,"homepage":"https://cast.alp1n3.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alp1n3-dev.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-10T18:51:22.000Z","updated_at":"2025-05-27T20:00:11.000Z","dependencies_parsed_at":"2025-07-13T10:56:49.481Z","dependency_job_id":"3f4d263a-da89-44b1-83d4-1947915f0150","html_url":"https://github.com/alp1n3-dev/cast","commit_stats":null,"previous_names":["alp1n3-eth/cast"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alp1n3-dev/cast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp1n3-dev%2Fcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp1n3-dev%2Fcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp1n3-dev%2Fcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp1n3-dev%2Fcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alp1n3-dev","download_url":"https://codeload.github.com/alp1n3-dev/cast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp1n3-dev%2Fcast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32776644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","api-client","assertions","brew","cli","command-line-tool","http","http-requests","https","macos","testing","tool"],"created_at":"2025-07-15T14:00:47.918Z","updated_at":"2026-05-08T10:32:23.605Z","avatar_url":"https://github.com/alp1n3-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cast\n\nA CLI tool to enable easy HTTP requests to be completed via the CLI or file-based workflows.\n\n\u003e [!NOTE]\n\u003e This is under active development. It is unstable.\n\n**Using It:**\n\n```bash\ncast post https://example.com/api/v1/userUpdate -B newName=Greg -H X-Api-Key:12320f-r434rf-g3tg45\n```\n\n[![asciicast](https://asciinema.org/a/lKxrZCiO2oF70hl9kweiBrggm.svg)](https://asciinema.org/a/lKxrZCiO2oF70hl9kweiBrggm)\n\nHTTP and OpenAPI are great standards. **This tool's intent is to revolve around _just_ them.**\n\nThe focus of the CLI input and file-based scripting is to keep it simple and obvious, which requires being a little explicit. Things like:\n\n- Methods are required. We don't choose a default for you.\n- The protocol is required. We don't assume what you're using.\n- Past that, the order doesn't matter, but it is broken up by flags to ensure it's obvious you're putting something in a header, vs. a body, vs. calling a different argument.\n\n**Guiding Ethos**\n\n- [Clear is better than clever](https://go-proverbs.github.io)\n- [Every tool is targeted towards a specific use and thrive in specific scenarios](https://news.ycombinator.com/item?id=43239153)\n\n## Install\n\n### Using Git\n\n```bash\ngit clone --depth 1 https://github.com/alp1n3-eth/cast.git ~/.cast\nbrew install go\ngo build -C ~/.cast\n```\n\nAdd it to path with:\n\n```bash\n\n```\n\n### Pkg Repos\n\n#### macOS\n\n- homebrew: `brew install cast`\n\n#### Linux\n\n- pacman (arch via aur): ``\n\n### Last Resort for macOS: Releases\n\n**Releases are not signed / notarized. You will have to allow the program via system preferences.**\n\n## Example(s) / Usage\n\n### CLI Usage\n\n```bash\ncast [ method ] [ url ] \u003cargs\u003e\n```\n\n- anything after the url isn't required.\n- the method _then_ url order cannot change.\n- output is _just_ the full first response by default.\n\n**GET Request with Custom Headers and Syntax Highlighting:**\n\n```bash\ncast get https://google.com -H test:test1 -H test2:test3 --highlight\n```\n\n![image](./documentation/example_screenshots/readme_example_1.png)\n\n### File Usage\n\n- **asserts are not required**.\n- After a requests body it'll keep looking and won't start a new request until it finds a `[post]` or `[request]`.\n- Comments can be included before or after the request. If you don't want to assert but need to leave comments directly after a body, just do: `[post]` and leave the comments after it.\n- Asserts are separated from each other by newlines.\n- A `Host` header **is required** for clarity.\n- If a variable is hardcoded, it'll will act as the default value. This means if for whatever reason a value doesn't end up being stored in the variable, the variable will be sent instead.\n- Content-type will be auto-assigned if one isn't entered.\n\n```bash\n# Authentication Sequence\n[vars]\nbase_url = \"https://api.example.com/v1\"\nuuid = uuid()\nenv_token = env.get(\"API_TOKEN\")\nhost_header = \"Host: example.com\"\n\n[request]\nPOST /auth HTTP/1.1\n{{ host_header }} # The host header is required.\n# Content-Type: application/json - will be auto-detected and set\nX-Request-ID: {{ uuid }}\n\n{\n  \"user\": \"{{ user }}\",\n  \"pass\": \"{{ env_token }}\"\n}\n\n[assert]\nstatus 200\nheader \"Location\"\nheader NOT \"X-Rate-Limit\"\n\n[vars]\nauth_token = \"$.token\"\n\n# Request Resources Endpoint\n[request]\nGET /resources HTTP/1.1\n{{ host_header }}\nAuthorization: Bearer {{auth_token}}\n```\n\n## Quick Comparisons\n\n### With Httpie\n\n### With hurl\n\n### With xh\n\n### With cURL\n\n### Benchmark\n\n`hyperfine` used on an M1 Macbook Air:\n\n```bash\nhyperfine --runs 5 './cast get https://www.google.com' 'http get https://www.google.com' 'xh get https://www.google.com' 'curl https://www.google.com' --warmup 5\nBenchmark 1: ./cast get https://www.google.com\n  Time (mean ± σ):     222.5 ms ±   4.6 ms    [User: 15.8 ms, System: 8.4 ms]\n  Range (min … max):   216.9 ms … 228.4 ms    5 runs\n\nBenchmark 2: http get https://www.google.com\n  Time (mean ± σ):     332.3 ms ±   8.9 ms    [User: 132.1 ms, System: 31.5 ms]\n  Range (min … max):   324.3 ms … 347.0 ms    5 runs\n\nBenchmark 3: xh get https://www.google.com\n  Time (mean ± σ):     335.0 ms ±  11.7 ms    [User: 96.1 ms, System: 10.6 ms]\n  Range (min … max):   325.4 ms … 354.2 ms    5 runs\n\nBenchmark 4: curl https://www.google.com\n  Time (mean ± σ):     195.0 ms ±   5.6 ms    [User: 14.0 ms, System: 10.0 ms]\n  Range (min … max):   188.4 ms … 201.9 ms    5 runs\n\nSummary\n  curl https://www.google.com ran\n    1.14 ± 0.04 times faster than ./cast get https://www.google.com\n    1.70 ± 0.07 times faster than http get https://www.google.com\n    1.72 ± 0.08 times faster than xh get https://www.google.com\n```\n\n## Issues, Contributions, Faqs\n\n_Warning: Not all issues or feature requests may be accepted._\n\n- `.md` on how to [submit an issue]()\n- `.md` on how to [contribute]()\n- `.md` containing [the faq]()\n\n## Roadmap / To-Do\n\n\u003e [!WARNING]\n\u003e Any version under v1.0 is going to be **very** unstable and subject to change (flags, syntax, etc.). Please report any bugs or issues.\n\n### cli focus (\u003c= v0.5)\n\n**v0.1**\n\n- [x] HTTP methods + URL\n- [x] Custom headers and request body\n\n**v0.2**\n\n- [x] Print request if debug flag is `true`.\n- [x] Track duration between request and response\n- [x] Improved / useful logging with values being interacted with\n- [x] `-UF` or `--uploadfile` to place a file in the request body\n- [x] Short response support. Add a print option that just prints the response's status `200 OK`.\n\n**v0.3**\n\n- [x] `-P` flag with `request` argument to print the request as well. Support syntax highlighting of the request.\n- [x] `--download \u003c file path \u003e` to store the response body in a user-specified file.\n- [x] Flag to allow following redirects and only returning the \"final\" response.\n\n**v0.4**\n\n- [x] Restructure CLI urfave/cli, abstract it from the singular main.go file as with file-based features it will grow even larger. Break it into functions in two primary files.\n- [x] Custom variables\n- [x] Cross-run variable storage / .env support (koanf + dotenv)\n- [x] Basic export as cURL command flag.\n\n**v0.5**\n\n- [ ] Get command and flag suggestions working.\n- [ ] Go through require semantic versioning and then the cli guidelines site. Refactor and fix as issues are observed. (_Optional_: Finish the CLI book)\n- [x] Fix error returning structure and handle errors correctly and in better places.\n- [x] Fix logging, make it clearer. Make sure it handles errors well and is human-first and they are helpful to the user. Make sure that only the \"advanced\" errors bleed through if the debug flag is used. Include helpful suggestions with errors.\n- [ ] Get the standard no-common help page setup: https://clig.dev/#help\n- [ ] Add a link to where issues should be submitted to the help text. Make sure the issue form for bugs is customized and helpful.\n\n### file focus (\u003e v0.5)\n\n- [x] File input\n- [x] Assertions\n- [x] Re-work folders \u0026 file names, to increase clarity\n- [ ] Review `fasthttp` byte buffer tricks \u0026 best practices to ensure they're utilized correctly, along with pooling (especially regarding multi-request scenarios via file)\n- [ ] Add support for similar flags that are used in the `cli` into the `file` functionality.\n\n**v0.6**\n\n- [ ] Add custom assertion errors to logger.\n- [ ] Run a directory (alphabetically / in order) option `cast --directory /tests/auth` (alias `-DIR`). Runs each `.cast` file sequentially.\n- [ ] Verify and fill out all CLI help text, instructions, and usage in the flag `.go` files.\n- [ ] Regex, size, json assertions.\n\n**v0.7**\n\n- [ ] Support proxying\n- [ ] Support client certificates\n- [ ] Run it through Snyk and Semgrep\n\n**v0.8**\n\n- [ ] Ensure that it easily integrates and performs well if chosen to be run in GitHub actions.\n- [ ] Setup goreleaser\n- [ ] Reference files to include in the body via their path\n- [ ] Wordlist / fuzzing support via the provided vars (`\u003c% varName = ./tests/wordlist.txt %\u003e` or something similar. Will resend the request enough times to iterate through the list. Can only be used in the request it is defined above.)\n- [ ] Further standardize success, error, and commit messaging. Add a contribution guide with any styling notes to the repo.\n- [ ] Optimize. Review for helpful debug logging (esp. at the beginning, during, and before return).\n- [ ] Ensure reproducible and verifiable builds.\n- [ ] Make sure to build for both m-series \u0026 intel Macs, and verify the executable works on `Fedora` `Endeavour`, and `Alpine` Linux.\n- [ ] Make the repo public and set up `goreleaser`.\n- [ ] Setup packages with `brew` \u0026 `pacman`.\n- [ ] Create tests \u0026 benchmark tests for all files, flags, args, etc. Have these also run in GitHub.\n\n**v0.9**\n\n- [ ] Dogfood it. Look @ the tests other similar apps run against specific self-hosted services, write them up in `cast`, then fix any issues that arise.\n- [ ] Optimize and clarify `README.md`. Check other popular projects for examples.\n- [ ] Create the docs site using Astro Starlight.\n- [ ] Get feedback from people who would make use of it.\n- [ ] Syntax highlighting for editing in Zed.\n\n**v1.0**\n\n- [ ] Create issue templates in GitHub and check labels\n- [ ] Ensure GitHub workflows are configured correctly and packaging is essentially automated\n- [ ] Run a SAST in the pipeline. Something like Semgrep. Get it plugged into github issues. Also ensure CodeQL is fully configured.\n- [ ] Submit application to be an OWASP project (might require a license change?) (evaluate)\n- [ ] Announcement posts. Reached the point of having enough features to be useful\n\n### continuing (\u003e= v1.0)\n\n- [ ] optimize. find anti-patterns.\n- [ ] maintain. keep on top of package and language changes.\n- [ ] advanced cURL export, supports vars + other items. Able to export whole cast files as single or multiple cURL commands.\n- [ ] support JSON output for responses so that they can be parsed with tools such as `jq`.\n- [ ] add an option to not print info/warning/errors. Ensure it doesn't make the warnings with `y/n` options hang / not complete. (`-q` for quiet)\n\n### separate tooling (\u003e= v1.0)\n\n- [ ] Splitting import / export cURL commands into its own tool\n- [ ] Making an OpenAPI import / export separate tool\n- [ ] TUI app using Charm.sh tools\n\n### _potential_ future plans\n\nThese may come about, in addition to others, if enough demand is seen. `cast` is intended to stay as lean as possible, so if only 1% of users want something, it will not be included. If any feature reworks / rollbacks occur, it will only be due to them not being used or causing issues with the application's main purpose (sending and receiving HTTP requests).\n\n- [ ] grpc support\n- [ ] graphql support / formatting\n\n## Writings About Creating It\n\nI wrote a few blog posts on my personal blog about my experience and thoughts while developing `cast`. The are stream-of-thought and show how the scope of the project and its features changed over time. They can be read [here](https://alp1n3.dev/tags/cast/), and exist under the `cast` tag.\n\n## Pkgs Utilized\n\nThe packages doing the heavy lifting (other than the standard library) are:\n\n- [urfave/cli](https://github.com/urfave/cli) (v3)\n- [valyala/fasthttp](https://github.com/valyala/fasthttp)\n- [charmbracelet/log](github.com/charmbracelet/log)\n- [alecthomas/chroma](github.com/alecthomas/chroma/v2) (v2)\n- [fatih/color](github.com/fatih/color)\n\nA big thanks to the creators and contributors of them!\n\n## license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falp1n3-dev%2Fcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falp1n3-dev%2Fcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falp1n3-dev%2Fcast/lists"}