{"id":15021358,"url":"https://github.com/hougesen/hitt","last_synced_at":"2025-09-25T09:26:38.471Z","repository":{"id":199535578,"uuid":"695883018","full_name":"hougesen/hitt","owner":"hougesen","description":"File based HTTP testing tool focused on speed and simplicity.","archived":false,"fork":false,"pushed_at":"2025-01-30T21:50:53.000Z","size":3191,"stargazers_count":6,"open_issues_count":7,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-06T21:46:24.633Z","etag":null,"topics":["api-testing","cli","curl","developer-tools","hacktoberfest","http","http-client","neovim","neovim-plugin","postman","testing"],"latest_commit_sha":null,"homepage":"https://hitt.mhouge.dk/","language":"Rust","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/hougesen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-24T14:19:39.000Z","updated_at":"2025-01-30T21:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb9af258-2092-440c-951a-f77c34800b4f","html_url":"https://github.com/hougesen/hitt","commit_stats":{"total_commits":375,"total_committers":6,"mean_commits":62.5,"dds":"0.31733333333333336","last_synced_commit":"1034408a5c396eccb25c363c8b12a43dcef2b6a9"},"previous_names":["hougesen/hitt"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fhitt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fhitt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fhitt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fhitt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hougesen","download_url":"https://codeload.github.com/hougesen/hitt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238645923,"owners_count":19506925,"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":["api-testing","cli","curl","developer-tools","hacktoberfest","http","http-client","neovim","neovim-plugin","postman","testing"],"created_at":"2024-09-24T19:56:29.680Z","updated_at":"2025-09-25T09:26:38.462Z","avatar_url":"https://github.com/hougesen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hitt\n\n\u003ca href=\"https://crates.io/crates/hitt\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/hitt.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/hougesen/hitt/actions/workflows/validate.yml\"\u003e\u003cimg src=\"https://github.com/hougesen/hitt/actions/workflows/validate.yml/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/hougesen/hitt\"\u003e\u003cimg src=\"https://codecov.io/gh/hougesen/hitt/branch/main/graph/badge.svg\"/\u003e\u003c/a\u003e\n\nhitt is a command line HTTP testing tool focused on speed and simplicity.\n\n![hitt example](/docs/images/hitt-cli-example.png)\n\n\u003c!-- START_SECTION:base-command-help --\u003e\n\n```\nhitt 0.0.21\nCommand line HTTP testing tool focused on speed and simplicity\nMads Hougesen \u003cmads@mhouge.dk\u003e\n\nUsage: hitt \u003cCOMMAND\u003e\n\nCommands:\n  run          Send http requests\n  sse          Listen to sse events\n  completions  Generate shell completions\n  help         Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n\u003c!-- END_SECTION:base-command-help --\u003e\n\n## Install\n\n### Linux \u0026 MacOS\n\n```shell\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/hougesen/hitt/releases/latest/download/hitt-installer.sh | sh\n```\n\n### Windows\n\n```powershell\npowershell -ExecutionPolicy ByPass -c \"irm https://github.com/hougesen/hitt/releases/latest/download/hitt-installer.ps1 | iex\"\n```\n\n### Cargo\n\nhitt can be installed using Cargo.\n\n```shell\ncargo install hitt --locked\n```\n\nIf you do not have Cargo installed, you need to [install it first](https://www.rust-lang.org/learn/get-started).\n\n### npm/npx\n\nYou can install hitt using [npm](https://www.npmjs.com/package/hitt-cli):\n\n```shell\nnpm install -g hitt-cli\n\nhitt run hello-world.http\n```\n\nor run it directly using npx:\n\n```shell\nnpx hitt-cli run hello-world.http\n```\n\n### Homebrew\n\n```shell\nbrew install hougesen/tap/hitt\n```\n\n## Usage\n\nTo send a request create a file ending in `.http`.\n\nThe syntax of `.http` files is pretty straightforward:\n\n```http\nGET https://mhouge.dk/\n```\n\nThe file can then be run using the following command:\n\n```shell\nhitt run PATH_TO_FILE\n```\n\nThat is all that is need to send a request.\n\n\u003c!-- START_SECTION:run-command-help --\u003e\n\n```\nSend http requests\n\nUsage: hitt run [OPTIONS] [PATHS]...\n\nArguments:\n  [PATHS]...  Path to .http files, or directories if supplied with the `--recursive` argument\n\nOptions:\n      --timeout \u003cTIMEOUT_MS\u003e  Request timeout in milliseconds\n      --var \u003cKEY\u003e=\u003cVALUE\u003e     Variables to pass to request\n  -r, --recursive             Enable to run directory recursively\n      --fail-fast             Exit on error response status code\n      --hide-body             Whether or not to show response body\n      --hide-headers          Whether or not to show response headers\n      --disable-formatting    Disable pretty printing of response body\n  -h, --help                  Print help\n  -V, --version               Print version\n```\n\n\u003c!-- END_SECTION:run-command-help --\u003e\n\n### Arguments\n\n| Argument                 | Description                    |\n| ------------------------ | ------------------------------ |\n| `--var \u003cKEY\u003e=\u003cVALUE\u003e`    | Variables to pass to request   |\n| `--recursive`            | Run all files in directory     |\n| `--fail-fast`            | Exit on status code 4XX or 5xx |\n| `--hide-headers`         | Hide response headers          |\n| `--hide-body`            | Hide response body             |\n| `--timeout \u003cTIMEOUT_MS\u003e` | Request timeout in ms          |\n\n### Request headers\n\nRequest headers can be added by writing key value pairs (`KEY:VALUE`) on a new line after the method and URL:\n\n```http\nGET https://mhouge.dk/\nkey:value\n```\n\nLeading spaces in the header value is ignored, so `KEY: VALUE` and `KEY:VALUE` will both have the value `VALUE`.\n\n### Request body\n\nA body can be sent with the request by creating a blank line, followed by the desired body input.\n\nPlease note, hitt **does not** infer content type. That has to be written as a header.\n\n```http\nPOST https://mhouge.dk/\ncontent-type:application/json\n\n{\n    \"key\": \"value\"\n}\n```\n\n### Multiple request in single file\n\nMultiple requests can be written in a single file by adding a line with `###` as a separator:\n\n```http\nGET https://mhouge.dk/\n\n###\n\nGET https://mhouge.dk/\n```\n\n### Variables\n\nhitt has support for request variables.\n\nA variable can be set in a file using the following syntax `@name = VALUE`. Whitespace is ignored.\n\nVariables are used by wrapping the name in curly brackets (`{{ name }}`).\n\n```http\n@variable_name = localhost\n\nGET {{ variable_name }}/api\n```\n\nIn-file variables are not shared between other files.\n\n#### Variable arguments\n\nVariables can be passed to all requests using the `--var \u003cKEY\u003e=\u003cVALUE\u003e` argument:\n\n```http\n# file.http\n\nGET {{ host }}/api\n```\n\nThe file can the be run:\n\n```shell\nhitt run --var host=localhost:5000 file.http\n```\n\n### Server sent events (SSE)\n\nA SSE listener can be started using the `hitt sse` command.\n\n```shell\nhitt sse https://sse.dev/test\n```\n\n\u003c!-- START_SECTION:sse-command-help --\u003e\n\n```\nListen to sse events\n\nUsage: hitt sse \u003cURL\u003e\n\nArguments:\n  \u003cURL\u003e\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n\u003c!-- END_SECTION:sse-command-help --\u003e\n\n### Shell completions\n\nShell completions can be generated using `hitt completions \u003cSHELL\u003e`.\n\n\u003c!-- START_SECTION:completions-command-help --\u003e\n\n```\nGenerate shell completions\n\nUsage: hitt completions \u003cSHELL\u003e\n\nArguments:\n  \u003cSHELL\u003e  [possible values: bash, elvish, fish, nushell, powershell, zsh]\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n\u003c!-- END_SECTION:completions-command-help --\u003e\n\n#### Bash\n\nAdd the following to your `.bashrc`.\n\n```bash\neval \"$(hitt completions bash)\"\n```\n\n#### Zsh\n\nAdd the following to your `.zshrc`.\n\n```zsh\neval \"$(hitt completions zsh)\"\n```\n\n#### Fish\n\nAdd the following to `~/.config/fish/config.fish`.\n\n```fish\nhitt completions fish | source\n```\n\n#### PowerShell\n\nAdd the following to your PowerShell configuration (Can be found by running `$PROFILE`).\n\n```powershell\nInvoke-Expression (\u0026hitt completions powershell)\n```\n\n#### Elvish\n\nAdd the following to `~/.elvish/rc.elv`.\n\n```elvish\neval (hitt completions elvish)\n```\n\n## Neovim\n\nhitt can be run directly from Neovim.\n\n\u003e [!NOTE]\n\u003e The `hitt` executable must be available in your path for the plugin to work.\n\n### Install\n\n#### Lazy\n\n```lua\nlocal hitt_plugin = {\n\t\"hougesen/hitt\",\n\topts = {},\n}\n```\n\n### Usage\n\nThe plugin exposes a single command `:HittSendRequest`, which can be bound to a keymap like this:\n\n```lua\n-- ~/.config/nvim/after/plugin/hitt.lua\n\nlocal hitt = require(\"hitt\")\n\nvim.keymap.set(\"n\", \"\u003cleader\u003err\", hitt.HittSendRequest, {})\n```\n\n![hitt neovim window](/docs/images/hitt-neovim-example.png)\n\n### Configuration\n\n| Name          | Default | Description                       |\n| ------------- | ------- | --------------------------------- |\n| window_width  | 80      | Window width in percentage        |\n| window_height | 80      | Window height in percentage       |\n| fail_fast     | false   | Enables the `--fail-fast` options |\n\n#### HTTP syntax highlighting\n\nSyntax highlighting can be enabled by installing the `http` treesitter parser (`:TSInstall http`) and adding a file association for `.http` files.\n\n```lua\nvim.filetype.add({\n\textension = {\n\t\thttp = \"http\",\n\t},\n})\n```\n\n## Disclaimer\n\nhitt is most likely not ready for main stream usage. I ([Mads Hougesen](https://mhouge.dk)) am primarily developing it based on features I believe to be useful, or fun to develop.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhougesen%2Fhitt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhougesen%2Fhitt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhougesen%2Fhitt/lists"}