Do I have to keep using my bonus action to keep ordering it to attack on every turn or can I just say "keep attacking that creature till its dead" and use my bonus action for other things like heat metal
As written, you command it to take specific actions (from the list provided by the class feature). “Keep attacking that creature until it’s dead” is not one of the things you can command it to do.
Some DMs may be more permissive. Allowing such things would increase the artificer’s potential damage output beyond what the game intends. Whether or not that’s a problem is up to the individual table.
Do I have to keep using my bonus action to keep ordering it to attack on every turn or can I just say "keep attacking that creature till its dead" and use my bonus action for other things like heat metal
As written, you command it to take specific actions (from the list provided by the class feature). “Keep attacking that creature until it’s dead” is not one of the things you can command it to do.
Some DMs may be more permissive. Allowing such things would increase the artificer’s potential damage output beyond what the game intends. Whether or not that’s a problem is up to the individual table.