He uses a “word of command” somewhat earlier to light a fire in wet wood as they try to go over Caradhras
This also was a desperate situation. It was cold and the hobbits were on the point of death
‘You may make a fire, if you can,’ answered Gandalf. ‘If there are any watchers that can endure this storm, then they can see us, fire or no.’
But though they had brought wood and kindlings by the advice of Boromir, it passed the skill of Elf or even Dwarf to strike a flame that would hold amid the swirling wind or catch in the wet fuel. At last reluctantly Gandalf himself took a hand. Picking up a faggot he held it aloft for a moment, and then with a word of command, naur an edraith ammen! he thrust the end of his staff into the midst of it. At once a great spout of green and blue flame sprang out, and the wood flared and sputtered.
“If there are any to see then I at least am revealed to them,’ he said. ‘I have written Gandalf is here in signs that all can read from Rivendell to the mouths of the Anduin.
So we actually have the words of a “word of command”. It may mean “spell producing fire”
So the words themselves don’t seem especially important. At least - perhaps you could interpret the passage differently but the most natural reading I think is that he spoke the words aloud for anyone listening to hear.
And he says “If there are any to see then I at least am revealed to them,” which also suggests that it’s not the words as such that are important but the person who spoke them.