The Doh CLI system consists of two main components:
This guide covers:
The Runtime CLI provides commands for managing Doh installations, initializing projects, and serving as a wrapper for Bun commands.
To install Doh for the first time:
Windows:
powershell -c "irm deploydoh.com/install.ps1 | iex"
Mac/Linux/Unix:
curl -fsSL https://deploydoh.com/install | bash
After installation, you can use the doh
command to manage both Doh and Bun runtimes.
Run doh
without any arguments to access the interactive main menu:
doh
This presents options to:
Access the initialization menu with:
doh init
Options include:
Direct command options:
doh init project # Initialize a standard Doh project
doh init doh # Same as 'project' (alternative command)
doh init module # Initialize a quick module
doh init wizard # Initialize a module with the wizard interface
doh init webserver # Initialize a Doh webserver project
doh init webserver clone [url] # Initialize and clone from a URL (prompts if URL omitted)
These commands can be used for both initial installation and subsequent upgrades:
doh install doh # Install or upgrade Doh globally
doh install bun # Install or upgrade Bun globally
Manage Node.js installation using Volta.
doh install node # Install Node.js globally via Volta (installs Volta if needed)
doh uninstall node # Uninstall Node.js managed by Volta
Execute Bun commands through Doh (Used with bun symlink to avoid installing bun globally):
doh bun [commands] # Run Bun commands (e.g., doh bun pm trust --all)
The Project CLI provides commands for managing Doh projects, packages, configurations, deployments, and backups. It integrates with Doh's core systems, including the auto-packager, Dohballs, package management, and pod configurations.
All commands of the Doh Project CLI core are compatible with the
--confirm-all
flag that shortcuts prompts
Start the Doh application.
doh run # Run with auto-packager
doh run no-pack # Run without auto-packager or installer
doh run pod.yaml # Run with specific pod configuration (inherits from /pod.yaml)
doh run <module name> # Run with only the specified module (and its dependencies) loaded
doh run help # Show detailed help for the run command
Run the auto-packager and force ESBuild compilation. This command is useful for updating build artifacts without running the full application.
doh update
These commands also clean up obsolete files from previous versions based on the
dohball.json
.
Install specified Doh packages from configured Dohball hosts. Runs the packager after installation, which includes cleanup of obsolete files from previous versions based on dohball.json
.
doh install package1 [package2...]
Upgrade all or specific Doh packages.
doh upgrade # Upgrade all packages
doh upgrade package1 [package2] # Upgrade specific packages
Reinstall all or specific Doh packages. Runs the packager after reinstallation, which includes cleanup of obsolete files from previous versions based on dohball.json
.
doh reinstall # Reinstall all packages
doh reinstall package1 [package2] # Reinstall specific packages
Show the current value and inheritance chain of a pod setting.
doh pod express_config.port # Example for a specific setting
Manage pod inheritance.
doh inherits /path/to/pod.yaml # Add inheritance
doh inherits ~~/path/to/pod.yaml # Remove inheritance
Manage Doh package autoloading in Bun/Node.js.
doh host_load package1 [package2] # Add packages
doh host_load ~~package1 [package2] # Remove packages
Manage Dohball hosts.
doh dohball_host https://host.com # Add host
doh dohball_host ~~https://host.com # Remove host
Create Dohballs for exposed packages.
This process identifies files removed since the last version and records them in dohball.json
for cleanup during installation.
doh bake # Bake all exposed packages
doh bake package1 [package2] # Bake specific packages
Force recreation of Dohballs.
This process identifies files removed since the last version (if one exists) and records them in dohball.json
for cleanup during installation.
doh rebake # Rebake all packages
doh rebake package1 [package2] # Rebake specific packages
Create the Dohball hosting manifest from locally hosted Dohballs.
doh compile-dohball-manifest
Manually process the removals
list found in the dohball.json
of installed packages, deleting obsolete files.
May prompt for confirmation before deleting files unless --confirm-all
is used.
doh do-removals
Show Dohball status, including installed versions, remote versions, and update availability.
doh status # Show basic status
doh status verbose # Show detailed status with integrity info, paths, and symlink details
Create a tagged backup. If no tag is provided, it runs doh codify
to create a standard auto-versioned backup.
doh enshrine <tag>
Restore from a backup. If no version or tag is specified, it displays a menu of available codex and shrine backups.
doh enact # Show available backups
doh enact <version|tag> # Restore a specific backup
Most clear-*
commands prompt for confirmation. Use the force
argument or the --confirm-all
flag to bypass these prompts (e.g., doh clear-pod force
or doh clear-pod --confirm-all
).
Clear pod cache and manifest.
doh clear-pod
Clear auto-packager output and manifests (includes package.cache.json
, core_package.cache.json
, and compiled_dohball_manifest.json
).
doh clear-packager
Clear the build directory at /dist containing compiled bundles. (Not part of clear-all)
doh clear-build
Clear Doh cache files.
doh clear-doh-cache
Clear pod cache/manifest and auto-packager manifests/caches (equivalent to doh clear-pod force
and doh clear-packager force
). Does not clear the build directory (/dist
) or hosted Dohballs.
doh clear-all
Generate documentation by consolidating project .md
files.
doh compile-docs # Generate markdown docs (/doh_js/manifests/doh.md)
doh compile-docs yaml # Generate YAML docs (/doh_js/manifests/doh.yaml)
doh compile-docs json # Generate JSON docs (/doh_js/manifests/doh.json)
doh compile-docs txt # Generate plain text docs (/doh_js/manifests/doh.txt)
doh compile-docs json-txt # Generate JSON-as-text docs (/doh_js/manifests/doh.txt)
doh compile-docs [format] --skip-toc # Generate docs without the Table of Contents
Configure PM2 process management.
Uses Doh.pod.pm2
doh pm2 setup # Set up PM2 configuration
doh pm2 stop # Stop the process
doh pm2 restart # Start/Restart the process
doh pm2 delete # Delete the process
doh pm2 log # View/tail logs
Export a Doh module to a static HTML file.
doh export # Export using default pod.yaml
doh export pod.yaml # Export using a specific pod configuration
The export command creates a completely self-contained HTML file that bundles your Doh application with all its dependencies. See Export Tool Documentation for comprehensive details.
Register new commands using Doh.CLI()
:
Doh.CLI('packageName', {
'commandName': {
file: 'path/to/implementation.js',
help: 'Command description and usage'
}
});
Command implementation files should be ES modules:
// implementation.js
const args = process.argv.slice(3); // Get command arguments
// Command logic
export default null; // Export is ignored
Commands are compiled into /.doh/manifests/cli_manifest.json
:
{
"packageName": {
"commandName": {
"file": "/path/to/implementation.js",
"help": "Command description and usage"
}
}
}
Command Names
Help Text
Implementation
Documentation