You can call the command creation functions yourself, making the game think it's part of the simulation [1]. These types of cheat have been around ever since the original game, and the HD edition [2].
I was thinking of reverse-engineering the game's calls out of curiosity, but I figured someone else already did it and wrote a nice article about it... and there it is.
[1]: https://redrocket.club/posts/age_of_empires/ [2]: https://www.youtube.com/watch?v=3tl8AjDfnBk