{"id":13472492,"url":"https://github.com/mermaid-js/mermaid-cli","last_synced_at":"2026-05-13T21:01:58.091Z","repository":{"id":36965416,"uuid":"264861225","full_name":"mermaid-js/mermaid-cli","owner":"mermaid-js","description":"Command line tool for the Mermaid library","archived":false,"fork":false,"pushed_at":"2026-05-11T10:00:04.000Z","size":2721,"stargazers_count":4534,"open_issues_count":87,"forks_count":370,"subscribers_count":37,"default_branch":"master","last_synced_at":"2026-05-11T10:41:18.868Z","etag":null,"topics":["cli","diagrams","mermaid"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mermaid-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-05-18T07:26:06.000Z","updated_at":"2026-05-11T10:23:53.000Z","dependencies_parsed_at":"2023-10-12T06:09:33.723Z","dependency_job_id":"0a534ac6-5d40-481b-b0aa-9f2629215456","html_url":"https://github.com/mermaid-js/mermaid-cli","commit_stats":{"total_commits":903,"total_committers":57,"mean_commits":"15.842105263157896","dds":0.5681063122923589,"last_synced_commit":"f1f9df1a2a87f2649f9c2d6add5cb5d2714e70a8"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/mermaid-js/mermaid-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mermaid-js%2Fmermaid-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mermaid-js%2Fmermaid-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mermaid-js%2Fmermaid-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mermaid-js%2Fmermaid-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mermaid-js","download_url":"https://codeload.github.com/mermaid-js/mermaid-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mermaid-js%2Fmermaid-cli/sbom","scorecard":{"id":637026,"data":{"date":"2025-08-11","repo":{"name":"github.com/mermaid-js/mermaid-cli","commit":"12a92231611f0fc0e1435b89d5fec71bb7196450"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.6,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/upload-percy.yml:27","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/compile-mermaid.yml:1","Warn: no topLevel permission defined: .github/workflows/drafter.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-labeler.yml:1","Warn: no topLevel permission defined: .github/workflows/release-publish.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:5","Warn: no topLevel permission defined: .github/workflows/upload-percy.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/mermaid-js/.github/SECURITY.md:1","Info: Found linked content: github.com/mermaid-js/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/mermaid-js/.github/SECURITY.md:1","Info: Found text in security policy: github.com/mermaid-js/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compile-mermaid.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/compile-mermaid.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/drafter.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/drafter.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-labeler.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/pr-labeler.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-publish.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-publish.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-publish.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/release-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/upload-percy.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/mermaid-js/mermaid-cli/upload-percy.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating node:18.20-alpine3.19 to node:18.20-alpine3.19@sha256:4580c24f98e6a7f7e3f4945fa049a93e0927b53bea2da75b78838d51678bf68d","Warn: containerImage not pinned by hash: DockerfileBuild:1","Warn: containerImage not pinned by hash: DockerfileBuild:15","Warn: npmCommand not pinned by hash: Dockerfile:14","Warn: npmCommand not pinned by hash: DockerfileBuild:12-13","Warn: npmCommand not pinned by hash: DockerfileBuild:28","Info:   0 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  18 third-party GitHubAction dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned","Info:   2 out of   5 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/compile-mermaid.yml:5"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (27) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T09:29:05.943Z","repository_id":36965416,"created_at":"2025-08-21T09:29:05.944Z","updated_at":"2025-08-21T09:29:05.944Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32999522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","diagrams","mermaid"],"created_at":"2024-07-31T16:00:55.095Z","updated_at":"2026-05-13T21:01:58.085Z","avatar_url":"https://github.com/mermaid-js.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","docs","HarmonyOS","Modellierung \u0026 Architektur","others"],"sub_categories":["Windows Manager"],"readme":"# mermaid-cli\n\n[![npm version](https://img.shields.io/npm/v/@mermaid-js/mermaid-cli)](https://www.npmjs.com/package/@mermaid-js/mermaid-cli)\n[![node-lts (scoped)](https://img.shields.io/node/v-lts/@mermaid-js/mermaid-cli)](https://www.npmjs.com/package/@mermaid-js/mermaid-cli)\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/minlag/mermaid-cli?label=Dockerhub)](https://hub.docker.com/r/minlag/mermaid-cli)\n[![Build, test and deploy mermaid-cli Docker image](https://github.com/mermaid-js/mermaid-cli/actions/workflows/compile-mermaid.yml/badge.svg)](https://github.com/mermaid-js/mermaid-cli/actions/workflows/compile-mermaid.yml)\n[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Mermaid/mermaid-cli)\n[![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat\u0026color=9cf\u0026logo=slack\u0026label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)\n\nThis is a command-line interface (CLI) for [mermaid](https://mermaid.js.org/). It takes a mermaid definition file as input and generates an SVG/PNG/PDF file as output.\n\n## Installation\n\n```sh\nnpm install -g @mermaid-js/mermaid-cli\n```\n\n## Usage\n\nConvert Mermaid mmd Diagram File To SVG\n\n```sh\nmmdc -i input.mmd -o output.svg\n```\n\n\u003e **Note**\n\u003e\n\u003e See [Alternative installations](#alternative-installations) if you don't want to install the package globally.\n\u003e\n\u003e Locate how to call the mmdc executable for your preferred method\n\u003e i.e. Docker, Yarn, NPM, local install, etc.\n\n## Examples\n\n### Create A PNG With A Dark Theme And Transparent Background\n\n```sh\nmmdc -i input.mmd -o output.png -t dark -b transparent\n```\n\n### Animating an SVG file with custom CSS\n\nThe `--cssFile` option can be used to inline some custom CSS.\n\nPlease see [./test-positive/flowchart1.css](test-positive/flowchart1.css) for an example of a CSS file that has animations.\n\n**Warning**: If you want to override `mermaid`'s [`themeCSS`](https://mermaid.js.org/config/schema-docs/config.html#themecss), we recommend instead adding `{\"themeCSS\": \"...\"})` to your mermaid `--configFile`. You may also need to use [`!important`](https://developer.mozilla.org/en-US/docs/Web/CSS/important) to override mermaid's `themeCSS`.\n\n**Warning**: Inline CSS files may be blocked by your browser, depending on the [HTTP Content-Security-Policy header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) of the website that hosts your SVG.\n\n```sh\nmmdc --input test-positive/flowchart1.mmd --cssFile test-positive/flowchart1.css -o docs/animated-flowchart.svg\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eExample output: docs/animated-flowchart.svg\u003c/summary\u003e\n\n  ![docs/animated-flowchart.svg](docs/animated-flowchart.svg)\n\u003c/details\u003e\n\n### Transform a markdown file with mermaid diagrams\n\n```sh\nmmdc -i readme.template.md -o readme.md\n```\n\nThis command transforms a markdown file itself. The mermaid-cli will find the mermaid diagrams, create SVG files from them and refer to those in the markdown output.\n\nThis:\n\n~~~md\n### Some markdown\n```mermaid\ngraph\n   [....]\n```\n\n### Some more markdown\n```mermaid\nsequenceDiagram\n   [....]\n```\n\n### Mermaid with custom title/desc\n```mermaid\ngraph\n   accTitle: My title here\n   accDescr: My description here\n   A--\u003eB\n```\n~~~\n\nBecomes:\n\n```md\n### Some markdown\n![diagram](./readme-1.svg)\n\n### Some more markdown\n![diagram](./readme-2.svg)\n\n### Mermaid with custom title/desc\n![My description here](./readme-3.svg \"My title here\")\n```\n\n### Piping from stdin\n\nYou can easily pipe input from stdin. This example shows how to use a heredoc to\nsend a diagram as stdin to mermaid-cli (mmdc).\n\n```sh\ncat \u003c\u003c EOF  | mmdc --input -\n    graph TD\n    A[Client] --\u003e B[Load Balancer]\nEOF\n```\n\n### See All Available Options\n\n```sh\nmmdc -h\n```\n\n# Alternative installations\n\n## Use Docker/Podman:\n\n```sh\ndocker pull minlag/mermaid-cli\n```\n\nor pull from Github Container Registry\n\n```sh\ndocker pull ghcr.io/mermaid-js/mermaid-cli/mermaid-cli\n```\n\nor e.g. version 8.8.0\n\n```sh\ndocker pull minlag/mermaid-cli:8.8.0\n```\n\nThe container looks for input files in `/data`. So for example, if you have a\ndiagram defined on your system in `/path/to/diagrams/diagram.mmd`, you can use\nthe container to generate an SVG file as follows:\n\n```sh\ndocker run --rm -u `id -u`:`id -g` -v /path/to/diagrams:/data minlag/mermaid-cli -i diagram.mmd\n```\n\nOr, if using [Podman](https://podman.io/), instead do:\n\n```sh\npodman run --userns keep-id --user ${UID} --rm -v /path/to/diagrams:/data:z ghcr.io/mermaid-js/mermaid-cli/mermaid-cli -i diagram.mmd\n```\n\nThe key differences in the podman command versus the docker command are:\n\n- The addition of the `--userns keep-id` argument. This allows the container to keep the same UID as the current user's UID in the container namespace instead of mapping to a subuid. To learn more, see the [`userns=mode` documentation](https://docs.podman.io/en/v4.4/markdown/options/userns.container.html).\n- The addition of `:z` to the end of the volume mapping. This instructs podman to relabel the files in the volume with the SELinux label `container_file_t`, which allows processes in the container to access the files. See the \"Labeling Volume Mounts\" section of [podman-run (1)](https://docs.podman.io/en/latest/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options) for more info.\n\nIn previous version, the input files were mounted in `/home/mermaidcli`. You can\nrestore this behaviour with the `--workdir` option:\n\n```sh\ndocker run [...] --workdir=/home/mermaidcli minlag/mermaid-cli [...]\n```\n\n\n## Use Node.JS API\n\nIt's possible to call `mermaid-cli` via a Node.JS API.\nPlease be aware that **the NodeJS API is not covered by semver**, as `mermaid-cli` follows\n`mermaid`'s versioning.\n\n```js\nimport { run } from \"@mermaid-js/mermaid-cli\"\n\nawait run(\n   \"input.mmd\", \"output.svg\", // {optional options},\n)\n```\n\n## Install locally\n\nSome people are [having issues](https://github.com/mermaidjs/mermaid.cli/issues/15)\ninstalling this tool globally. Installing it locally is an alternative solution:\n\n```\nnpm install @mermaid-js/mermaid-cli\n./node_modules/.bin/mmdc -h\n```\n\n### Run with npx\n\n[`npx`](https://www.npmjs.com/package/npx) is installed by default with NPM. It\ndownloads and runs commands at the same time.  To use Mermaid CLI with npx, you\nneed to use the `-p` flag because the package name is different than the command\nit installs (`mmdc`).  `npx -p @mermaid-js/mermaid-cli mmdc -h`\n\n\n## Install with [brew](https://brew.sh)\n\n\u003e **Warning**\n\u003e\n\u003e This method of installation is no longer supported.\n\u003e For more details, see the [discussion](https://github.com/mermaid-js/mermaid-cli/issues/288).\n\u003e An old version of mermaid-cli can be installed with brew.\n\u003e ```sh\n\u003e brew install mermaid-cli\n\u003e ```\n\n\n## Known issues\n\n1. [Linux sandbox issue](docs/linux-sandbox-issue.md)\n2. [Docker permission denied issue](docs/docker-permission-denied.md)\n3. [How to setup up mermaid to use already installed chromium?](docs/already-installed-chromium.md)\n\n## For contributors\n\nContributions are welcome. See the [contribution guide](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmermaid-js%2Fmermaid-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmermaid-js%2Fmermaid-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmermaid-js%2Fmermaid-cli/lists"}