Add initial assertions for doc_ document cross references.
Move env printing after validation and command interpretation.