A CLI wrapper for the Hive blockchain API using hive-tx
npm install @peakd/hive-tx-cliA command-line interface wrapper for the Hive blockchain API using hive-tx v6.
- Query Operations: Get account info, blocks, posts, and make raw API calls
- Broadcast Operations: Vote, comment, transfer, and broadcast custom JSON
- Image Uploads: Upload images to Hive ImageHoster
- Secure Configuration: Store account credentials safely in ~/.hive-tx-cli/config.json (permissions 600)
- Interactive Setup: Easy configuration with prompts
- Node.js 22: Built for modern Node.js with TypeScript
``bash
pnpm install -g @peakd/hive-tx-cli
yarn global add @peakd/hive-tx-cli
npm install -g @peakd/hive-tx-cli
`
`bashClone or download the project
git clone
cd hive-tx-cli
Quick Start
1. Configure your account:
`bash
hive config
`2. Check configuration status:
`bash
hive status
`3. Query an account:
`bash
hive account peakd
`Commands
$3
`bash
Interactive configuration setup
hive configShow current configuration
hive config --showSet a specific value
hive config set account myaccount
hive config set postingKey Get a specific value
hive config get accountClear all configuration
hive config --clear
`$3
`bash
Get account information
hive account Get dynamic global properties
hive propsGet block by number
hive block Get content (post/comment)
hive content Make a raw API call
hive call database_api get_accounts '[["username"]]'
`$3
`bash
Vote on a post/comment
hive vote --author --permlink --weight 100Create a post
hive post --permlink my-post --title "My Post" --body "Content here" --tags "hive,blockchain"Create a post with custom metadata
hive post --permlink my-post --title "My Post" --body "Content here" --tags "hive,blockchain" --metadata '{"app":"hive-tx-cli/2026.1.1","format":"markdown"}'Create a comment
hive comment --permlink my-reply --body "Comment text" --parent-author --parent-permlink Transfer HIVE or HBD (requires active key)
hive transfer --to --amount "1.000 HIVE" --memo "Thanks!"Broadcast custom JSON
hive custom-json --id --json '{"key":"value"}'Broadcast raw operations
hive broadcast '["vote",{"voter":"me","author":"you","permlink":"post","weight":10000}]' --key-type posting
`$3
`bash
Upload an image (requires posting key)
hive upload --file ./path/to/image.jpgUse a different ImageHoster
hive upload --file ./image.png --host https://images.ecency.comSpecify account for this command
hive upload --file ./image.jpg --account myaccount
`The command returns JSON with the uploaded image URL.
Global Options
`bash
Specify a different Hive node
hive --node https://api.hive.blog account peakdSpecify account for this command only
hive --account myaccount vote --author author --permlink permlink --weight 100
`Configuration File
Configuration is stored in
~/.hive-tx-cli/config.json with 600 permissions (read/write only for owner):`json
{
"account": "your-username",
"postingKey": "your-posting-private-key",
"activeKey": "your-active-private-key",
"node": "https://api.hive.blog"
}
`Security Note: Never commit your private keys to version control!
Environment Variables
You can provide credentials via environment variables instead of the config file. When set, these values take precedence over the file.
-
HIVE_ACCOUNT
- HIVE_POSTING_KEY
- HIVE_ACTIVE_KEYExample:
`bash
export HIVE_ACCOUNT="your-username"
export HIVE_POSTING_KEY="your-posting-private-key"
export HIVE_ACTIVE_KEY="your-active-private-key"hive vote --author author --permlink permlink --weight 100
`Development
`bash
Run in development mode
pnpm devBuild for production
pnpm buildRun specific command in dev mode
pnpm dev -- account peakd
``- hive-tx v6 - Hive blockchain transaction library
- commander - CLI framework
- chalk - Terminal styling
- inquirer - Interactive prompts
- ora - Loading spinners
- fs-extra - Enhanced file system operations
- Node.js >= 22.0.0
- pnpm (package manager)
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions related to hive-tx, visit: https://github.com/mahdiyari/hive-tx