{"id":16535415,"url":"https://github.com/hougesen/kdlfmt","last_synced_at":"2026-03-01T00:06:55.548Z","repository":{"id":243138801,"uuid":"811506011","full_name":"hougesen/kdlfmt","owner":"hougesen","description":"A formatter for kdl documents.","archived":false,"fork":false,"pushed_at":"2025-03-01T22:41:09.000Z","size":228,"stargazers_count":18,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T01:27:16.922Z","etag":null,"topics":["code-formatter","formatter","kdl","rust"],"latest_commit_sha":null,"homepage":"","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/hougesen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-06-06T18:18:35.000Z","updated_at":"2025-03-03T18:27:49.000Z","dependencies_parsed_at":"2024-07-10T14:59:03.433Z","dependency_job_id":"032fba9b-a01c-4def-8051-80c9ce0f755b","html_url":"https://github.com/hougesen/kdlfmt","commit_stats":null,"previous_names":["hougesen/kdlfmt"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fkdlfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fkdlfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fkdlfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hougesen%2Fkdlfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hougesen","download_url":"https://codeload.github.com/hougesen/kdlfmt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130281,"owners_count":20402753,"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":["code-formatter","formatter","kdl","rust"],"created_at":"2024-10-11T18:27:24.610Z","updated_at":"2026-03-01T00:06:50.520Z","avatar_url":"https://github.com/hougesen.png","language":"Rust","funding_links":[],"categories":["Lang,LSP,DAP,Formatter,Linter"],"sub_categories":[],"readme":"# kdlfmt\n\nA formatter for [kdl](https://kdl.dev) documents.\n\nkdlfmt is a thin cli wrapper built on-top of the official `kdl` parser for Rust ([`kdl-rs`](https://github.com/kdl-org/kdl-rs)), so any formatting/parsing issues should be reported there.\n\n\u003c!-- START_SECTION:base-command-help --\u003e\n\n```\nkdlfmt 0.0.15\nA code formatter for kdl documents.\nMads Hougesen \u003cmads@mhouge.dk\u003e\n\nUsage: kdlfmt \u003cCOMMAND\u003e\n\nCommands:\n  format       Format kdl files\n  check        Validate files are formatted\n  init         Initialize formatter config\n  completions  Generate shell completions\n  help         Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n\n```\n\n\u003c!-- END_SECTION:base-command-help --\u003e\n\n## Installation\n\nkdlfmt can be installed using Cargo, the package manager for Rust ([crates.io](https://crates.io/crates/kdlfmt)).\n\n```shell\ncargo install kdlfmt\n```\n\nIf you do not have/want Rust installed on your device you can find precompiled binaries on the [release](https://github.com/hougesen/kdlfmt/releases) page.\n\n## Usage\n\nOnce installed the formatted can be invoked by running `kdlfmt format`.\n\n```shell\nkdlfmt format PATH\n```\n\nOr reading from stdin and printing the formatted output to stdout.\n\n```shell\ncat somefile.kdl | kdlfmt format -\n```\n\n\u003c!-- START_SECTION:format-command-help --\u003e\n\n```\nFormat kdl files\n\nUsage: kdlfmt format [OPTIONS] [INPUT]...\n\nArguments:\n  [INPUT]...\n          Path to file OR directory.\n\n          Use \"-\" to read from stdin and print to stdout.\n\nOptions:\n      --kdl-version \u003cKDL_VERSION\u003e\n          kdl specification to use.\n\n          By default all versions are tried\n\n          [possible values: v1, v2]\n\n      --stdin\n          Read from stdin and print to stdout\n\n      --log-level \u003cLOG_LEVEL\u003e\n          [possible values: trace, debug, info, warn, error, off]\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\n\u003c!-- END_SECTION:format-command-help --\u003e\n\n### Validating files are formatted\n\nkdlfmt also support validating if files are formatted using the `kdlfmt check` command.\n\n```shell\nkdlfmt check PATH\n```\n\nOr reading from stdin.\n\n```shell\ncat somefile.kdl | kdlfmt check -\n```\n\n\u003c!-- START_SECTION:check-command-help --\u003e\n\n```\nValidate files are formatted\n\nUsage: kdlfmt check [OPTIONS] [INPUT]...\n\nArguments:\n  [INPUT]...\n          Path to file OR directory.\n\n          Use \"-\" to read from stdin and print to stdout.\n\nOptions:\n      --kdl-version \u003cKDL_VERSION\u003e\n          kdl specification to use.\n\n          By default all versions are tried\n\n          [possible values: v1, v2]\n\n      --stdin\n          Read from stdin and print to stdout\n\n      --log-level \u003cLOG_LEVEL\u003e\n          [possible values: trace, debug, info, warn, error, off]\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\n\u003c!-- END_SECTION:check-command-help --\u003e\n\n### Ignoring files\n\n`.kdlfmtignore` files are used to ignore files/directories.\n\nIt uses the same syntax as `.gitignore` files.\n\n### Shell completion\n\nShell completion can be generated using the `kdl completions` command.\n\n\u003c!-- START_SECTION:completions-command-help --\u003e\n\n```\nGenerate shell completions\n\nUsage: kdlfmt completions \u003cSHELL\u003e\n\nArguments:\n  \u003cSHELL\u003e  [possible values: bash, elvish, fish, powershell, zsh]\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n\n```\n\n\u003c!-- END_SECTION:completions-command-help --\u003e\n\n#### Bash\n\nAdd the following to your `.bashrc`.\n\n```bash\neval \"$(kdlfmt completions bash)\"\n```\n\n#### Bash\n\nAdd the following to your `.zshrc`:\n\n```zsh\neval \"$(kdlfmt completions zsh)\"\n```\n\n#### Fish\n\nAdd the following to `~/.config/fish/config.fish`.\n\n```fish\nkdlfmt completions fish | source\n```\n\n#### PowerShell\n\nAdd the following to your PowerShell configuration (Can be found by running `$PROFILE`).\n\n```powershell\nInvoke-Expression (\u0026kdlfmt completions powershell)\n```\n\n#### Elvish\n\nAdd the following to `~/.elvish/rc.elv`.\n\n```elvish\neval (kdlfmt completions elvish)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhougesen%2Fkdlfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhougesen%2Fkdlfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhougesen%2Fkdlfmt/lists"}