{"id":13496609,"url":"https://github.com/foxfriends/syncat","last_synced_at":"2025-04-05T03:09:03.986Z","repository":{"id":38339140,"uuid":"171564263","full_name":"foxfriends/syncat","owner":"foxfriends","description":"Syntax aware cat","archived":false,"fork":false,"pushed_at":"2025-03-26T23:50:52.000Z","size":38173,"stargazers_count":55,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T07:17:41.682Z","etag":null,"topics":["cat","color","colour","command-line","highlighting","style","syntax","terminal"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"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/foxfriends.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"foxfriends","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-02-19T23:05:04.000Z","updated_at":"2025-03-26T23:50:55.000Z","dependencies_parsed_at":"2023-02-12T07:00:28.982Z","dependency_job_id":"2f66e7d1-6e08-4fe9-802e-1266fff8ef78","html_url":"https://github.com/foxfriends/syncat","commit_stats":{"total_commits":324,"total_committers":5,"mean_commits":64.8,"dds":0.3858024691358025,"last_synced_commit":"5da5a717e08a533970baadf2a7d2827454f977d7"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxfriends%2Fsyncat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxfriends%2Fsyncat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxfriends%2Fsyncat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxfriends%2Fsyncat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxfriends","download_url":"https://codeload.github.com/foxfriends/syncat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["cat","color","colour","command-line","highlighting","style","syntax","terminal"],"created_at":"2024-07-31T19:01:52.900Z","updated_at":"2025-04-05T03:09:03.959Z","avatar_url":"https://github.com/foxfriends.png","language":"Rust","funding_links":["https://github.com/sponsors/foxfriends"],"categories":["Rust"],"sub_categories":[],"readme":"[Tree-sitter]: https://github.com/tree-sitter/tree-sitter\n[syncat-themes]: https://github.com/foxfriends/syncat-themes\n[languages.toml]: https://github.com/foxfriends/config/blob/syncat/languages.toml\n[crates.io]: https://crates.io\n[Bat]: https://github.com/sharkdp/bat\n[`syncat/config`]: ./syncat/config\n\n# Syncat\n\nSyntax aware cat utility. Provides syntax highlighting to files printed on the command line using\n[Tree-sitter][] to parse the files, and ANSI escape codes to colour them.\n\n## Features\n\nSyncat aims to provide similar features to the standard `cat` and the similar [Bat][] tool:\n1.  Git integration (`-g`)\n2.  Show line endings (`-e`)\n3.  Line numbering (`-n`)\n4.  Multiple levels of framing (`-f` or `-ff`)\n5.  File concatenation\n6.  Parses any file type accurately using Tree-sitter\n7.  Customizable syntax colouring using stylesheets\n\nIn particular, the advantage of Syncat over the other options is that the parsing is done using\n[Tree-sitter][] instead of with regular expressions, which makes it\n* very fast;\n* robust enough to provide useful results even in the presence of syntax errors.\n\nSyncat does not support automatic paging, but you can just use `less -r` to handle that.\n\n## Installation\n\nSyncat can be installed from [crates.io][]:\n\n```bash\ncargo install syncat\n```\n\n## Configuration\n\nBy default, Syncat comes bundled with the configuration files as seen in [`syncat/config`][],\nproviding an unverified list of tree-sitter grammars, and some quickly cobbled together\nhighlighting for a handful of known file types.\n\nIf this basic configuration does not suffice, you may choose to configure Syncat yourself.\nDo so by copying the [`syncat/config`][] folder and modifying them. You may also be interested\nin instead copying my personal configuration of Syncat, which can be found in the [syncat-themes][]\nrepository.\n\nIn either case, copy (or create new) those files in the appropriate configuration directory, depending on\nyour operating system, and then continuing to the following sections. The appropriate directories are:\n*   Linux: `$HOME/.config/syncat/` (more accurately, `$XDG_CONFIG_HOME/syncat`)\n*   Mac: `$HOME/Library/Preferences/com.cameldridge.syncat/`\n*   Windows: Not officially supported\n\n### Stylesheets\n\nThe official stylesheets (admittedly somewhat incomplete) are available [here][syncat-themes].\n\nStylesheets are placed in the configuration directory, under a subdirectory `style`. You can\nget the official themes as below, or just create this directory yourself.\n\n```bash\ncd ~/.config/syncat # or `cd ~/Library/Preferences/com.cameldridge.syncat` for Mac users\ngit clone https://github.com/foxfriends/syncat-themes style\n```\n\nFor full documentation on how these stylesheet customizations work, see the README in\nthe [syncat-themes][] repository.\n\n### Languages\n\nAs Syncat uses Tree-sitter for parsing, you must download and compile Tree-sitter parsers for\nSyncat to use. Fortunately, the downloading and compiling can be handled by Syncat, given you\nspecify what to download.\n\nThe language map is a simple TOML file named `languages.toml`, located in the root of the\nconfiguration folder. A good start might be to try [mine][languages.toml].\n\nEach entry in this file describes one language, and is a table of 4\nor 5 keys. The example entry below would install a highlighter for Syncat stylesheets.\n\n```toml\n[syncat-stylesheet] # The name here is arbitrary\n# The URL of the Git repository where the language is defined\nsource = \"https://github.com/foxfriends/syncat\"\n# Optional: The path within the repository to the tree-sitter package.\n# Leave this out if the language is defined in the root of the repository.\npath = \"tree-sitter-syncat-stylesheet\"\n# The name of the directory to clone the `source` repository into. Typically\n# this is the same name as the source repository, but you must specify it anyway.\nlibrary = \"syncat\"\n# The name of this language. This value should be the same as the value listed\n# in the `grammar.js` file from the repository.\n#\n# This name will also be the name of the stylesheet file used when highlighting\n# this language.\nname = \"syncat_stylesheet\"\n# A list of file extensions which should be parsed using this language.\nextensions = [\"syncat\"]\n```\n\nOnce you have filled this file to your liking, the command `syncat install` will install all\nof those languages. Running `syncat install` again later will update all languages, and install\nany new ones.\n\n## Usage\n\n```bash\n# Colours this file based on the extension\nsyncat src/main.rs\n\n# Uses the shell expansion, colouring each file by its own extension\nsyncat src/*.rs\n\n# Colours the file using a specific language\nsyncat -l js src/package.json\n\n# Exports the default configuration into your system's configuration directory\nsyncat init\n\n# Installs (or updates) all languages listed in the `languages.toml` file\nsyncat install\n\n# Installs only a specific entry in the `languages.toml` file\nsyncat install rust\n\n# Uninstalls a language. A few points to note:\n# *   The language must still be listed in the `languages.toml` file.\n# *   This does not remove the file from `languages.toml`, only deletes its installation.\nsyncat remove rust\n\n# Show information about all languages listed in `languages.toml`\nsyncat list\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxfriends%2Fsyncat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxfriends%2Fsyncat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxfriends%2Fsyncat/lists"}