commander-in-chief; supreme commander
Military or historical use; refers to the highest-ranking officer in command.
He was appointed commander-in-chief of the allied forces.
Common in sports and club activities; the leader of a team.
He is the captain of the soccer club.
He serves as captain of the soccer club.
Our army struck down the enemy commander.
The team chose her as captain.
The newly joined player was appointed captain.
司令官 refers specifically to a military commanding officer, whereas 主将 can mean either a military commander-in-chief or, more commonly today, a sports team captain.
From 主 (master, chief) and 将 (general, leader). The compound originally referred to a military commander-in-chief and later extended to sports team captains.