How to use --close-to command

I recently rekeyed my Pera Wallet to my Ledger Nano X, and I would like to revert this.

I saw that the --close-to command is able to execute this. How would I proceed?

Any advice and suggestion is greatly appreciated.

To close an account on Pera Wallet, I believe you just need to click on the “Max” button when sending away Algos to another account (that you want to use as the recipient to those Algos - this second account cannot be the original account).
Please always be careful when performing such advanced operations and first test on accounts with very few Algos.

This is assuming your account did not opt in to any asset or application.

I am assuming your question is related to Please help on rekeying, in which case you will not be able to close your account without opting out of AlgoFi, which you may or may not be able to do.
In addition, be always very careful if you committed Algos to governance, as closing an account would automatically may you ineligible.

Rekeying an account (as opposed to closing it) avoids most of the above issues in most cases.
Please ask the PeraWallet team on Discord (Pera Wallet) how to do it (and whether it is possible to do it). Link your Discord question to this forum question and Please help on rekeying

Disclaimer: I make no representations regarding the functioning or security of third party wallets, exchanges, processes, or tools mentioned in the answer above, and disclaims any liability therefor. You are fully responsible for the security and the availability of your keys.