Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use Mermaid CLI’s mmdc command in a non-interactive CI step: install or run the CLI, point it at a Mermaid source file, and set the output filename to end in .png or .pdf. For example, mmdc -i docs/architecture.mmd -o build/architecture.png renders a PNG. Your CI provider’s artifact step is separate: configure it to retain the generated file if you need it after the job.
Choose how to run Mermaid CLI in CI
Mermaid CLI (@mermaid-js/mermaid-cli) is the project’s command-line route for converting Mermaid definitions to SVG, PNG, or PDF. The official README documents npm installation, npx, and Docker or Podman options. Choose based on the runner you already use and how tightly you want to define its runtime environment. Mermaid CLI README
| Execution method | When it fits | CI checks |
|---|---|---|
| Local npm package | Your project already manages Node dependencies and the runner can provide a compatible Node runtime. | Pin the package version and Node version; ensure the required browser dependencies are available. |
npx |
You want to invoke the CLI without adding a permanent project dependency. | Specify a package version rather than letting package resolution drift to a newer release. |
| Docker or Podman | Your runner supports containers and you want the CLI environment defined by an image. | Pin the image tag; check mounted paths, output-file ownership, and sandbox permissions. |
For a repeatable build, pin the selected package version or container tag rather than relying on an unqualified latest version. CLI requirements and export flags change between releases. The package registry surfaced version 11.17.0, while recent release notes describe changes requiring Node.js 22.13 or later and Puppeteer 25 or later; those details may refer to different release moments or tags. Confirm the requirements for the exact version you choose in the release notes and npm package page.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Render Mermaid source to PNG or PDF
Keep the diagram source in your repository, create the destination directory, then invoke mmdc with an input and output path. The output extension selects the format in the documented command pattern.
#1 Best Overall
- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
-
Make sure the source file exists, for example
docs/architecture.mmd. -
Create the output directory in your CI job, such as
build. -
Run one or both commands:
mkdir -p build mmdc -i docs/architecture.mmd -o build/architecture.png mmdc -i docs/architecture.mmd -o build/architecture.pdf -
Configure your CI provider to upload or retain
build/architecture.pngand/orbuild/architecture.pdfif later jobs or reviewers need the files.Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
The commands above are renderer invocations, not a complete workflow file for a particular CI vendor. Artifact-upload syntax, job configuration, and cache behavior depend on the provider; use its current documentation for those steps. Mermaid CLI’s project documentation does not prescribe a vendor-specific workflow.
Optional appearance settings
The README demonstrates a dark theme with a transparent background for PNG output:
mmdc -i docs/architecture.mmd -o build/architecture.png -t dark -b transparent
Check options against the pinned CLI version before adding older examples from a blog or pipeline template. Recent release notes say --pdfFit was removed because PDF output is fitted by default, that --pdf-paper-format is available to set paper format, and that width and height controls were replaced by --size, affecting viewport and PNG resolution. Do not assume these release-specific flags apply unchanged to every installed version.
Rank #3
- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
Set up the CI job for reproducible output
-
Pin the renderer and runtime. Lock the npm package version or container tag, and use the Node version required by that specific release.
Recommended Free Tools
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Make the output path explicit. Create the destination directory before calling
mmdc; use a path your provider can upload as an artifact. -
Keep container files writable. With Docker or Podman, mount the directory containing the source and the destination location, and check that the container user can write the generated files.
Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
-
Separate rendering from artifact retention. A successful render creates a file on the runner; it does not by itself make that file available after the job ends.
-
Expect browser launch constraints to vary. Mermaid CLI documents Linux sandbox and Docker permission issues among known setup topics. Investigate the runner’s Chromium launch restrictions, container user ID, mounted-directory ownership, and selected image if rendering fails.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
There is no established universal best choice among npm, npx, and containers, nor a published runtime benchmark in the cited project materials. Pick the route your runner can support consistently and verify it with the exact pinned version.
Best Value
- 【Powerful Performance】Equipped with an Intel N150 CPU, featuring up to 4.4 GHz, ensuring efficient and powerful multitasking capabilities.
- 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
Troubleshoot failed Mermaid renders
| Symptom | Likely cause to check | Practical fix |
|---|---|---|
mmdc is not found |
The CLI was not installed in the job, or its executable is not on the shell’s path. | Install the pinned package in the job or use the documented npx or container route; confirm the command runs in the same job environment. |
| Chromium fails to launch in Linux or a container | Runner sandbox restrictions, browser dependencies, or container permissions may not match the CLI setup. | Check the chosen release’s setup guidance and the runner’s Chromium restrictions; review the selected image and its permissions. |
| Command cannot write the output | The output directory may not exist, or the container user may not own the mounted directory. | Create the directory before rendering and verify write permissions for the process running mmdc. |
| PDF or PNG appearance differs after an upgrade | CLI flags and rendering behavior can change between releases. | Pin a version, review that version’s release notes, and update deprecated flags such as --pdfFit where applicable. |
| Artifact is missing after a successful render | The file remained on the temporary runner rather than being uploaded or retained. | Check the exact output path and configure the CI provider’s artifact step to include it. |
Render Markdown Mermaid blocks separately
If your input is a Markdown file containing Mermaid fences, the CLI README also describes a mode that transforms Markdown and links generated SVGs. That is a different workflow from rendering one diagram directly to a PNG or PDF. Use the direct .mmd input and an explicit .png or .pdf output path when those are the artifacts you need.
Or skip the browser setup
If your requirement is a screenshot or PDF of a rendered web page rather than a Mermaid source file, ScreenshotNeo is a website screenshot API and MCP server. Its one-call GET endpoint returns a PNG, JPEG, WebP, or PDF; for a URL screenshot, for example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Can Mermaid CLI export an SVG as well as PNG and PDF?
Yes. Mermaid CLI supports SVG output; use an output filename ending in .svg.
Does Mermaid CLI upload the rendered file to my CI artifacts automatically?
No. The CLI renders the file on the runner. Artifact retention must be configured separately using your CI provider’s workflow.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

