Add CLI flags and port to environment.