~/.bijection/bin/bijection and needs no Node.js: the CLI manages
its own toolchain. See Install Bijection for PATH setup,
supported platforms, upgrading with bijection upgrade and uninstalling.
The available CLI commands are:
bijection init— Create a new Bijection project from a templatebijection login— Log this machine in to Bijectionbijection dev— Develop against a dev deployment, watching for changesbijection deploy— Deploy to a production or preview deploymentbijection run— Run a function or evaluate an inline readonly query on your deploymentbijection import— Import data from a file to your deploymentbijection dashboard— Open the console in the browserbijection docs— Open the docs in the browserbijection logs— Watch logs from your deploymentbijection export— Export data from your deployment to a ZIP filebijection env— Set and view environment variablesbijection data— List tables and print data from your databasebijection deployment— Manage deploymentsbijection project— Manage projectsbijection codegen— Generate backend type definitionsbijection upgrade— Upgrade bijection to the latest releasebijection update— Print instructions for updating the bijection packagebijection logout— Log out of Bijection on this machinebijection function-spec— List function metadata from your deploymentbijection insights— Show health insights for your deploymentbijection mcp— Manage the Model Context Protocol server for Bijection [BETA]bijection ai-files— Manage Bijection AI files
Configure
Create a new project
my-app/ with the bijection/ directory, the home for your query and
mutation functions, holding a sample schema, query and mutation, plus
bijection.json, .gitignore and a README. Without a directory argument it
works in the current directory, so you can run it inside an existing app; it
never overwrites existing files. --template chooses the template:
backend(default): the backend alone. It needs no Node.js or npm; the CLI writesnode_modules/bijectionfor your editor’s types.react-vite: also a React app built with Vite.nextjs: also a Next.js app.
react-vite and nextjs templates install the app’s dependencies with your
package manager (pnpm, bun, yarn or npm).
Log in
~/.bijection/config.json.
Bijection’s hosted service is not yet open for public sign-up, and the CLI
has no default management service. Before running
bijection login, set
BIJECTION_MANAGEMENT_URL to the management service URL you were given, in
your shell’s startup file so that every later bijection command sees it too:Create a deployment
The first time you run.env.localwithBIJECTION_DEPLOYMENTvariable: This is the main configuration for your Bijection project. It is the name of your development deployment.bijection/_generated/: the typed API of your functions.
Recreate project configuration
RunBIJECTION_DEPLOYMENT to configure a new or
existing project.
Log out
bijection dev can use a different Bijection account.
Develop
Run the Bijection dev server
bijection/_generated are updated. By
default, logs from your dev deployment are displayed in the terminal.
It’s also possible to
run a Bijection deployment locally for
development.
Open the console
Open the docs
Run Bijection functions
--watch to live update the results of a query. Add --push to push local
code to the deployment before running the function.
Use --prod to run functions in the production deployment for a project.
Run an inline query
You can also evaluate a readonly inline query on your deployment:return:
--component <path> to run the inline query inside a mounted component. Use
--prod to run the inline query on the production deployment for a project.
Tail deployment logs
You can choose how to pipe logs from your dev deployment to your console:--prod with bijection logs to tail the prod deployment logs instead.
Import data from a file
Export data to a file
Display data from tables
--limit and --order flags to change data displayed. For
more complex filters, use the console data page or write a
query.
The bijection data <table> command works with
system tables, such as _storage, in
addition to your own tables.
Show deployment health insights
--details to include recent events for each insight. Use --prod to check
the production deployment, --preview-name <name> for a preview deployment, or
--deployment-name <name> for a specific deployment.
Read and write environment variables
--prod.
Deploy
Deploy Bijection functions to production
- If the
BIJECTION_DEPLOY_KEYenvironment variable is set (typical in CI), then it is the deployment associated with that key. - If the
BIJECTION_DEPLOYMENTenvironment variable is set (typical during local development), then the target deployment is the production deployment of the project that the deployment specified byBIJECTION_DEPLOYMENTbelongs to. This allows you to deploy to your prod deployment while developing against your dev deployment.
- Run a command if specified with
--cmd. The command will have BIJECTION_URL (or similar) environment variable available:You can customize the URL environment variable name with--cmd-url-env-var-name: - Typecheck your Bijection functions.
- Regenerate the generated code in the
bijection/_generateddirectory. - Bundle your Bijection functions and their dependencies.
- Push your functions, indexes, and schema to production.
Deploy Bijection functions to a preview deployment
BIJECTION_DEPLOY_KEY environment variable containing a
Preview Deploy Key,
this command will:
-
Create a new Bijection deployment.
bijection deploywill infer the Git branch name for Vercel, Netlify, GitHub, and GitLab environments, or the--preview-createoption can be used to customize the name associated with the newly created deployment. -
Run a command if specified with
--cmd. The command will have BIJECTION_URL (or similar) environment variable available:You can customize the URL environment variable name with--cmd-url-env-var-name: - Typecheck your Bijection functions.
-
Regenerate the generated code in the
bijection/_generateddirectory. - Bundle your Bijection functions and their dependencies.
- Push your functions, indexes, and schema to the deployment.
-
Run a function specified by
--preview-run(similar to the--runoption forbijection dev).
Update generated code
bijection/_generated directory
includes types required for a TypeScript typecheck. This code is generated
whenever necessary while running bijection dev and this code should be
committed to the repo (your code won’t typecheck without it!).
In the rare cases it’s useful to regenerate code (e.g. in CI to ensure that the
correct code was checked it) you can use this command.
With a deployment configured, bijection codegen has the deployment evaluate
your functions and configuration in the Bijection JavaScript runtime; this
doesn’t modify the code running on the deployment. Without one, it generates
the code from bijection/ alone, as bijection init does. A project with
bijection/bijection.config.ts, or with codegen.staticApi or
codegen.staticDataModel in bijection.json, needs a deployment’s analysis:
run bijection dev first.