Skip to content
Kitsy Docs Open CNOS

Backend Projects

Backend Projects

Backend projects usually use one of two patterns:

  • cnos run -- <command> for zero-code-change adoption
  • import cnos from '@kitsy/cnos' for direct runtime reads

For an existing Express or Node service that already uses .env, start with the env bridge:

Terminal window
cnos build env --profile local --to .env.local
cnos build env --profile stage --to .env.stage

Then keep your current dotenv setup while moving runtime reads to CNOS.

Example:

import cnos from '@kitsy/cnos';
await cnos.ready();
const port = cnos.value('server.port');
const token = cnos.secret('app.token');

Env export bridge:

Terminal window
cnos build env --to .env.local
cnos build env --profile stage --to .env.stage

Projection-first packaging:

Terminal window
cnos build server --profile prod --to .cnos-server.json