@hira-core/cli
v1.0.4
Published
CLI to build, obfuscate and package Hira automation flows into .hira format
Downloads
351
Maintainers
Readme
@hira-core/cli
CLI to build, obfuscate and package Hira automation flows into the secure .hira format, ready to upload to the Hira platform.
Installation
# Install globally (recommended)
npm install -g @hira-core/cli
# Or use directly with npx
npx @hira-core/cli buildUsage
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 dir |
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 (strips v prefix) |
| -d, --desc <text> | Flow description | "" |
SDK version: The CLI automatically detects the installed
@hira-core/sdkversion and embeds it in the.hirapackage metadata. The agent uses this to ensure the correct SDK version is available at runtime.
Recommended Project Structure
my-flows/
└── my-flow/
└── v1.0.0/
├── index.ts ← entry point (export default MyFlow)
└── logic.ts ← flow implementationRun from inside the version folder:
cd my-flow/v1.0.0
hira build
# → my-flow.v1.0.0.hiraThe CLI auto-detects:
- Flow name from parent folder (
my-flow) - Version from current folder (
v1.0.0→1.0.0)
Example
v1.0.0/index.ts
import { MyFlow } from "./logic";
export default MyFlow;v1.0.0/logic.ts
import {
AntidetectBaseFlow,
AntidetectProvider,
IFlowConfig,
IScriptContext,
BrowserUtils,
FlowLogger,
} from "@hira-core/sdk";
const config = {
globalInput: [
{
key: "targetUrl",
label: "Target URL",
type: "text" as const,
required: true,
},
],
profileInput: [{ key: "username", label: "Username", type: "text" as const }],
} as const satisfies IFlowConfig;
type MyConfig = typeof config;
export class MyFlow extends AntidetectBaseFlow<MyConfig> {
constructor() {
super(AntidetectProvider.GPM, new FlowLogger(MyFlow.name), config);
}
async script(context: IScriptContext<MyConfig>): Promise<void> {
const { logger, globalInput } = context;
const utils = new BrowserUtils(context);
await utils.goto(globalInput.targetUrl);
logger.success("✅ Done!");
}
}
export default MyFlow;Build
hira buildOutput:
🚀 Starting build for: /path/to/v1.0.0/index.ts
Flow: my-flow v1.0.0
Output: /path/to/v1.0.0/my-flow.v1.0.0.hira
📦 Building flow: ...
✅ Found config:
globalInput: [targetUrl]
profileInput: [username]
🛡️ Obfuscating code...
✅ Build success: my-flow.v1.0.0.hira
Bundle (minified): 85.00 KB
Bundle (obfuscated): 120.00 KB
Bundle (gzip+base64): 40.00 KB
Checksum (SHA-256): a3f8c2d1...
Config: ✅ embedded in metaChangelog
v1.0.4
- Auto-detect SDK version: The CLI now resolves the installed
@hira-core/sdkversion and embeds it inmeta.sdkVersioninside the.hirapackage. The agent uses this to auto-download the correct SDK version at runtime. - Removed
--authorflag: The-a, --authoroption has been removed fromhira build.
v1.0.3
- Initial public release on npm
- esbuild bundling + JavaScript Obfuscator
- HMAC-SHA256 signing + gzip compression
- Auto-extract
defineFlowConfig()and embed in.hirameta
Related
@hira-core/sdk— SDK for building flows
License
ISC
