{"id":18238266,"url":"https://github.com/darkceptor44/superwhich","last_synced_at":"2026-02-17T22:31:00.744Z","repository":{"id":261090221,"uuid":"883239728","full_name":"DarkCeptor44/superwhich","owner":"DarkCeptor44","description":"Cross-platform smart which alternative","archived":false,"fork":false,"pushed_at":"2025-01-16T03:09:26.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T05:35:35.550Z","etag":null,"topics":["alternatives","cli","rust","rust-lang","which"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/superwhich","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarkCeptor44.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-04T16:05:43.000Z","updated_at":"2025-01-16T03:09:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"11dee2c8-307f-4c6b-9448-158197ab4d0d","html_url":"https://github.com/DarkCeptor44/superwhich","commit_stats":null,"previous_names":["darkceptor44/superwhich"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkCeptor44%2Fsuperwhich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkCeptor44%2Fsuperwhich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkCeptor44%2Fsuperwhich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkCeptor44%2Fsuperwhich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkCeptor44","download_url":"https://codeload.github.com/DarkCeptor44/superwhich/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248398668,"owners_count":21097293,"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":["alternatives","cli","rust","rust-lang","which"],"created_at":"2024-11-05T03:04:45.987Z","updated_at":"2026-02-17T22:31:00.734Z","avatar_url":"https://github.com/DarkCeptor44.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# superwhich\n\n`superwhich` is a cross-platform CLI tool and library that was initially meant to be a faster drop-in replacement for Windows' `where` command but since it uses [Jaro-Winkler distance](https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance) to calculate the similarity between the strings it can be called a sort of \"smart\" which, it can handle some typos and highlights the section of the executables that matches the search pattern.\n\n## Installation\n\n## CLI\n\n- From [crates.io](https://crates.io/crates/superwhich): `cargo install superwhich`\n- From [GitHub](https://github.com/DarkCeptor44/superwhich): `cargo install --git https://github.com/DarkCeptor44/superwhich`\n- Manually (after cloning the repo locally): `cargo install --path .`\n- From [releases](https://github.com/DarkCeptor44/superwhich/releases/latest).\n\n## Library\n\n```bash\ncargo add superwhich\n```\n\nOr you can add this to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nsuperwhich = \"^2\"\n```\n\n## Usage\n\n![usage-windows](assets/usage-windows.png)\n![usage-linux](assets/usage-linux.png)\n\n```sh\n$ swhich -h\nCross-platform smart which alternative\n\nUsage: swhich.exe [OPTIONS] \u003cPATTERN\u003e\n\nArguments:\n  \u003cPATTERN\u003e  The search pattern\n\nOptions:\n  -c, --color \u003cCOLOR\u003e          Color of the highlighted text (off or set `NO_COLOR` env var to disable) [default: blue]\n  -T, --threshold \u003cTHRESHOLD\u003e  String similarity threshold (0.0 to 1.0) [default: 0.7]\n  -t, --print-time             Print time elapsed\n  -h, --help                   Print help\n  -V, --version                Print version\n```\n\n## Todo\n\n- Make it faster (currently at `~221ms` on Windows).\n- Find a better way to match the pattern to the name when printing the result so it highlights similar strings as well.\n\n## Tests\n\nYou can run the tests with `cargo test`.\n\n## Benchmarks\n\n### Library\n\nThe library benchmarks can be ran with `cargo bench`.\n\n| Benchmark | Min Mean Max | Outliers |\n| --------- | ------------ | -------- |\n| `find_executables/fake binaries` | 73.288 µs 73.486 µs 73.725 µs | 4 (4.00%) high mild, 6 (6.00%) high severe |\n| `find_executables/real PATH`     | 210.48 ms 211.14 ms 211.84 ms | 4 (4.00%) high mild, 1 (1.00%) high severe |\n| `highlight_text`                 | 1.4787 µs 1.4829 µs 1.4872 µs | 2 (2.00%) low mild, 1 (1.00%) high mild, 3 (3.00%) high severe |\n\n### CLI\n\nThe CLI was benchmarked using [Hyperfine](https://github.com/sharkdp/hyperfine).\n\n#### Windows\n\n- AMD64, 32GB RAM, Ryzen 7 3800X, Windows 10.\n\n| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |\n|:---|---:|---:|---:|---:|\n| `where pnpm` | 94.7 ± 1.1 | 93.5 | 98.7 | 1.00 |\n| `swhich pnpm` | 221.8 ± 3.5 | 215.7 | 229.2 | 2.34 ± 0.05 |\n\n#### Linux\n\n- ARM64, 1GB RAM, Orange Pi Zero2, Debian 12.\n\n| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |\n|:---|---:|---:|---:|---:|\n| `which lookfor` | 3.0 ± 0.2 | 2.6 | 4.7 | 1.00 |\n| `swhich lookfor` | 17.6 ± 0.3 | 17.0 | 19.8 | 5.93 ± 0.43 |\n\n## License\n\nThis project is licensed under the terms of the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkceptor44%2Fsuperwhich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkceptor44%2Fsuperwhich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkceptor44%2Fsuperwhich/lists"}