create-openibm
v0.1.7
Published
Create a new IBM i application — interactive scaffold with Express, NestJS, or plain Node.js
Maintainers
Readme
create-openibm
Scaffold a new IBM i application in seconds — interactive CLI that asks what you need and wires everything up.
npm create openibm@latest
# or
npx create-openibm
# or pass the project name directly
npx create-openibm my-ibmi-appWhat it does
◆ create-openibm
◇ Project name
│ my-ibmi-app
◇ Framework
│ Express
◇ IBM i transport
│ HTTP (SSH tunnel — recommended for development)
◇ Starter examples (space to toggle, enter to confirm)
│ ◼ Program call
│ ◼ Table query
◇ Package manager
│ npm
◇ Initialize a git repository?
│ Yes
◇ Install dependencies now?
│ Yes
◆ Done! Next steps:
cd my-ibmi-app
cp .env.example .env
# fill in IBMI_SYSTEM, IBMI_USER, IBMI_PASS
npm run generate
# if your schema has outbound declarations, deploy to IBM i:
npm run setup:ibmi
npm run devOptions
| Question | Choices | |---|---| | Framework | None (plain Node.js), Express, NestJS | | Transport | HTTP (SSH tunnel), HTTPS, SSH (direct), ODBC (native DB2) | | Starter examples | Program call (XMLSERVICE *PGM), Table query (DB2 query builder) | | Package manager | npm, pnpm, Yarn | | Git init | Yes / No | | Install deps | Yes / No |
Generated structure
None (plain Node.js)
my-ibmi-app/
├── schema.ibmi ← define your programs and tables here
├── src/
│ ├── index.ts ← connect, call, query, disconnect
│ └── generated/ibmi/ ← created by: npm run generate
├── .env.example
├── tsconfig.json
└── package.jsonExpress
my-ibmi-app/
├── schema.ibmi
├── src/
│ ├── index.ts ← Express server with IBM i routes
│ └── generated/ibmi/
├── .env.example
├── tsconfig.json
└── package.jsonNestJS
my-ibmi-app/
├── schema.ibmi
├── src/
│ ├── main.ts
│ ├── app.module.ts
│ ├── ibmi/
│ │ ├── ibmi.module.ts ← provides IBMiService
│ │ ├── ibmi.service.ts ← wraps generated client, auto connect/disconnect
│ │ └── ibmi.controller.ts ← HTTP endpoints
│ └── generated/ibmi/
├── .env.example
├── tsconfig.json
└── package.jsonAfter scaffolding
cp .env.example .envFill in your IBM i credentials:
IBMI_TRANSPORT=http
IBMI_SYSTEM=your-ibmi-host
IBMI_USER=your-username
IBMI_PASS=your-password
IBMI_PORT=57700
IBMI_DATABASE=*LOCALThen generate the typed client from your schema:
npm run generateThis reads schema.ibmi and writes a fully typed TypeScript client to src/generated/ibmi/.
If your schema contains outbound declarations, run the setup script once per environment to upload RPG sources, compile SRVPGMs, and create DTAQs on IBM i:
npm run setup:ibmiThe script asks for SSH connection details and shows live progress per outbound.
Generated scripts
| Script | Description |
|---|---|
| generate | Run openibm generate — reads schema.ibmi, writes typed client |
| setup:ibmi | Deploy outbound RPG sources and compile on IBM i (only needed if schema has outbound blocks) |
| dev | Start the development server |
| build | Compile TypeScript |
Transport notes
| Transport | Notes |
|---|---|
| HTTP | Recommended for development. Requires an SSH tunnel: ssh -L 57700:localhost:57700 user@ibmi-host |
| HTTPS | Same as HTTP but TLS. Default port 47700. |
| SSH | Direct connection. Install the ssh2 peer dep: npm install ssh2. Also install xmlservice-utils on IBM i. |
| ODBC | Native DB2 pool. Best for production. Install odbc and the IBM i Access ODBC Driver. |
License
MIT
