If you are sending cycles between cycle wallets, you can use dfx wallet send
. from the docs:
dfx wallet [network] send [flag] <destination> <amount>
dfx wallet send r7inp-6aaaa-aaaaa-aaabq-cai 2000000000
If the canister is NOT a cycle wallet canister, you will need to create some methods to send and/or receive cycles, depending on what you want to do. For non-wallet-canisters, you can import the ExperimentalCycles
class to manage cycles.
Here are two pages that helped me:
You can also view my solution, where I transferred a non-wallet canister’s cycles back into a default cycle wallet