{"id":17684,"library":"hpal","title":"hapi pal CLI","description":"hpal is the command-line interface (CLI) for the hapi pal ecosystem, designed to streamline the development of Hapi.js applications. Currently at version 2.6.0, hpal offers tools for rapidly scaffolding new Hapi projects based on the official pal boilerplate, generating common application components like routes, models (using schwifty), and services (using schmervice) through haute-couture conventions, and providing a command-line interface to search Hapi and related package documentation (e.g., Joi, Toys). It also enables the execution of custom commands defined by Hapi server plugins. The tool is maintained as part of the hapipal initiative, focusing on convention over configuration for Hapi development, and is primarily intended for use via npx as a development dependency.","status":"active","version":"2.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/hapipal/hpal","tags":["javascript","hapi","hapijs","pal","cli","scaffold","auto-generate","project","commands"],"install":[{"cmd":"npm install hpal","lang":"bash","label":"npm"},{"cmd":"yarn add hpal","lang":"bash","label":"yarn"},{"cmd":"pnpm add hpal","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"hpal is designed for use with hapi v17+ and heavily interacts with the hapi ecosystem for scaffolding, generating, and running commands.","package":"hapi","optional":false},{"reason":"The `hpal make` command relies on a project being structured according to haute-couture conventions and the presence of a .hc.js file.","package":"haute-couture","optional":false}],"imports":[{"note":"hpal is a CLI tool and is not designed for programmatic import via `import` or `require`. It should be invoked using `npx` from your project's root, or after local installation as a dev dependency.","wrong":"hpal <command> <options>","symbol":"hpal","correct":"npx hpal <command> <options>"},{"note":"Creates a new hapi project scaffold based on the pal boilerplate.","symbol":"hpal new","correct":"npx hpal new <project-directory>"},{"note":"Generates new haute-couture-managed files (e.g., routes, models, services) within an existing project.","symbol":"hpal make","correct":"npx hpal make <item-type> <item-name>"}],"quickstart":{"code":"npm install --save-dev hpal\nnpx hpal docs --ver 18.1.0 h.response","lang":"javascript","description":"Installs hpal as a dev dependency and then uses npx to search the Hapi.js documentation for the `h.response` method specific to version 18.1.0."},"warnings":[{"fix":"Ensure your project's Hapi.js version is 17 or higher and your Node.js runtime is 8 or higher.","message":"hpal is designed for use with Hapi.js v17+ and Node.js v8+ environments. Using it with older versions of Hapi or Node.js may lead to unexpected behavior or errors.","severity":"gotcha","affected_versions":"<=2.6.0"},{"fix":"Install with `npm install --save-dev hpal` and run using `npx hpal <command>`.","message":"The recommended installation method for hpal is as a development dependency, invoked via `npx`. Avoid global installation (`npm install -g hpal`) to prevent version conflicts and ensure projects use their specified hpal version.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your project is configured for haute-couture with a `.hc.js` file. Projects scaffolded with `hpal new` are pre-configured.","message":"The `hpal make` command requires a `.hc.js` file to be present in your project's root or the specified plugin directory. This file dictates the haute-couture conventions for file generation.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Install hpal as a dev dependency (`npm install --save-dev hpal`) and then run commands using `npx hpal <command>`.","cause":"The hpal CLI is not globally installed or `npx` is not being used to invoke a locally installed `hpal` within a project's `node_modules`.","error":"hpal: command not found"},{"fix":"Create a `.hc.js` file in your project's root, even if empty, or scaffold your project using `npx hpal new` which includes this configuration.","cause":"Attempting to use `hpal make` in a project that does not have a `.hc.js` configuration file, which is essential for haute-couture based file generation.","error":"Error: hpal make expects a .hc.js file in the project root or specified plugin directory."},{"fix":"Update your project's Hapi.js dependency to match the requirements of the generated code or plugins.","cause":"While not a direct hpal error, this often arises when hpal is used in a project with an older Hapi.js version that's incompatible with a plugin or boilerplate generated by hpal.","error":"Error: Plugin 'my-plugin' requires hapi version '20.x.x' but found '17.x.x'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}