Registry / devops / mkcert-cli

mkcert-cli

JSON →
library1.5.0jsnpmunverified

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.

npm install mkcert-cli
INSTALL
IMPORT
SIG · MKCERT-CLI
M
mkcert-cli
devopsjavascriptv1.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mkcert-cli (CLI invocation)
npx mkcert-cli
npm i -g mkcert-cli && mkcert-cli
Use npx to avoid global install; CLI is the only interface.

Generates locally trusted HTTPS certificates for custom hosts in a specified output directory with custom file names.

npx -y mkcert-cli --outDir ./certs --cert localhost.pem --key localhost.key --host localhost --host my-site.local
mkcert-cli --version
Debug
Known issues
gotchaThe CLI generates certificates only for localhost and local IP addresses by default; custom hosts must be passed via multiple `--host` arguments.
fix
Use `--host host1 --host host2` syntax; prior versions had a bug ignoring custom hosts.
affects: <1.5.0
deprecatedThe `--hosts` option was renamed to `--host` in v1.5.0; `--hosts` is still accepted but may be removed in a future release.
fix
Use `--host` instead of `--hosts`.
affects: >=1.5.0
gotchaThe 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.
fix
Ensure mkcert is available on PATH or use `-u` in an unrestricted network.
affects: >=1.0.0
gotchaCertificates are regenerated only if they don't exist or when `-f` is passed; overwriting existing certs requires explicit `-f` flag.
fix
Use `mkcert-cli -f` to force regeneration.
affects: >=1.0.0
Errors
Common errors & fixes
Error: spawn mkcert ENOENT
The mkcert binary is not installed or not on PATH.
fix
Run with `-u` flag to auto-download mkcert: `npx mkcert-cli -u`
Error: read ECONNRESET
Network issue when downloading mkcert binary (e.g., behind proxy).
fix
Install mkcert manually from https://github.com/FiloSottile/mkcert and ensure it's on PATH.
Error: EACCES: permission denied, open '/root/.mkcert-cli/certs/dev.key'
Running as root with restrictive file permissions.
fix
Use a custom output directory with write permissions: `npx mkcert-cli --outDir /tmp/certs`
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
mkcert-cli — npm install mkcert-cli · libregistry