@rafikidota/iroh-cli
v0.4.0
Published
Official CLI for @rafikidota/iroh — runs its schematics (init, crud, use-case).
Maintainers
Readme
@rafikidota/iroh-cli
CLI to run @rafikidota/iroh schematics (init, crud, use-case) directly.
What it does
Wraps NodeWorkflow from @angular-devkit/schematics/tools to execute the @rafikidota/iroh schematics collection against the current project:
npx iroh setup
npx iroh init
npx iroh crud user
npx iroh use-case checkoutsetup is not a schematic: it installs the packages the generated code imports, using the
project's own package manager.
Commands
| Command | Schematic | Options |
| ---------------------- | ------------------------- | ------------------------------------------------------------- |
| iroh setup | — (installs dependencies) | --pm, --dry-run |
| iroh init | init | --path, --module, --dry-run, --force |
| iroh crud <name> | crud | --path, --module, --skip-import, --dry-run, --force |
| iroh use-case <name> | use-case | --path, --module, --skip-import, --dry-run, --force |
--dry-run and --force control the underlying workflow (preview vs. overwrite); the rest are forwarded as schematic options.
iroh setup
Installs into the current project:
- dependencies —
@rafikidota/iroh,@rafikidota/monadia,@rafikidota/serpens,@nestjs/config,@nestjs/swagger,@nestjs/typeorm,typeorm,pg,zod,dotenv,reflect-metadata,uuid,class-validator,class-transformer
The list is verified against two sources, not guessed: the external imports of the schematic
templates, and the modules the published @rafikidota/iroh bundle actually requires at runtime.
express, validator and libphonenumber-js are not installed — the bundle imports them for
types only, so they never reach runtime, and class-validator ships the last two anyway. pg is
installed because the data source generated by init hardcodes type: 'postgres' and TypeORM
declares every driver as an optional peer.
Nothing is installed as a devDependency. @nestjs/testing, which the generated *.spec.ts files
import, already ships with any project created by nest new; installing it here unpinned resolves
to a major that clashes with the NestJS version the runtime peers pull in, and npm rejects it with
ERESOLVE.
The package manager is taken from package.json's packageManager field, then from the lockfile
(pnpm-lock.yaml, yarn.lock, bun.lock/bun.lockb, package-lock.json), defaulting to npm —
the one that ships with Node and is therefore always present. Override it with
--pm <npm|pnpm|yarn|bun>. --dry-run prints the commands without running them.
Peer dependencies already expected in a NestJS project (@nestjs/common, @nestjs/core) and the
TypeORM database driver are not installed — those are the project's own choice.
On pnpm >= 11 an install that actually succeeded can still exit non-zero with
ERR_PNPM_IGNORED_BUILDS (a transitive dependency ships unreviewed build scripts). Run
pnpm approve-builds and then npx iroh setup again; the command is idempotent.
How to run
pnpm install
pnpm build
node dist/iroh.js initOr, once published, from any project with @rafikidota/iroh installed:
npx @rafikidota/iroh-cli initHow to test
pnpm typecheck
pnpm lint:check
pnpm test