In combat, if a Battle Smith Artificer commands a Steel Defender to attack in every round, does he need to use his bonus action in every round or only one command is necessary?
You need to use your bonus action each round
The relevant paragraph from the Battlesmith section states: (emphasis mine)
In combat, the defender shares your initiative count, but it takes its turn immediately after yours. It can move and use its reaction on its own, but the only action it takes on its turn is the Dodge action, unless you take a bonus action on your turn to command it to take another action.
So unless you spend your bonus action telling it to Attack, it will only Dodge.
Of two interpretations, only one is reasonable
The steel defender can (emphasis mine):
move and use its reaction on its own, but the only action it takes on its turn is the Dodge action, unless you take a bonus action on your turn to command it to take another action.
Is it ambiguous what "another action" means? I think it is clear that "another action" means 'one singular action' such that when it is complete it is not continued.
However, one could argue that 'another action' instead refers to a type of action, and thus, that commanding the steel defender to take 'the Attack action' means that it will continue to do so without changing to another type of action.
So let's follow this perspective to its logical conclusion. Suppose my Artificer uses their bonus action to command the Defender to take the Attack action on a specific foe, and then on the Defender's turn the foe is killed. If on the Defender's next turn it 'automatically' repeats the Attack action, what is its target? What will it attack, absent new direction from the Artificer (supplied by a new bonus action)? The Dodge action can be repeated without external context - the action doesn't interact with any other conditions on the field. But nearly every other action likely has a different context each round that would require clarification from the Artificer. Help: help who, with what? Hide: from who? (that is, of all the observers on the field, with which will the Defender have to break line of sight before attempting to Hide). Ready: ready what action, for what trigger? Search: search for what, where? Use an object: use what object, to do what? Repair: targeting itself, another construct, or an object?
I suppose that since the Defender is somehow capable of movement on its own, it could repeatedly take the Dash or Disengage actions absent any new context or direction. But it is clear that the majority of possible action "types" can simply not be repeated without the Artificer having to provide the Defender with new information. Thus I think it is clear that this interpretation of the Defender's text is not what is intended.
Following an alternate interpretation to its logical conclusion, it is unambiguous that the Artificer needs to take a new bonus action on each round in order to have the Defender take any action other than Dodge.
The wording is ambiguous.
The feature states that it requires "a bonus action on your turn" to issue a command, which in turn causes the Steel Defender "to take another action." It does not specify a duration or other constraint for the command (e.g. "on its next turn", as in the Command spell).
The qualifier "on your turn" could be read as meaning "on the immediately preceding turn", though that would call for past tense ("unless you have taken a bonus action on your turn"). Technically, by the time the Defender is acting, taking that bonus action is no longer an option because the player's turn is over.
Thus, "on your turn" could also signify just that: that the player has to choose a command (or none) on their turn and not during the Steel Defender's turn, say, after it made a saving throw or triggered something with their movement.
"One attack for one bonus action" is likely the intended reading.
Features that allow you to make an attack (or to cause another creature to make an attack) generally require your action, reaction or bonus action. This is by design, as "stacking" additional attacks from different sources would quickly lead to balance issues.
While the feature's wording is unclear, allowing a potentially unlimited number of attacks for only one bonus action would violate that design principle, so if that had been the intent, it's likely that would have been stated explicitly.
Granting one attack for one bonus action would also be in line with all similar features (with the exception of Commander's Strike, which has additional costs).