{"id":51611643,"url":"https://github.com/knsh14/cless","last_synced_at":"2026-07-12T09:00:14.907Z","repository":{"id":360374805,"uuid":"1247581937","full_name":"knsh14/cless","owner":"knsh14","description":"colored less ","archived":false,"fork":false,"pushed_at":"2026-06-29T01:31:03.000Z","size":95,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T03:13:02.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knsh14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2026-05-23T14:04:27.000Z","updated_at":"2026-06-29T01:31:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/knsh14/cless","commit_stats":null,"previous_names":["knsh14/cless"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/knsh14/cless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsh14%2Fcless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsh14%2Fcless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsh14%2Fcless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsh14%2Fcless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knsh14","download_url":"https://codeload.github.com/knsh14/cless/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsh14%2Fcless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35387177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"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":[],"created_at":"2026-07-12T09:00:13.346Z","updated_at":"2026-07-12T09:00:14.896Z","avatar_url":"https://github.com/knsh14.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cless\n\nA `less`-like terminal pager with tree-sitter syntax highlighting.\n\n## Features\n\n- **`less`-compatible keybindings**: number-prefix counts (`5j`, `100G`, `50%`), line / page / half-page motion, top / bottom / percent jumps, horizontal scroll\n- **Search**: `/pattern` and `?pattern`, repeat with `n` / `N`, smart-case (all-lowercase pattern is case-insensitive), matches shown in reverse video\n- **Line filter**: `\u0026pattern` shows only matching lines, `\u0026!pattern` excludes, empty `\u0026` clears; multiple `\u0026` combine (AND), smart-case like search\n- **Marks, multi-file, and tail-follow**: `m`/`'` marks, `:n`/`:p` to switch files, `F` to follow a growing file (`tail -f`)\n- **Line wrapping** on by default (`-S` chops), optional line numbers (`-N`), startup positioning (`+N` / `+G` / `+/pat`, `-p pat`)\n- **stdin / pipes**: `cat file | cless` (keys still read from the terminal)\n- **Tree-sitter highlighting for 15 languages**: Rust, Python, JavaScript, TypeScript (incl. TSX), JSON, Go, Bash, TOML, YAML, HTML, CSS, C, Markdown\n- **citruszest palette** (from [zootedb0t/citruszest.nvim](https://github.com/zootedb0t/citruszest.nvim)) emitted as truecolor ANSI\n- Language detection: file extension → special filenames (`.bashrc` etc.) → shebang\n\n## Installation\n\n### Recommended: `cargo binstall` (downloads a prebuilt binary, no C toolchain needed)\n\n```sh\ncargo binstall cless\n```\n\nThis pulls a prebuilt binary from GitHub Releases. Supported targets:\n`x86_64-unknown-linux-gnu` / `aarch64-unknown-linux-gnu` /\n`x86_64-apple-darwin` / `aarch64-apple-darwin` /\n`x86_64-pc-windows-msvc`.\n\nIf you don't have `cargo-binstall` yet: `cargo install cargo-binstall`.\n\n### Building from source\n\n```sh\ncargo install --path .\n# or\ncargo build --release   # target/release/cless\n```\n\nBuilding from source requires a C compiler because each tree-sitter parser is written in C\n(macOS: `xcode-select --install`, Ubuntu: `apt install build-essential`).\nThe release binary is ~10 MB.\n\n## Usage\n\n```sh\ncless \u003cfile\u003e...                 # one or more files (:n / :p to switch)\ncless -N -S \u003cfile\u003e              # line numbers; chop long lines instead of wrapping\ncless +/TODO \u003cfile\u003e             # open positioned at the first match of TODO\ncless +G \u003cfile\u003e                 # open at the end (like tail)\ncat file | cless                # read from stdin\n```\n\nFlags: `-S` chop long lines (wrap is the default), `-N` line numbers,\n`-p pattern` start at the first match (alias of `+/pattern`),\n`+N` / `+G` / `+/pattern` startup positioning.\n\n### Keybindings\n\n```\n Movement\n   j, ↓, ENTER, ^E, ^N       one line down\n   k, ↑, ^Y, ^P               one line up\n   SPACE, f, ^F, ^V, PgDn    one window down\n   b, ^B, PgUp                one window up\n   d, ^D                      half-window down\n   u, ^U                      half-window up\n   g, \u003c, HOME                 first line   ([N]g jumps to line N)\n   G, \u003e, END                  last line    ([N]G jumps to line N)\n   p, %                       [N] percent into the file\n   ←, →                       horizontal half-screen scroll\n\n Searching\n   /pattern                   search forward\n   ?pattern                   search backward\n   n                          repeat last search\n   N                          repeat in the reverse direction\n   \u0026pattern                   show only matching lines (\u0026!pat excludes,\n                              \u0026 alone clears; multiple \u0026 combine)\n\n Marks \u0026 files\n   m\u003cletter\u003e                  set a mark at the current position\n   '\u003cletter\u003e                  jump to a mark   ('' jumps to the previous position)\n   :n, :p                     next / previous file\n   F                          follow the file (tail -f); any key stops\n\n Other\n   -S                         toggle line wrapping / chopping\n   -N                         toggle line numbers\n   =, ^G, :f                  show current file position (and filter state)\n   r, R, ^L                   repaint the screen\n   h, H                       help screen\n   q, Q, ZZ, ^C               quit\n```\n\nNumber prefix: most movement keys accept a repeat count or line number\n(e.g. `5j`, `100G`, `30%`).\n\n## Customising the palette\n\nColors are defined as `FG_*` constants at the top of `src/highlight.rs`, and\n`color_for(name)` maps tree-sitter capture names (`keyword`, `function`,\n`string`, ...) to those colors. Edit and rebuild to change the theme.\n\nThe 26 supported capture names live in `HIGHLIGHT_NAMES` and follow the\nstandard tree-sitter / Neovim naming conventions.\n\n## Architecture\n\n| File | Role |\n| --- | --- |\n| `src/main.rs` | Arg parsing and error handling |\n| `src/highlight.rs` | Language detection + tree-sitter; builds `Vec\u003cLine\u003e` |\n| `src/pager.rs` | Terminal control (crossterm), input loop, search, rendering |\n\n## Limitations\n\n- Cannot open binary or non-UTF-8 files\n- stdin cannot be combined with file arguments (it can't be re-read for `:n`/`:p`)\n- No theme-switch flag (color changes require a rebuild)\n- No config file; `\u0026` filters reset on file switch (`:n`/`:p`) and when following (`F`)\n\n## License\n\nDual-licensed under MIT or Apache-2.0; users may choose either (Rust ecosystem standard).\n\n- [LICENSE-MIT](LICENSE-MIT)\n- [LICENSE-APACHE](LICENSE-APACHE)\n\nSPDX identifier: `MIT OR Apache-2.0`\n\n### Contributions\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this repository shall be dual-licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknsh14%2Fcless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknsh14%2Fcless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknsh14%2Fcless/lists"}