“they gathered themselves together to fight with Joshua.” These tribes were not always friendly among themselves, and there is evidence of occasional wars between them. This is a good example of “the enemy of my enemy is my friend.”
“under one command.” The Hebrew is literally, “one mouth.” The enemy was composed of different armies, but they fought as one (cp. 2 Chron. 18:12).