{"id":21574,"library":"mkcert-cli","title":"mkcert-cli","description":"mkcert-cli is a Node.js CLI wrapper around the mkcert tool for generating locally trusted HTTPS development certificates, usable outside Vite contexts. Current stable version is 1.5.0, released Apr 2024. It insources logic from vite-plugin-mkcert, removing external dependencies like axios (since v1.4.0) to keep the package small (~20 kB install size). It supports custom output directories, certificate file names, and multiple hostnames, with auto-upgrade of the mkcert binary via the `-u` flag. Compared to using mkcert directly, it simplifies certificate generation via a single npx command without requiring manual installation of the mkcert binary.","status":"active","version":"1.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/tolu/mkcert-cli","tags":["javascript","mkcert","certificate","https","cli"],"install":[{"cmd":"npm install mkcert-cli","lang":"bash","label":"npm"},{"cmd":"yarn add mkcert-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add mkcert-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use npx to avoid global install; CLI is the only interface.","wrong":"npm i -g mkcert-cli && mkcert-cli","symbol":"mkcert-cli (CLI invocation)","correct":"npx mkcert-cli"}],"quickstart":{"code":"npx -y mkcert-cli --outDir ./certs --cert localhost.pem --key localhost.key --host localhost --host my-site.local","lang":"bash","description":"Generates locally trusted HTTPS certificates for custom hosts in a specified output directory with custom file names."},"warnings":[{"fix":"Use `--host host1 --host host2` syntax; prior versions had a bug ignoring custom hosts.","message":"The CLI generates certificates only for localhost and local IP addresses by default; custom hosts must be passed via multiple `--host` arguments.","severity":"gotcha","affected_versions":"<1.5.0"},{"fix":"Use `--host` instead of `--hosts`.","message":"The `--hosts` option was renamed to `--host` in v1.5.0; `--hosts` is still accepted but may be removed in a future release.","severity":"deprecated","affected_versions":">=1.5.0"},{"fix":"Ensure mkcert is available on PATH or use `-u` in an unrestricted network.","message":"The package requires Node.js >=12.20, but mkcert binary may not be available for all platforms (e.g., ARM64 Linux). The `-u` flag downloads the latest mkcert binary, which may fail behind a proxy or in restricted networks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `mkcert-cli -f` to force regeneration.","message":"Certificates are regenerated only if they don't exist or when `-f` is passed; overwriting existing certs requires explicit `-f` flag.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run with `-u` flag to auto-download mkcert: `npx mkcert-cli -u`","cause":"The mkcert binary is not installed or not on PATH.","error":"Error: spawn mkcert ENOENT"},{"fix":"Install mkcert manually from https://github.com/FiloSottile/mkcert and ensure it's on PATH.","cause":"Network issue when downloading mkcert binary (e.g., behind proxy).","error":"Error: read ECONNRESET"},{"fix":"Use a custom output directory with write permissions: `npx mkcert-cli --outDir /tmp/certs`","cause":"Running as root with restrictive file permissions.","error":"Error: EACCES: permission denied, open '/root/.mkcert-cli/certs/dev.key'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}