{"id":35119740,"url":"https://github.com/jochumdev/show","last_synced_at":"2025-12-27T23:04:17.501Z","repository":{"id":328768509,"uuid":"1116635663","full_name":"jochumdev/show","owner":"jochumdev","description":"A terminal viewer and search wrapper (mirror of: https://sr.ht/~jochumdev/show/ )","archived":false,"fork":false,"pushed_at":"2025-12-17T04:41:03.000Z","size":6316,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-18T04:18:31.203Z","etag":null,"topics":["fuzzy-search","highlighting","terminal","terminal-images"],"latest_commit_sha":null,"homepage":"","language":"Nushell","has_issues":false,"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/jochumdev.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-15T06:55:07.000Z","updated_at":"2025-12-17T04:41:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jochumdev/show","commit_stats":null,"previous_names":["jochumdev/show"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jochumdev/show","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fshow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fshow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fshow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fshow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochumdev","download_url":"https://codeload.github.com/jochumdev/show/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fshow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28087708,"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","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fuzzy-search","highlighting","terminal","terminal-images"],"created_at":"2025-12-27T23:01:11.361Z","updated_at":"2025-12-27T23:04:17.496Z","avatar_url":"https://github.com/jochumdev.png","language":"Nushell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# show\n\nA pragmatic terminal file viewer and search helper.\n\n`show` is implemented in Nushell and designed to be used from a modern shell environment.\n\nIt renders files intelligently in your terminal and acts as a reliable\npreview command for `fzf`. It selects the best available renderer based on\nmime detection, terminal capabilities, and installed tools — with safe fallbacks.\n\nThis is not a pager replacement and not a file manager.  \nIt is glue that makes existing CLI tools work together predictably.\n\n\n[![asciicast](https://asciinema.org/a/762163.svg)](https://asciinema.org/a/762163)\n\n---\n\n## How it works\n\n`show` uses a simple renderer pipeline:\n\n```\n\nFile\n↓\nMIME detection\n↓\nrenderer list\n↓\nfirst compatible renderer\n↓\noutput\n\n```\n\nFor each file:\n\n1. The MIME type is detected (using `file` if available)\n2. Matching renderer groups are looked up\n3. Renderers are tried in order\n4. The first renderer that:\n   - is available\n   - supports the current terminal\n   - has all required commands installed  \n   is used\n\nIf no renderer matches, `show` falls back safely.\nThis usually means printing the filepath or listing directory contents,\ndepending on the input type.\n\n### Example\n\nA `text/plain` file may be rendered by:\n\n- `bat`\n- `sed`\n- `cat`\n\nIf `bat` is installed, it is used.  \nIf not, `sed` is tried.  \nIf that fails, `cat` is used.\n\n---\n\n### fzf integration (POSIX shells)\n\n\nFor `/bin/sh`, `bash`, `zsh`:\n\n```sh\nexport FZF_DEFAULT_OPTS='--preview=\"show --glob --jump-to-line '\\'' {2} '\\'' {1}\" --delimiter=\":\"'\n```\n\nSame with nu\n\n```nu\n$env.FZF_DEFAULT_OPTS = r#'--preview=\"show --glob --jump-to-line ' {2} ' {1}\" --delimiter=\":\"'#\n```\n\nThe spaces around `{2}` are intentional.\nThey avoid a known fzf issue where empty fields are replaced with nothing,\nwhich can break argument boundaries.\n\n## Usage\n\nPreview a file:\n\n```sh\nshow file.txt\n```\n\nPreview a directory (searches for common files like `README`, configurable):\n\n```sh\nshow -g .\n```\n\nUse as an `fzf` preview command:\n\n```sh\nfzf --preview 'show {}'\n```\n\nJump to a specific line (used automatically by `show search`):\n\n```sh\nshow -j 120 file.txt\n```\n\nEnable debug logging:\n\n```sh\nshow --debug file.txt\n```\n\n---\n\n## Search\n\n`show search` combines `ripgrep` and `fzf` and reuses the same preview logic.\n\n```sh\nshow search -F 'open --raw'\n```\n\nSearch only certain files:\n\n```sh\nshow search -g '**/*.nu'\n```\n\nSearch in another directory without having to cd to it:\n\n```sh\nshow search -d ~/projects/show/testbed 'success'\n```\n\nEnable auto-reload (rerun ripgrep on each query change):\n\n```sh\nshow search -g '**/*.nu' -a\n```\n\nPreviews shown during search are rendered exactly like `show file`, including\nsyntax highlighting and image support.\n\nSelecting files in fzf results in an opened Editor at the given line if your Editor supports that.\n\n---\n\n## Configuration\n\nConfiguration is optional.\n\nBy default, `show` works out of the box.\nIt can be customized via:\n\n```\n$XDG_CONFIG_HOME/show/config.toml\n```\n\nYou can configure:\n\n* Which files are searched when previewing directories\n* MIME type → renderer mappings\n* terminal-specific renderer restrictions\n* editor integration for `show search`\n\nThe configuration is merged on top of sane defaults.\n\nSee `config.toml` and `config.example.toml` in the repository for all available options.\n\n---\n\n## Image rendering\n\nImage previews are supported when the terminal allows it.\n\nSupported renderers (used if available):\n\n* `kitten icat` (kitty, ghostty)\n* `imgcat` (iTerm2)\n* `chafa` (sixel / ASCII fallback)\n\nIf image rendering is not supported, `show` falls back to print the path.\n\n---\n\n## Dependencies\n\nRequired:\n\n* Nushell\n\nOptional (used if available):\n\n* bat\n* ripgrep\n* fzf\n* chafa\n* kitty (`kitten icat`)\n* imgcat\n* sed\n* less\n\nMissing tools are handled gracefully.\n\n---\n\n## Credits\n\nThis is based on [fzf-preview.sh](https://github.com/junegunn/fzf/blob/33d8d51c8a6c6e9321b5295b3a63f548b5f18a1f/bin/fzf-preview.sh) as well as a [blog post](https://junegunn.github.io/fzf/tips/ripgrep-integration/) by junegunn the author of fzf.\n\n## License\n\nMIT OR Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fshow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochumdev%2Fshow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fshow/lists"}