cnos build
cnos build
Use build when a repo needs a deterministic artifact derived from CNOS.
cnos build server --to .cnos-server.jsoncnos build browser --to .cnos-browser.jsoncnos build env --profile local --to .env.localcnos build env --profile stage --to .env.stagecnos build env --profile prod --reveal --to .env.production.localcnos build public --framework vite --to .env.productioncnos build env --profile local-domain --format docker-env --to .env.local-domainTargets:
build serverwrites a server runtime projection with resolved values plus secret refsbuild browserwrites a public-only browser projectionbuild envwrites explicit env mappings in formats likedotenv,shell,json,yaml,docker-env, ortomlbuild publicwrites promoted public env with optional framework prefixes like Vite and Next
All build artifacts are derived output. .cnos remains the source of truth.
Writing secrets into env artifacts
By default, build env masks secret env mappings as ****.
Use --reveal only when you intentionally want concrete secret values in the generated artifact:
cnos build env --profile prod --reveal --to .env.production.localCNOS protects this path in two ways:
- it verifies that the target file is gitignored before writing secrets
- it prints explicit risk warnings and, in interactive terminals, asks
Do you want to continue?before continuing