During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in
locally certificate
This page is part of the CLI Reference and is generated from the CLI's own help output, so it matches what locally certificate --help prints.
For more information see Machine Configuration.
locally certificate
Manage the TLS certificate Locally uses.
Usage
locally certificate [flags] locally certificate [command]
Flags
-h, --help[=true|false] help for certificate
Subcommands
- locally certificate generate - Generate a TLS certificate covering every domain Locally needs.
- locally certificate get-mkcert-command - Print a ready-to-run mkcert command covering every domain Locally needs.
- locally certificate get-required-domains - Print the domains Locally's TLS certificate must cover, comma-separated.
locally certificate generate
Generate a TLS certificate covering every domain Locally needs.
Generates a TLS certificate covering every hostname and IP Locally serves. Uses mkcert (https://github.com/FiloSottile/mkcert) if it's on your $PATH, otherwise Locally's built-in certificate authority. Pass --source to choose. Asks before overwriting existing files in --out-dir; without a terminal, pass --force. Works before Locally is configured. Examples: # Generate a certificate, preferring mkcert and falling back to the built-in CA locally certificate generate # Use the built-in CA even if mkcert is installed locally certificate generate --source builtin # Write into another directory, leaving this installation's configuration alone locally certificate generate --out-dir ./certs --no-update-config
Usage
locally certificate generate [flags]
Flags
--force[=true|false] Overwrite an existing certificate, key or CA already in --out-dir without prompting.
-h, --help[=true|false] help for generate
--no-update-config[=true|false] Leave this installation's configuration untouched, without prompting.
--out-dir string Directory to write the certificate, key and CA into (created if missing). (default "~/.config/locally")
--source string Which generator to use: auto (prefer mkcert, fall back to the built-in CA), mkcert (require mkcert) or builtin (force the built-in CA). (default "auto")
--update-config[=true|false] Point this installation's configuration at the newly generated certificate, without prompting.
locally certificate get-mkcert-command
Print a ready-to-run mkcert command covering every domain Locally needs.
Prints an mkcert command that generates a TLS certificate covering every hostname and IP Locally serves. The output is unquoted so it can be run with `$(locally certificate get-mkcert-command)`. To run mkcert without going through the shell, use `locally certificate generate`. Works before Locally is configured. Examples: # Print the command and run it interactively locally certificate get-mkcert-command # Run it (bash / zsh) $(locally certificate get-mkcert-command) # Override the output file paths locally certificate get-mkcert-command --out-dir ./certs --cert-file dev.pem --key-file dev.key
Usage
locally certificate get-mkcert-command [flags]
Flags
--cert-file string Filename for the generated certificate (passed to mkcert -cert-file). (default "local-cert.pem")
-h, --help[=true|false] help for get-mkcert-command
--key-file string Filename for the generated private key (passed to mkcert -key-file). (default "local-cert.key")
--out-dir string Directory to prepend to --cert-file and --key-file. Defaults to the current working directory.
locally certificate get-required-domains
Print the domains Locally's TLS certificate must cover, comma-separated.
Prints the domains Locally's TLS certificate must cover, for CI jobs that generate a certificate before starting Locally. Works before Locally is configured. Examples: # Capture the list into an env var for later steps echo "DOMAINS=$(locally certificate get-required-domains)" >> $GITHUB_ENV # Pass directly to a cert tool (converting commas to spaces) mkcert $(locally certificate get-required-domains | tr ',' ' ')
Usage
locally certificate get-required-domains [flags]
Flags
-h, --help[=true|false] help for get-required-domains
During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in