[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73244":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":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},73244,"snitch","karol-broda\u002Fsnitch","karol-broda","a prettier way to inspect network connections","",null,"Go",3461,55,8,10,0,1,25,27.24,"MIT License",false,"master",[],"2026-06-12 02:03:10","# snitch\n\na friendlier `ss` \u002F `netstat` for humans. inspect network connections with a clean tui or styled tables.\n\n![snitch demo](demo\u002Fdemo.gif)\n\n## install\n\n### homebrew\n\n```bash\nbrew install snitch\n```\n\n> thanks to [@bevanjkay](https:\u002F\u002Fgithub.com\u002Fbevanjkay) for adding snitch to homebrew-core\n\n### go\n\n```bash\ngo install github.com\u002Fkarol-broda\u002Fsnitch@latest\n```\n\n### nixpkgs\n\n```bash\nnix-env -iA nixpkgs.snitch\n```\n\n> thanks to [@DieracDelta](https:\u002F\u002Fgithub.com\u002FDieracDelta) for adding snitch to nixpkgs\n\n### nixos \u002F nix (flake)\n\n```bash\n# try it\nnix run github:karol-broda\u002Fsnitch\n\n# install to profile\nnix profile install github:karol-broda\u002Fsnitch\n\n# or add to flake inputs\n{\n  inputs.snitch.url = \"github:karol-broda\u002Fsnitch\";\n}\n# then use: inputs.snitch.packages.${system}.default\n```\n\n### home-manager (flake)\n\nadd snitch to your flake inputs and import the home-manager module:\n\n```nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS\u002Fnixpkgs\u002Fnixos-unstable\";\n    home-manager.url = \"github:nix-community\u002Fhome-manager\";\n    snitch.url = \"github:karol-broda\u002Fsnitch\";\n  };\n\n  outputs = { nixpkgs, home-manager, snitch, ... }: {\n    homeConfigurations.\"user\" = home-manager.lib.homeManagerConfiguration {\n      pkgs = nixpkgs.legacyPackages.x86_64-linux;\n      modules = [\n        snitch.homeManagerModules.default\n        {\n          programs.snitch = {\n            enable = true;\n            # optional: use the flake's package instead of nixpkgs\n            # package = snitch.packages.x86_64-linux.default;\n            settings = {\n              defaults = {\n                theme = \"catppuccin-mocha\";\n                interval = \"2s\";\n                resolve = true;\n              };\n            };\n          };\n        }\n      ];\n    };\n  };\n}\n```\n\navailable themes: `ansi`, `catppuccin-mocha`, `catppuccin-macchiato`, `catppuccin-frappe`, `catppuccin-latte`, `gruvbox-dark`, `gruvbox-light`, `dracula`, `nord`, `tokyo-night`, `tokyo-night-storm`, `tokyo-night-light`, `solarized-dark`, `solarized-light`, `one-dark`, `mono`\n\n### arch linux (aur)\n\n```bash\n# with yay\nyay -S snitch-bin\n\n# with paru\nparu -S snitch-bin\n```\n\n### shell script\n\n```bash\ncurl -sSL https:\u002F\u002Fraw.githubusercontent.com\u002Fkarol-broda\u002Fsnitch\u002Fmaster\u002Finstall.sh | sh\n```\n\ninstalls to `~\u002F.local\u002Fbin` if available, otherwise `\u002Fusr\u002Flocal\u002Fbin`. override with:\n\n```bash\ncurl -sSL https:\u002F\u002Fraw.githubusercontent.com\u002Fkarol-broda\u002Fsnitch\u002Fmaster\u002Finstall.sh | INSTALL_DIR=~\u002Fbin sh\n```\n\n> **macos:** the install script automatically removes the quarantine attribute (`com.apple.quarantine`) from the binary to allow it to run without gatekeeper warnings. to disable this, set `KEEP_QUARANTINE=1`.\n\n### docker\n\npre-built oci images available from github container registry:\n\n```bash\n# pull from ghcr.io\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:latest          # alpine (default)\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:latest-alpine   # alpine (~17MB)\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:latest-scratch  # minimal, binary only (~9MB)\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:latest-debian   # debian trixie\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:latest-ubuntu   # ubuntu 24.04\n\n# or use a specific version\ndocker pull ghcr.io\u002Fkarol-broda\u002Fsnitch:0.2.0-alpine\n```\n\nalternatively, build locally via nix flake:\n\n```bash\nnix build github:karol-broda\u002Fsnitch#snitch-alpine\ndocker load \u003C result\n```\n\n**running the container:**\n\n```bash\n# basic usage - sees host sockets but not process names\ndocker run --rm --net=host snitch:latest ls\n\n# full info - includes PID, process name, user\ndocker run --rm --net=host --pid=host --cap-add=SYS_PTRACE snitch:latest ls\n```\n\n| flag | purpose |\n|------|---------|\n| `--net=host` | share host network namespace (required to see host connections) |\n| `--pid=host` | share host pid namespace (needed for process info) |\n| `--cap-add=SYS_PTRACE` | read process details from `\u002Fproc\u002F\u003Cpid>` |\n\n> **note:** `CAP_NET_ADMIN` and `CAP_NET_RAW` are not required. snitch reads from `\u002Fproc\u002Fnet\u002F*` which doesn't need special network capabilities.\n\n### binary\n\ndownload from [releases](https:\u002F\u002Fgithub.com\u002Fkarol-broda\u002Fsnitch\u002Freleases):\n\n- **linux:** `snitch_\u003Cversion>_linux_\u003Carch>.tar.gz` or `.deb`\u002F`.rpm`\u002F`.apk`\n- **macos:** `snitch_\u003Cversion>_darwin_\u003Carch>.tar.gz`\n\n```bash\ntar xzf snitch_*.tar.gz\nsudo mv snitch \u002Fusr\u002Flocal\u002Fbin\u002F\n```\n\n> **macos:** if blocked with \"cannot be opened because the developer cannot be verified\", run:\n>\n> ```bash\n> xattr -d com.apple.quarantine \u002Fusr\u002Flocal\u002Fbin\u002Fsnitch\n> ```\n\n## quick start\n\n```bash\nsnitch              # launch interactive tui\nsnitch -l           # tui showing only listening sockets\nsnitch ls           # print styled table and exit\nsnitch ls -l        # listening sockets only\nsnitch ls -t -e     # tcp established connections\nsnitch ls -p        # plain output (parsable)\n```\n\n## commands\n\n### `snitch` \u002F `snitch top`\n\ninteractive tui with live-updating connection list.\n\n```bash\nsnitch                  # all connections\nsnitch -l               # listening only\nsnitch -t               # tcp only\nsnitch -e               # established only\nsnitch -i 2s            # 2 second refresh interval\n```\n\n**keybindings:**\n\n```\nj\u002Fk, ↑\u002F↓      navigate\ng\u002FG           top\u002Fbottom\nt\u002Fu           toggle tcp\u002Fudp\nl\u002Fe\u002Fo         toggle listen\u002Festablished\u002Fother\ns\u002FS           cycle sort \u002F reverse\nw             watch\u002Fmonitor process (highlight)\nW             clear all watched\nK             kill process (with confirmation)\n\u002F             search\nenter         connection details\n?             help\nq             quit\n```\n\n### `snitch ls`\n\none-shot table output. uses a pager automatically if output exceeds terminal height.\n\n```bash\nsnitch ls               # styled table (default)\nsnitch ls -l            # listening only\nsnitch ls -t -l         # tcp listeners\nsnitch ls -e            # established only\nsnitch ls -p            # plain\u002Fparsable output\nsnitch ls -o json       # json output\nsnitch ls -o csv        # csv output\nsnitch ls -n            # numeric (no dns resolution)\nsnitch ls --no-headers  # omit headers\n```\n\n### `snitch json`\n\njson output for scripting.\n\n```bash\nsnitch json\nsnitch json -l\n```\n\n### `snitch watch`\n\nstream json frames at an interval.\n\n```bash\nsnitch watch -i 1s | jq '.count'\nsnitch watch -l -i 500ms\n```\n\n### `snitch upgrade`\n\ncheck for updates and upgrade in-place.\n\n```bash\nsnitch upgrade              # check for updates\nsnitch upgrade --yes        # upgrade automatically\nsnitch upgrade -v 0.1.7     # install specific version\n```\n\n## filters\n\nshortcut flags work on all commands:\n\n```\n-t, --tcp           tcp only\n-u, --udp           udp only\n-l, --listen        listening sockets\n-e, --established   established connections\n-4, --ipv4          ipv4 only\n-6, --ipv6          ipv6 only\n```\n\n## resolution\n\ndns and service name resolution options:\n\n```\n--resolve-addrs     resolve ip addresses to hostnames (default: true)\n--resolve-ports     resolve port numbers to service names\n--no-cache          disable dns caching (force fresh lookups)\n```\n\ndns lookups are performed in parallel and cached for performance. use `--no-cache` to bypass the cache for debugging or when addresses change frequently.\n\nfor more specific filtering, use `key=value` syntax with `ls`:\n\n```bash\nsnitch ls proto=tcp state=listen\nsnitch ls pid=1234\nsnitch ls proc=nginx\nsnitch ls lport=443\nsnitch ls contains=google\n```\n\n## output\n\nstyled table (default):\n\n```\n  ╭─────────────────┬───────┬───────┬─────────────┬─────────────────┬────────╮\n  │ PROCESS         │ PID   │ PROTO │ STATE       │ LADDR           │ LPORT  │\n  ├─────────────────┼───────┼───────┼─────────────┼─────────────────┼────────┤\n  │ nginx           │ 1234  │ tcp   │ LISTEN      │ *               │ 80     │\n  │ postgres        │ 5678  │ tcp   │ LISTEN      │ 127.0.0.1       │ 5432   │\n  ╰─────────────────┴───────┴───────┴─────────────┴─────────────────┴────────╯\n  2 connections\n```\n\nplain output (`-p`):\n\n```\nPROCESS    PID    PROTO   STATE    LADDR       LPORT\nnginx      1234   tcp     LISTEN   *           80\npostgres   5678   tcp     LISTEN   127.0.0.1   5432\n```\n\n## configuration\n\noptional config file at `~\u002F.config\u002Fsnitch\u002Fsnitch.toml`:\n\n```toml\n[defaults]\nnumeric = false      # disable name resolution\ndns_cache = true     # cache dns lookups (set to false to disable)\ntheme = \"auto\"       # color theme: auto, dark, light, mono\n\n[tui]\nremember_state = false   # remember view options between sessions\n```\n\n### remembering view options\n\nwhen `remember_state = true`, the tui will save and restore:\n\n- filter toggles (tcp\u002Fudp, listen\u002Festablished\u002Fother)\n- sort field and direction\n- address and port resolution settings\n\nstate is saved to `$XDG_STATE_HOME\u002Fsnitch\u002Ftui.json` (defaults to `~\u002F.local\u002Fstate\u002Fsnitch\u002Ftui.json`).\n\ncli flags always take priority over saved state.\n\n### environment variables\n\n```bash\nSNITCH_THEME=dark          # set default theme\nSNITCH_RESOLVE=0           # disable dns resolution\nSNITCH_DNS_CACHE=0         # disable dns caching\nSNITCH_NO_COLOR=1          # disable color output\nSNITCH_CONFIG=\u002Fpath\u002Fto     # custom config file path\n```\n\n## requirements\n\n- linux or macos\n- linux: reads from `\u002Fproc\u002Fnet\u002F*`, root or `CAP_NET_ADMIN` for full process info\n- macos: uses system APIs, may require sudo for full process info\n","snitch 是一个用于网络连接检查的工具，提供了比传统 `ss` 和 `netstat` 更友好的用户界面。它支持通过简洁的文本用户界面（TUI）或样式化的表格来展示网络连接信息，并且内置了多种主题以适应不同用户的审美偏好。该项目使用 Go 语言编写，具有跨平台特性，支持包括 macOS、Linux 在内的多个操作系统，可以通过 Homebrew、Nix、Docker 等多种方式安装。适用于需要频繁监控和管理网络连接状态的技术人员或系统管理员，在日常运维工作中能够显著提升效率与用户体验。",2,"2026-06-11 03:44:41","high_star"]