@hira-core/cli
v1.0.8
Published
CLI to build, obfuscate and package Hira automation flows into .hira format
Maintainers
Readme
@hira-core/cli
CLI for Hira automation developers.
It can:
- scaffold standalone flow projects with
hira init - add official reusable plugins with
hira add - bundle, obfuscate, and package flows into secure
.hirafiles withhira build
Installation
# Install globally (recommended)
npm install -g @hira-core/cli
# Check
hira --version
@hira-core/cliincludes the official plugin registry package@hira-core/plugins, so developers can runhira add wallet-utilswithout configuring a local registry path.
Commands
hira init [name]
hira add [plugin]
hira build [entry]hira init
Initialize a new standalone Hira flow project.
hira init
# or
hira init my-hira-flow --flow main --pm npmGenerated structure:
my-hira-flow/
├── package.json
├── package-lock.json
├── tsconfig.json
├── README.md
└── src/
└── flows/
└── main/
└── v1.0.0/
├── index.ts
├── logic.ts
├── run.ts
└── profiles.xlsxrun.ts uses:
profiles.xlsxas the input workbookoutput.xlsxas the output workbook- column-letter mappings, for example
B: "inputValue" flow.createExcelStorage(..., __dirname)so file paths resolve from the flow version folder
After init
cd my-hira-flow
npm i
cd src/flows/main/v1.0.0
node --import tsx run.tsTo build the .hira file:
cd src/flows/main/v1.0.0
hira buildGenerated projects intentionally do not use npm scripts for running flows. Run the dev runner directly with
node --import tsx run.tsfrom the flow version folder.
hira add
Add an official Hira plugin to the current project by copying plugin source into src/plugins.
hira add wallet-utils
hira add extension-utilsGenerated structure:
src/
└── plugins/
├── wallet-utils/
│ └── index.ts
└── extension-utils/
└── index.tsBecause plugins are copied into the flow project, the project remains independent after installation and hira build bundles plugin code into the final .hira package.
List available plugins
hira add --listOverwrite an existing plugin
hira add wallet-utils --forcePreview without writing files
hira add wallet-utils --dry-runLocal registry override for development only
hira add wallet-utils --registry packages/hira-plugins/dist--registry <path> is only for local CLI/plugin development before publishing @hira-core/plugins. Normal developers should use:
hira add wallet-utilsOfficial plugins
wallet-utils
Shared wallet automation helpers, including OKX wallet support.
import { WalletUtils, OKXWalletAdapter } from "../../../../plugins/wallet-utils";
const wallet = new WalletUtils(utils, logger, new OKXWalletAdapter());
await wallet.unlock(globalInput.walletPassword);
await wallet.approve();extension-utils
Chrome extension discovery helpers.
import { ExtensionUtils } from "../../../../plugins/extension-utils";
const extUtils = new ExtensionUtils(utils);
const okxId = await extUtils.getExtensionId("OKX");Import paths depend on where your
logic.tsfile is located. For the defaultsrc/flows/main/v1.0.0/logic.tslayout, use../../../../plugins/<plugin-name>.
hira build
Bundle, obfuscate, and package a flow into .hira format.
hira build [entry] [options]Arguments
| Argument | Description | Default |
| --- | --- | --- |
| entry | Path to entry TypeScript file | ./index.ts in current directory |
Options
| Flag | Description | Default |
| --- | --- | --- |
| -o, --output <path> | Output .hira file path | <flow-name>.v<version>.hira |
| -n, --name <name> | Flow name | Parent folder name |
| -v, --ver <version> | Flow version | Current folder name, stripping v prefix |
| -d, --desc <text> | Flow description | "" |
Recommended build usage
From a flow version folder:
cd src/flows/main/v1.0.0
hira buildThe CLI auto-detects:
- flow name from the parent folder, for example
main - version from the current folder, for example
v1.0.0→1.0.0 - SDK version from installed
@hira-core/sdk
Example output:
🚀 Starting build for: /path/to/v1.0.0/index.ts
Flow: main v1.0.0
Output: /path/to/v1.0.0/main.v1.0.0.hira
📦 Building flow: ...
✅ Found config:
globalInput: [...]
profileInput: [...]
🛡️ Obfuscating code...
✅ Build success: main.v1.0.0.hira
Bundle (minified): 29.44 KB
Bundle (obfuscated): 43.55 KB
Bundle (gzip+base64): 16.18 KB
Checksum (SHA-256): 145e5767e23d05e9...
Config: ✅ embedded in metaFull developer workflow
npm install -g @hira-core/cli
hira init my-hira-flow --flow main --pm npm
cd my-hira-flow
npm i
hira add wallet-utils
hira add extension-utils
cd src/flows/main/v1.0.0
node --import tsx run.ts
hira buildMaintainer workflow
Build plugin registry
pnpm run build:pluginsThis generates:
packages/hira-plugins/dist/
├── registry.json
└── plugins/Build CLI
pnpm run hira-cli buildPublish order
Publish plugins first:
cd packages/hira-plugins
pnpm publish --access public --no-git-checksThen publish CLI:
cd ../hira-compiler
pnpm publish --access public --no-git-checksUse
pnpm publishso workspace dependencies such asworkspace:^are rewritten to normal semver versions. Do not use rawnpm publishwhile workspace protocol dependencies are present.
Changelog
v1.0.5
- Added
hira addfor official Hira plugins. - Added bundled official plugin registry via
@hira-core/plugins. - Added support for
wallet-utilsandextension-utilsplugins. - Added
--list,--force,--dry-run, and local development--registryoptions.
v1.0.4
- Added
hira initto scaffold standalone flow projects. - Auto-detect SDK version and embed it in
.hirametadata. - Removed
--authorflag fromhira build.
v1.0.3
- Initial public release on npm.
- esbuild bundling + JavaScript Obfuscator.
- HMAC-SHA256 signing + gzip compression.
- Auto-extract
defineFlowConfig()and embed it in.hirametadata.
Related
@hira-core/sdk— SDK for building Hira flows@hira-core/plugins— official plugin registry forhira add
License
ISC
