CLI (@hira-core/cli)
The Hira CLI packages your flow into a .hira file for deployment to the Hira web platform.
Installation
pnpm add -D @hira-core/cliAfter installation, the hira command is available:
npx hira --help
npx hira build --helphira build
Bundle and package a flow into .hira format β ready to import into the Hira web platform.
hira build [entry] [options]Arguments
| Argument | Default | Description |
|---|---|---|
entry | ./index.ts | Path to the flow entry file |
Options
| Option | Default | Description |
|---|---|---|
-o, --output <path> | <name>.v<version>.hira | Output file path |
-n, --name <name> | Parent folder name | Flow name |
-v, --ver <version> | Current folder name (strip v prefix) | Flow version |
-d, --desc <text> | "" | Flow description |
-a, --author <name> | "Unknown" | Flow author |
Usage Examples
Basic build
Navigate to the flow version folder and run:
cd src/flows/login-flow/v1.0.0
npx hira buildThe CLI auto-detects:
- name β parent folder =
login-flow - version β current folder =
1.0.0(auto-stripsvprefix) - entry β
./index.ts
Output: login-flow.v1.0.0.hira
Build with custom options
npx hira build ./index.ts \
-n "facebook-login" \
-v "2.1.0" \
-d "Facebook login with 2FA" \
-a "Dev Team" \
-o ./dist/facebook-login.v2.1.0.hiraBuild from project root
npx hira build src/flows/login-flow/v1.0.0/index.ts -n login-flow -v 1.0.0Build output
π Starting build for: /path/to/index.ts
Flow: login-flow v1.0.0
Output: /path/to/login-flow.v1.0.0.hira
β
Found config:
globalInput: [targetUrl, delay]
profileInput: [username, password]
output: [loginStatus(Status), pageTitle(Title)]
β
Build success: /path/to/login-flow.v1.0.0.hira
Config: β
embedded in metaWhat happens during build?
Bundle
Your TypeScript source is bundled into a single JavaScript file. Libraries provided by the runtime (puppeteer-core, axios, @hira-core/sdk, etc.) are not included in the bundle β they are provided at runtime.
Extract config
The CLI reads your defineFlowConfig() and embeds it in the .hira file. The Hira web platform uses this config to render the settings UI (input fields, output columns) automatically.
Protect & Package
Code is minified, protected, compressed, and packaged into a .hira file with integrity verification.
[!NOTE] The
.hiraformat includes integrity checks. Tampered files will be rejected by the Hira agent.
Folder Convention
The CLI uses folder structure to auto-detect flow name and version:
src/flows/
βββ login-flow/ β name: "login-flow"
βββ v1.0.0/ β version: "1.0.0"
β βββ index.ts β entry (default)
β βββ logic.ts
βββ v1.1.0/ β version: "1.1.0"
βββ index.ts
βββ logic.ts[!TIP] Follow this convention and you wonβt need to pass
-nor-vflags β the CLI detects them automatically.
Add to package.json
{
"scripts": {
"build": "hira build",
"build:v1": "hira build src/flows/login-flow/v1.0.0/index.ts -n login-flow -v 1.0.0",
"build:v2": "hira build src/flows/login-flow/v1.1.0/index.ts -n login-flow -v 1.1.0"
}
}Deploying .hira files
Build
npx hira buildUpload
Go to hira-automation.com β Workflows β Upload Flow β Upload the .hira file
Configure
The platform reads the embedded config and shows the settings UI:
- Set global inputs (URL, delays, etc.)
- Assign anti-detect profiles
- Configure concurrency and execution settings
Run
Click Start β the flow runs on each assigned profile via the connected Hira agent.