I want to sign and verify a message using a segwit private key that i generated with another application. How can I sign and verify a message using electrum 3 cli?
verifymessage commands that you can use to sign and verify messages.
For signing messages with a different private key, you will need to import it into the wallet.
Verifying a message does not require any additional work.
First convert and import the key then go to view menu > show addresses, switch to addressess tab, right click on the address and choose sign/verify.
However note that the format Electrum uses for signatures from bech32 address private keys may be different from what other apps/hardware wallets use so your generated signature may not verify in other wallets.