A quick 3d model of a magnetic cable clip works for small cables. Works with 6x2mm magnets. Make sure you are using strong magnets.
https://a.co/d/23FH0eI