[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10385":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},10385,"httpstat","reorx\u002Fhttpstat","reorx","curl statistics made simple","",null,"Python",6211,384,126,4,0,1,5,3,38.76,"MIT License",false,"master",true,[26,27,28,29,30],"cli","curl","http","python","visualization","2026-06-12 02:02:21","# httpstat\n\n![screenshot](screenshot.png)\n\nhttpstat visualizes `curl(1)` statistics in a way of beauty and clarity.\n\nIt is a **single file🌟** Python script that has **no dependency👏** and is compatible with **Python 3🍻**.\n\n## Features\n\n- **Beautiful terminal output** — timing breakdown of DNS, TCP, TLS, server processing, and content transfer\n- **Structured JSON output** — `--format json` \u002F `jsonl` for machine consumption with a stable v1 schema\n- **SLO threshold checking** — `--slo total=500,connect=100` exits with code 4 on violation\n- **Save results to file** — `--save path.json` for multi-step workflows\n- **NO_COLOR support** — respects the [NO_COLOR](https:\u002F\u002Fno-color.org) convention\n- **Agent skill** — built-in [skill](skills\u002Fhttpstat\u002FSKILL.md) for agent-assisted HTTP performance diagnostics\n\n\n## Installation\n\nThere are three ways to get `httpstat`:\n\n- Download the script directly: `wget https:\u002F\u002Fraw.githubusercontent.com\u002Freorx\u002Fhttpstat\u002Fmaster\u002Fhttpstat.py`\n\n- Through pip: `pip install httpstat`\n\n- Through homebrew (macOS only): `brew install httpstat`\n\n> For Windows users, @davecheney's [Go version](https:\u002F\u002Fgithub.com\u002Fdavecheney\u002Fhttpstat) is suggested. → [download link](https:\u002F\u002Fgithub.com\u002Fdavecheney\u002Fhttpstat\u002Freleases)\n\n## Skills\n\nhttpstat ships with an agent [skill](skills\u002Fhttpstat\u002FSKILL.md) that teaches AI coding assistants (Claude Code, Cursor, etc.) how to use httpstat for HTTP performance diagnostics — automatic installation, bottleneck identification, and actionable fix suggestions.\n\nInstall the skill into your project:\n\n```bash\nnpx skills add reorx\u002Fhttpstat\n```\n\nOnce installed, your agent will automatically use httpstat when you ask questions like \"why is this API slow?\" or \"debug this endpoint's latency\".\n\n## Usage\n\nSimply:\n\n```bash\npython httpstat.py httpbin.org\u002Fget\n```\n\nIf installed through pip or brew, you can use `httpstat` as a command:\n\n```bash\nhttpstat httpbin.org\u002Fget\n```\n\n### cURL Options\n\nBecause `httpstat` is a wrapper of cURL, you can pass any cURL supported option after the url (except for `-w`, `-D`, `-o`, `-s`, `-S` which are already used by `httpstat`):\n\n```bash\nhttpstat httpbin.org\u002Fpost -X POST --data-urlencode \"a=b\" -v\n```\n\n### Structured Output\n\nUse `--format` (`-f`) to get machine-readable output:\n\n```bash\nhttpstat httpbin.org\u002Fget --format json\n```\n\n```json\n{\n  \"schema_version\": 1,\n  \"url\": \"httpbin.org\u002Fget\",\n  \"ok\": true,\n  \"exit_code\": 0,\n  \"response\": {\n    \"status_line\": \"HTTP\u002F2 200\",\n    \"status_code\": 200,\n    \"remote_ip\": \"...\",\n    \"remote_port\": \"443\",\n    \"headers\": {\"Content-Type\": \"application\u002Fjson\", \"Server\": \"nginx\", \"...\": \"...\"}\n  },\n  \"timings_ms\": {\n    \"dns\": 5, \"connect\": 10, \"tls\": 15,\n    \"server\": 50, \"transfer\": 20, \"total\": 100,\n    \"namelookup\": 5, \"initial_connect\": 15,\n    \"pretransfer\": 30, \"starttransfer\": 80\n  },\n  \"speed\": { \"download_kbs\": 1234.5, \"upload_kbs\": 0.0 },\n  \"slo\": null\n}\n```\n\nUse `--format jsonl` for compact single-line JSON (useful for log pipelines).\n\n### SLO Thresholds\n\nCheck response times against thresholds. Exits with code `4` on violation:\n\n```bash\nhttpstat httpbin.org\u002Fget --slo total=500,connect=100,ttfb=200\n```\n\nSupported keys: `total`, `connect`, `ttfb` (time to first byte), `dns`, `tls`.\n\nIn pretty mode, violations are printed in red at the end of the output.\nIn JSON mode, violations appear in the `slo` field:\n\n```json\n{\n  \"slo\": {\n    \"pass\": false,\n    \"violations\": [\n      { \"key\": \"total\", \"threshold_ms\": 500, \"actual_ms\": 823 }\n    ]\n  }\n}\n```\n\n### Save Results\n\nWrite structured JSON output to a file (works with any `--format`):\n\n```bash\nhttpstat httpbin.org\u002Fget --save result.json\nhttpstat httpbin.org\u002Fget --format json --save result.json\n```\n\n### Environment Variables\n\n`httpstat` has a bunch of environment variables to control its behavior.\nHere are some usage demos, you can also run `httpstat --help` to see full explanation.\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_SHOW_BODY\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  Set to `true` to show response body in the output, note that body length\n  is limited to 1023 bytes, will be truncated if exceeds. Default is `false`.\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_SHOW_IP\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  By default httpstat shows remote and local IP\u002Fport address.\n  Set to `false` to disable this feature. Default is `true`.\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_SHOW_SPEED\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  Set to `true` to show download and upload speed.  Default is `false`.\n\n  ```bash\n  HTTPSTAT_SHOW_SPEED=true httpstat http:\u002F\u002Fcachefly.cachefly.net\u002F10mb.test\n  \n  ...\n  speed_download: 3193.3 KiB\u002Fs, speed_upload: 0.0 KiB\u002Fs\n  ```\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_SAVE_BODY\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  By default httpstat stores body in a tmp file,\n  set to `false` to disable this feature. Default is `true`\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_CURL_BIN\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  Indicate the cURL bin path to use. Default is `curl` from current shell $PATH.\n\n  This exampe uses brew installed cURL to make HTTP2 request:\n\n  ```bash\n  HTTPSTAT_CURL_BIN=\u002Fusr\u002Flocal\u002FCellar\u002Fcurl\u002F7.50.3\u002Fbin\u002Fcurl httpstat https:\u002F\u002Fhttp2.akamai.com\u002F --http2\n  \n  HTTP\u002F2 200\n  ...\n  ```\n\n  > cURL must be compiled with nghttp2 to enable http2 feature\n  > ([#12](https:\u002F\u002Fgithub.com\u002Freorx\u002Fhttpstat\u002Fissues\u002F12)).\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_METRICS_ONLY\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  If set to `true`, httpstat will only output metrics in json format,\n  this is useful if you want to parse the data instead of reading it.\n\n  > **Note**: This is kept for backward compatibility. Prefer `--format json` instead.\n\n- \u003Cstrong>\u003Ccode>HTTPSTAT_DEBUG\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  Set to `true` to see debugging logs. Default is `false`\n\n- \u003Cstrong>\u003Ccode>NO_COLOR\u003C\u002Fcode>\u003C\u002Fstrong>\n\n  When set (to any value), disables all colored output.\n  See [no-color.org](https:\u002F\u002Fno-color.org) for the convention.\n\n  ```bash\n  NO_COLOR=1 httpstat httpbin.org\u002Fget\n  ```\n\n\nFor convenience, you can export these environments in your `.zshrc` or `.bashrc`,\nexample:\n\n```bash\nexport HTTPSTAT_SHOW_IP=false\nexport HTTPSTAT_SHOW_SPEED=true\nexport HTTPSTAT_SAVE_BODY=false\n```\n\n## Related Projects\n\nHere are some implementations in various languages:\n\n\n- Go: [davecheney\u002Fhttpstat](https:\u002F\u002Fgithub.com\u002Fdavecheney\u002Fhttpstat)\n\n  This is the Go alternative of httpstat, it's written in pure Go and relies no external programs. Choose it if you like solid binary executions (actually I do).\n\n- Go (library): [tcnksm\u002Fgo-httpstat](https:\u002F\u002Fgithub.com\u002Ftcnksm\u002Fgo-httpstat)\n\n  Other than being a cli tool, this project is used as library to help debugging latency of HTTP requests in Go code, very thoughtful and useful, see more in this [article](https:\u002F\u002Fmedium.com\u002F@deeeet\u002Ftrancing-http-request-latency-in-golang-65b2463f548c#.mm1u8kfnu)\n\n- Bash: [b4b4r07\u002Fhttpstat](https:\u002F\u002Fgithub.com\u002Fb4b4r07\u002Fhttpstat)\n\n  This is what exactly I want to do at the very beginning, but gave up due to not confident in my bash skill, good job!\n\n- Node: [yosuke-furukawa\u002Fhttpstat](https:\u002F\u002Fgithub.com\u002Fyosuke-furukawa\u002Fhttpstat)\n\n  [b4b4r07](https:\u002F\u002Ftwitter.com\u002Fb4b4r07) mentioned this in his [article](https:\u002F\u002Ftellme.tokyo\u002Fpost\u002F2016\u002F09\u002F25\u002F213810), could be used as a HTTP client also.\n\n- PHP: [talhasch\u002Fphp-httpstat](https:\u002F\u002Fgithub.com\u002Ftalhasch\u002Fphp-httpstat)\n\n  The PHP implementation by @talhasch\n\nSome code blocks in `httpstat` are copied from other projects of mine, have a look:\n\n- [reorx\u002Fpython-terminal-color](https:\u002F\u002Fgithub.com\u002Freorx\u002Fpython-terminal-color) Drop-in single file library for printing terminal color.\n\n- [reorx\u002Fgetenv](https:\u002F\u002Fgithub.com\u002Freorx\u002Fgetenv) Environment variable definition with type.\n","httpstat 是一个用于简化和美化 `curl` 统计信息的工具。它以 Python 脚本形式提供，无需额外依赖，并且兼容 Python 3。其核心功能包括：在终端中以美观的方式展示 DNS、TCP、TLS 等阶段的时间分解；支持结构化的 JSON 输出格式，便于机器处理；具备 SLO 阈值检查功能，在违反设定阈值时返回特定退出码；同时支持将结果保存到文件以及遵守 NO_COLOR 标准。此外，httpstat 还内置了与 AI 编程助手集成的能力，帮助进行 HTTP 性能诊断。此工具适用于需要对网络请求性能进行详细分析和监控的各种开发与运维场景。",2,"2026-06-11 03:28:05","top_topic"]