[api] support and document collectbuildenv command