The official command-line interface for scaffolding and managing HonestJS projects.
To install the CLI globally, run:
bun add -g @honestjs/cliThe HonestJS CLI provides several commands to help you get started with your project.
The new command creates a new HonestJS project with a default structure and configuration.
honestjs new <project-name> [options]
honest new <project-name> [options]
hnjs new <project-name> [options]
honestjs create <project-name> [options]
honestjs scaffold <project-name> [options]Arguments
<project-name>: The name of the project to create.
Options
-t, --template <template>: Template name (e.g.,barebone,blank,mvc) or local path (./path,~/path).-p, --package-manager <manager>: Choose a package manager (e.g.,bun,npm,yarn,pnpm).--typescript: Use TypeScript in the project.--no-typescript: Do not use TypeScript in the project.--eslint: Add ESLint for code linting.--no-eslint: Do not add ESLint.--prettier: Add Prettier for code formatting.--no-prettier: Do not add Prettier.--docker: Add Docker configuration.--no-docker: Do not add Docker configuration.--git: Initialize a Git repository.--no-git: Do not initialize a Git repository.--install: Install dependencies after creating the project.--no-install: Do not install dependencies.-y, --yes: Skip all prompts and use default settings.--offline: Use cached templates only (no network).--refresh-templates: Force refresh template cache before use.--dry-run: Show what would be created without writing files.--strict: Fail on first transform error (useful for CI).--json: Output command result as JSON.
Local templates: Use a local path for --template to scaffold from a local templates repo or single template
directory. Examples: honestjs new my-app -t ./templates -y, honestjs new my-app -t ~/company/templates -y.
The list command displays all available templates that can be used to create a new project.
honestjs list [options]Options
-j, --json: Output the list of templates in JSON format.-c, --category <category>: Filter templates by category.-t, --tag <tag>: Filter templates by tag.-l, --local <path>: List templates from a local path (repo root or single template).--offline: Use cached templates only (no network).--refresh-templates: Force refresh template cache before use.
The info command shows information about the CLI, templates, and your environment.
honestjs info
honestjs info --local ./templates
honestjs info --jsonOptions
-l, --local <path>: Show templates from a local path instead of remote.--json: Output command result as JSON.
The doctor command diagnoses your environment: runtime (Node/Bun), Git, package managers, template cache, and network
connectivity.
honestjs doctorThe generate command (aliased as g) creates new files based on a schematic.
honestjs generate <schematic> <name> [options]
honestjs generate <schematic> <name> --jsonArguments
<schematic>: The type of file to generate (e.g.,controller,service,module).<name>: The name of the generated item.
Options
-p, --path <path>: Specify the path where the file should be created.-f, --flat: Create the file in a flat structure (without a dedicated folder).--force: Overwrite existing files without prompting.--dry-run: Show what would be created without writing files.--skip-import: Do not import the generated item into other files.--export: Export the generated item.--json: Output command result as JSON.
Available Schematics
controller(orc): Generates a new controller.service(ors): Generates a new service.module(orm): Generates a new module.view(orv): Generates a new view.middleware(orc-m): Generates a new middleware.guard(orc-g): Generates a new guard.filter(orc-f): Generates a new filter.pipe(orc-p): Generates a new pipe.
This project is licensed under the MIT License.