Back to IntegrationsREGISTER YOUR WALLETSource → Source →
Command Line Interface
Herald + CLI Tool
Build a powerful CLI tool with Commander for sending Herald notifications from the terminal. Supports liquidation warnings, governance broadcasts, batch sends, rewards alerts, bridge transfer notifications, multisig approvals, delivery status checks, and quota queries.
Ready to ship?
Start sending zero-PII notifications in minutes.
ZK-SECURE SOLANA NATIVE
Package: @herald-protocol/sdk
Install: npm install @herald-protocol/sdk commander
View full example on GitHub →CLI Program Setup
Commander program registering all subcommands.
CLI Tool / CLI Program Setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
import { Command } from 'commander';import { liquidationCommand } from './commands/liquidation';import { governanceCommand } from './commands/governance';import { batchCommand } from './commands/batch';import { rewardsCommand } from './commands/rewards';import { bridgeCommand } from './commands/bridge';import { multisigCommand } from './commands/multisig';import { checkCommand } from './commands/check';import { usageCommand } from './commands/usage';
const program = new Command();
program .name('herald') .description('CLI for sending Herald notifications') .version('1.0.0');
liquidationCommand(program);governanceCommand(program);batchCommand(program);rewardsCommand(program);bridgeCommand(program);multisigCommand(program);checkCommand(program);usageCommand(program);
program.parse();Liquidation Command
Subcommand with positional args and options.
CLI Tool / Liquidation Command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Command } from 'commander';import { Herald } from '@herald-protocol/sdk';
const herald = new Herald({ apiKey: process.env.HERALD_API_KEY! });
export function liquidationCommand(program: Command) { program .command('liquidation') .description('Send liquidation warning to a wallet') .argument('<wallet>', 'Recipient wallet address') .requiredOption('--hf <number>', 'Health factor') .requiredOption('--pos <id>', 'Position ID') .option('--debt <number>', 'Debt amount', '0') .option('--asset <symbol>', 'Asset symbol', 'SOL') .action(async (wallet: string, opts) => { const idempotencyKey = `liquidation_${opts.pos}_${Math.floor(Date.now() / 30000)}`;
const result = await herald.notify({ wallet, subject: `⚠️ Liquidation Warning — Health factor: ${opts.hf}`, body: [ `Position #${opts.pos} is approaching liquidation.`, `Health factor: ${opts.hf}`, `Debt: ${opts.debt} ${opts.asset}`, `Add collateral or repay immediately.`, ].join('\n'), category: 'defi', receipt: true, idempotencyKey, });
console.log(`Sent: ${result.notificationId} (${result.status})`); });}Common Patterns
herald liquidation — send defi warning with arguments
herald governance — broadcast proposal to voters
herald batch — bulk notify from CSV file
herald check — poll delivery status
Start building with Herald
Clone the examples repo, copy the code that fits your stack, and deploy.