Skip to Content
CLI (Build & Deploy)

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/cli

After installation, the hira command is available:

npx hira --help npx hira build --help

hira build

Bundle and package a flow into .hira format β€” ready to import into the Hira web platform.

hira build [entry] [options]

Arguments

ArgumentDefaultDescription
entry./index.tsPath to the flow entry file

Options

OptionDefaultDescription
-o, --output <path><name>.v<version>.hiraOutput file path
-n, --name <name>Parent folder nameFlow 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 build

The CLI auto-detects:

  • name β†’ parent folder = login-flow
  • version β†’ current folder = 1.0.0 (auto-strips v prefix)
  • 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.hira

Build from project root

npx hira build src/flows/login-flow/v1.0.0/index.ts -n login-flow -v 1.0.0

Build 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 meta

What 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 .hira format 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 -n or -v flags β€” 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 build

Upload

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.

Last updated on