{"id":18667774,"url":"https://github.com/temando/kunst-cli","last_synced_at":"2026-04-29T15:36:54.401Z","repository":{"id":148376279,"uuid":"107613679","full_name":"temando/kunst-cli","owner":"temando","description":"A runner around Remark, helping transform markdown to... markdown!","archived":false,"fork":false,"pushed_at":"2018-01-08T04:17:01.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-27T18:22:55.457Z","etag":null,"topics":["markdown","markdown-transformer","remark"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/temando.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-10-20T00:42:13.000Z","updated_at":"2018-01-30T03:18:35.000Z","dependencies_parsed_at":"2023-05-19T22:15:35.677Z","dependency_job_id":null,"html_url":"https://github.com/temando/kunst-cli","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fkunst-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fkunst-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fkunst-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fkunst-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temando","download_url":"https://codeload.github.com/temando/kunst-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239495479,"owners_count":19648331,"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":["markdown","markdown-transformer","remark"],"created_at":"2024-11-07T08:40:02.887Z","updated_at":"2025-11-06T15:30:33.691Z","avatar_url":"https://github.com/temando.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kunst CLI\n\n[![NPM](https://img.shields.io/npm/v/kunst-cli.svg)](https://npmjs.org/packages/kunst-cli/)\n[![Travis CI](https://img.shields.io/travis/temando/kunst-cli.svg)](https://travis-ci.org/temando/kunst-cli)\n[![MIT License](https://img.shields.io/github/license/temando/kunst-cli.svg)](https://en.wikipedia.org/wiki/MIT_License)\n\n\u003e It was in Strasbourg in 1440 that Johannes Gutenberg is said to have perfected and unveiled the secret of printing based on his research, mysteriously entitled Aventur und Kunst (enterprise and art).\n\nKunst CLI (the new printing press) is a Markdown transformer which is able to process a directory of files, apply relevant transformations or checks to Markdown files, and then save them in a destination directory.\n\nIt uses [remark](http://remark.js.org/) internally, and [remark plugins](https://github.com/wooorm/remark/blob/master/doc/plugins.md) can be specified using a `kunst.config.json` or `kunst.config.js` file.\n\n## Installation\n\nInstall Kunst CLI globally for ease of use with the following command:\n\n```sh\nnpm install -g kunst-cli\n```\n\n## Using Kunst CLI\n\nThe Kunst CLI exposes a single command, `kunst` that has several options:\n\n- `--source` A directory of source Markdown to transform. Defaults to the current directory.\n- `--target` The directory where the transform source will be added. Defaults to `/target`.\n- `--config` Allows [remark](https://github.com/unifiedjs/unified#preset) to be configured at runtime. Accepts a path to a JSON file. When omitted, Kunst looks for the config file `kunst.config.json` on the same directory that it runs from. See [config file](#config-file).\n- `--clean` If provided, the `target` directory will be emptied before transforming.\n- `--watch` If provided, `kunst` will watch for changes in the `--source` path and transform files from `--source` path to `--target` path.\n\n### Config file\n\nKunst config files describe a [remark preset](https://github.com/unifiedjs/unified#preset), as `js` or `json`. If the config file is a `json` file, Kunst will dynamically load all the specified remark plugins and construct a preset.\n\n\u003e **All remark plugins specified in the config file must be added as NPM dependencies in your project.**\n\nExample of `kunst.config.json`:\n\n```json\n{\n  \"plugins\": [\n    \"remark-comment-config\",\n    \"remark-graphviz\",\n    \"remark-openapi\",\n    [\n      \"remark-gitlab-artifact\",\n      {\n        \"apiBase\": \"https://gitlab.com\",\n        \"gitlabApiToken\": \"${GITLAB_API_TOKEN}\"\n      }\n    ]\n  ]\n}\n```\n\n\u003e In the above example, Kunst can replace environment variables in the config file, e.g. `GITLAB_API_TOKEN`, and with the actual value if the environment variable exists, before executing remark transformations.\n\nExample of `kunst.config.js`:\n\n```js\nconst commentConfig = require('remark-comment-config');\nconst graphviz = require('remark-graphviz');\nconst openapi = require('remark-openapi');\nconst gitlab = require('remark-gitlab-artifact');\n\nmodule.exports = {\n  plugins: [\n    commentConfig,\n    graphviz,\n    openapi,\n    [\n      gitlab,\n      {\n        apiBase: 'https://gitlab.com',\n        gitlabApiToken: process.env.GITLAB_API_TOKEN,\n      }\n    ],\n  ],\n};\n```\n\n### Examples\n\nThe following will process the directory `test/fixtures/full` and output the result to `test/fixtures/runtime`:\n\n```sh\n$ kunst --source test/fixtures/full --target test/fixtures/runtime --config kunst.config.js\ninfo:    Kunst transformation complete. durationMs=2932\ninfo:    /Users/brendanabbott/Sites/kunst-cli/test/fixtures/full/index.md\n      63:1-94:4  info  dot code block replaced with graph    remark-graphviz\n  101:19-101:62  info  dot link replaced with link to graph  remark-graphviz\n\n/Users/brendanabbott/Sites/kunst-cli/test/fixtures/full/nested/index.md\n       5:1-5:47  info  dot link replaced with link to graph  remark-graphviz\n```\n\n`--watch`  allows you to re-run transforms as you make changes to files in the `--source` directory. You can stop watching by terminating the command.\n\n```sh\n$ kunst --source test/fixtures/full --target test/fixtures/runtime --config kunst.config.js --watch\ninfo:    watching test/fixtures/full for any changes to .md files…\ninfo:    detected change in test/fixtures/full/nested/index.md…\ninfo:    Kunst transformation complete. durationMs=1714\ninfo:    test/fixtures/full/nested/index.md\n  5:1-5:47  info  dot link replaced with link to graph  remark-graphviz\n```\n\n## Credit\n\nKunst is a rather small veneer over the excellent [remark](http://remark.js.org/) ecosystem. Full credit to [@wooorm](https://github.com/wooorm) and everyone who has contributed to make that ecosystem brilliant.\n\n## Why?\n\nAt Temando developers write documentation alongside the source code and store it in the same project. We've developed our own Markdown _flavour_ to help developers use files in project in documentation. For example, dependency files are parsed to add a \"Dependencies\" list into `README.md` files.\n\nTo facilitate this, we often reuse existing Markdown functionality, notably the [Link `title`](https://daringfireball.net/projects/markdown/syntax#link), to act as a hook for remark plugins. This progressive enhancement allows the Markdown to be readable in other contexts (eg. Gitlab UI) before it's published to our internal site. It also means we can offload the responsibility of transforming Markdown to HTML to other [tools](http://www.mkdocs.org/).\n\nWhere it has made sense to do so, our `remark` plugins are available on Github/NPM:\n\n- [`remark-graphviz`](https://github.com/temando/remark-graphviz) — Replace `dot` graphs with rendered SVGs\n- [`remark-gitlab-artifact`](https://github.com/temando/remark-gitlab-artifact) — Download artifacts from GitLab projects to live alongside your Markdown\n- [`remark-openapi`](https://github.com/temando/remark-openapi) — Convert links to local or remote OpenAPI definition to tables with summaries of all paths\n\n## Maintainers\n\nKunst is an open source project from [Temando](http://temando.com/)'s Developer Experience team. Temando connects carriers with retailers and retailers to people. The Temando Platform combines shipping experiences, multi-carrier connectivity and lightning fast fulfillment in one solution. If this sounds like fun, [work with us](http://temando.com/en/about/careers)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fkunst-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemando%2Fkunst-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fkunst-cli/lists"}