The well-known method for unlocking the CLI wallet is


 veil-cli walletpassphrase YourPassphrase true 1000000

to indicate a long time-out of a million seconds, and to be unlocked only for staking. Using false instead of true will unlock for spending too.


The help text for the walletpassphrase command tells us that you can specify the maximum time of 100000000 (a hundred million) seconds or about three years by simply using a zero instead.


The most obvious problem with the above method, in contrast to unlocking the GUI Qt wallet is that you would be typing your passphrase in clear text, which in Ubuntu, if not putting a space at the start of the command line, before the command, would be remembered in command history! In macOS Terminal it remembers the command history even if you put a space before it!


Use stdinwalletpassphrase to prompt for the passphrase, which will be hidden when you type it!

veil-cli -stdinwalletpassphrase walletpassphrase false 10000

This will prompt for your input, and unlock (fully) for 10000 seconds, or whichever other time span you specify.

When you are finished with your transactions you may use the command again, but specify true to unlock for staking only. 

Note, when receiving stealth and RingCT coins your wallet will not show you the information, because it doesn't know, until you fully unlock the wallet.


Locking the wallet in order to NOT be staking, and be unable to spend.

veil-cli walletlock


Encrypting the wallet initially

 veil-cli encryptwallet YourPassphraseNOTthis!

I would recommend doing this right when you have first created your wallet, and do it in a "screen" session so the command history does not capture the passphrase! After starting up the wallet again (with `veild -daemon`) you will then be able to create your Veil stealth address and basecoin address if necessary.

veil-cli getnewaddress "My stealth address"

or

veil-cli getnewbasecoinaddress "Withdraw from exchange 20230526"

The above commands would normally be prefixed with "./" in Linux or macOS, but not in Windows, when being invoked from the current working directory. For example:
 ./veil-cli getbalances

in Ubuntu and macOS, or 

 veil-cli.exe getbalances

in Windows, but while that clearly indicates a command in Windows, it should also work fine without typing the ".exe" part.