(maint) fix commands API examples

This includes an environment key in the replace-facts example so it works when copy pasted.

(cherry picked from commit 06e42200444b5e1e5f9171cdb7f69c2577ded625)