The Union army had four different commanders during the war which was designated with the rank General-in-Chief. Winfield Scott was the General-in-Chief at the start of the war until he retired in October 1861. George B McClellan held the command from November 1861 until he was stripped of the title in March 1862. President Lincoln filled the role until Henry W Halleck was appointed General-in-Chief in July 1862. Hallack kept command until March 1864 when he was replaced by Ulysses Grant. Grant remained over the Union army until the end of the war.
American Civil War page