Skip to content
Browse documentation

Getting started

Local development

Connect a project, keep local credentials private, and run your app with its Bulgur environment.

Connect your project

Create a project in Bulgur Cloud, then run init from your application directory. It signs you in on the terminal, writes bulgur.json with the organization, project, and default environment, and can offer to import application values from an existing .env. The file contains no credentials and can be committed.

For a Node or Expo project, init may offer to add the CLI as a devDependency and wrap the existing development script(s). Accept the setup, then run your usual dev command. On macOS and Linux, the npm package includes CLI binaries for x64 and arm64; Windows is not supported.

bash
cd ~/projects/my-app
npx bulgur init
# accept the script setup when offered
pnpm dev  # or: npm run dev, yarn dev, bun run dev
json
{
  "org": "your-org",
  "project": "your-project",
  "environment": "development"
}

Init asks before changing package.json. It wraps an existing dev script and Expo's start script, not build or production start. Commit bulgur.json, package.json, and the updated lockfile; keep bootstrap credentials in an ignored .env file. Teammates install dependencies, sign in once, and run the normal dev command.

Choose a local credential

init signs in interactively with an email or username and password. If you signed up through a social provider and do not have a password, create an API token in the dashboard and run npx bulgur login --token <token>. A project- or environment-bound full API token supports CLI run and pull. Keep the token out of source control.

If you prefer a project .env, place it beside bulgur.json. The CLI reads only BULGUR_TOKEN and an optional BULGUR_HOST from that file; it does not export other entries or expand variables. The project file may be found in an ancestor directory when you use run or pull from a subdirectory.

bash
npx bulgur login
dotenv
# .env beside bulgur.json — keep this file ignored
BULGUR_TOKEN=blg_replace_with_project_bound_full_token
SourceWhen it wins
Process BULGUR_TOKENHighest priority; the CLI does not read project .env.
Project .env BULGUR_TOKENUsed when no process token is present; beats the saved login.
Saved bulgur loginUsed when neither source above provides a token.

An explicitly empty process token or malformed project credential fails instead of silently falling back. A file BULGUR_HOST applies only with the token from that same file; an explicit process BULGUR_HOST takes priority. bulgur share prefers the saved login over a project .env token when both are for the same server, because project tokens cannot create links.

Run and export

For a supported Node or Expo dev script wrapped by init, use your normal package-manager command. run fetches the selected environment and injects values into one child process when you need to start a custom command. pull writes values to a local file; use a different output path if your .env supplies the CLI token. The CLI refuses to overwrite that credential file, even with --yes.

Do not push the credential bootstrap .env into Bulgur: push imports every parsed key. Use a separate file containing only application values when importing.

bash
pnpm dev  # wrapped dev script; npm run dev / yarn dev / bun run dev also work
npx bulgur run -- node scripts/task.js  # custom command
npx bulgur pull -e development --out .env.bulgur --yes
npx bulgur push .env.import -e development