Clive Updates - execute Clive commands via an external bash shell script

@thebeedevs · 2025-06-12 14:34 · HiveDevs

We have completed three topics for this release. The first feature - important for some of you - is the ability to execute Clive commands as a bash shell script. The remaining topics are continuations of previous work - we added validations for exchanges (in the CLI and when loading transactions from a file) and updated several views to improve their appearance and consistency: loading from a file (key or transaction), saving transaction to a file, adding or editing aliases.

Clive commands as a bash script

You can run your script containing Clive commands using the --exec option. If your script includes logic that requires a password, for example to unlock or create a profile, you can provide it via a pipe passed to start_clive_cli.sh.
The script that launches Clive prepares the environment, but if you want to execute commands in unlocked mode, you still need to unlock a profile by placing a clive unlock --profile <name> command in your script.

Example of the script

I prepared the script my_script.sh. The script unlocks the profile alice and broadcasts the transfer to guest4test8 signing with alice_key.

#!/bin/bash

echo "Unlocking wallet for profile 'alice'..."
clive unlock --profile-name=alice 

echo "Transfer to guest4test8..."
clive process transfer --to guest4test8 --amount "0.001 hive" --sign alice_key

How to run a script

You can run your script using the following syntax:

echo alicealice | ./start_clive_cli.sh --exec ./my_script.sh

Of course you can provide a password in a safer and more convenient way, using a file or a bash environment variable.

If you want to use an environment variable:

export PASS=alicealice
echo  "${PASS}" | ./start_clive_cli.sh --exec ./my_script.sh`

If you want to use a file to provide a password:

echo alicealice > pass.txt
cat pass.txt | ./start_clive_cli.sh --exec ./my_script.sh`

After executing the above command, the transfer is broadcast.
image1.png

Validation related to exchanges

This is the final part of the changes related to checking operation receivers. We have already implemented the known account feature and validation against the bad accounts, both available in the CLI and the TUI. In this release we have added the remaining validations related to exchanges.
The validation checks whether the receiver account is an account belonging to one of the five most popular exchanges. The following accounts are checked:

Account name Entity
bdhivesteem Binance
deepcrypto8 Binance
huobi-pro HTX
user.dunamu Upbit
mxchive mexc

There are different validations for transfers and for other financial operations.

Validations for transfer

The transfer to an exchange should be in Hive and must include a memo. These conditions are checked in both the CLI and in the TUI.

Example: Transfer in the CLI
It is not possible to send transfers to exchanges without a memo or in HBD.

image2.png

Example: Transfer in the TUI
Here is an example of how it looks in the TUI. If the user enters an exchange as the receiver, it is not possible to switch currency and a memo is required. There is also a placeholder indicating that the user should check what should be entered in the memo.

image9.png

Validations for other financial operations

If one of the exchange accounts is set as the receiver of any financial operation other than transfer (transfer to savings, transfer from savings, recurrent transfer, power up, set delegations and set withdrawal routes), an error message appears. The validation may be bypassed by using the --force flag in the CLI or by confirming the dialog in the TUI.

Example:
Trying to send savings to an exchange account in the CLI.

image8.png

Example:
In the TUI, if the user wants to send savings to an exchange account, additional confirmation is required.

image7.png

Validations during loading the transaction from a file

The same validations as described above are executed during saving a transaction to a file or during loading the transaction from a file.

Example:
Validation triggered when loading a transaction that contains a transfer to an exchange without a memo.

CLI:

image5.png

TUI:

image3.png

Example:
Validation triggered when loading a transaction that contains an example of financial operation (transfer from savings) to an exchange without a memo.

CLI:
image4.png

TUI:
image6.png

New dialogs

To make Clive look more consistent, we have updated several views:

  • Add a new alias
  • Edit alias
  • Load transaction from a file
  • Load key from a file
  • Save transaction to a file
  • These views are displayed as dialog windows with buttons.

Below is an example of the new dialog window for adding a new alias.

image10.png

Complete list of corrected issues

The scripts that allow you to run Clive are here:
https://gtg.openhive.network/get/clive/

TL;DR

docker run -ti hiveio/clive:v1.27.11.3

Your feedback is invaluable and always welcome.

#hive #dev #clive #wallet #cli
Payout: 0.000 HBD
Votes: 307
More interactions (upvote, reblog, reply) coming soon.