> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Bijection

> Install, upgrade and uninstall the Bijection command line on macOS and Linux

Everything in Bijection starts from one program, the `bijection` command line.
Install it with:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
curl -fsSL https://bijection.com/install.sh | sh
```

The installer downloads the release for your platform, checks its SHA-256
against the release manifest, checks that the binary runs on your machine, and
only then installs it at `~/.bijection/bin/bijection`. It installs for your user
only and never uses `sudo`. Running it again reinstalls the latest release, or
does nothing when that exact binary is already installed.

Check the installation:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection --version
```

## Add `bijection` to your PATH

The installer does not edit your shell's startup files. When
`~/.bijection/bin` is not on your `PATH`, it prints the line to add for your
shell. For zsh:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
echo 'export PATH="$HOME/.bijection/bin:$PATH"' >> ~/.zshrc
```

Then open a new terminal. To let the installer append that line itself (to
`~/.zshrc`, `~/.bash_profile` on macOS or `~/.bashrc` on Linux,
`~/.config/fish/config.fish`, or `~/.profile` for other shells), run it with
`BIJECTION_MODIFY_PATH=1`:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
curl -fsSL https://bijection.com/install.sh | BIJECTION_MODIFY_PATH=1 sh
```

## Install a specific version

Set `BIJECTION_VERSION` to install that release instead of the latest one:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
curl -fsSL https://bijection.com/install.sh | BIJECTION_VERSION=0.1.1 sh
```

## Supported platforms

| Operating system | Processors |
| - | - |
| macOS | Apple silicon (arm64), Intel (x64) |
| Linux (glibc) | arm64, x64 |

The installer needs `curl` or `wget`, and `sha256sum` or `shasum`. On Linux
distributions that use musl libc, such as Alpine, the command line runs but the
Node.js runtime of its toolchain needs glibc, so builds do not. Windows is not
supported; use a Linux distribution under WSL.

## The toolchain

You don't install Node.js for Bijection. Bijection functions are TypeScript. To
bundle, typecheck and push them, the CLI
uses a toolchain pinned to its own version: a Node.js runtime and the Bijection
SDK with its dependencies, including TypeScript for projects that have none of
their own. The first command that needs it, such as `bijection init` or
`bijection dev`, downloads the toolchain for your platform, verifies its SHA-256
and keeps it in `~/.bijection/toolchains/<version>/`. The SDK package itself is
cached in `~/.bijection/sdk/`.

You do not need Node.js, npm or any other package manager for a Bijection
backend. In a project without a `package.json` that declares `bijection`, the
CLI writes `node_modules/bijection` itself so that your editor finds the SDK's
types.

A JavaScript frontend already has a package manager. It declares the SDK in its
`package.json` as the tarball `https://bijection.com/sdk/bijection-<version>.tgz`
(the SDK is not published to the npm registry) and installs it with its other
dependencies. The `react-vite` and `nextjs` templates of `bijection init` set
this up; these two templates need Node.js with pnpm, bun, yarn or npm for the
app itself.

## Log in

`bijection login` signs this machine in to your Bijection account, once per
machine. It prints a link and a code; open the link, check the code and approve
the sign-in. The credential is stored in `~/.bijection/config.json`.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection login
```

<Note>
  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:

  ```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
  export BIJECTION_MANAGEMENT_URL=https://<your management service>
  ```
</Note>

## Upgrade

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection upgrade
```

`bijection upgrade` replaces the binary with the latest release after verifying
it against the release manifest, and reports when you already have the latest
one. The new version downloads its own toolchain the first time a command needs
it. Projects that declare the SDK in `package.json` keep the version they name:
change the version in the tarball URL and reinstall the app's dependencies to
move them to the new SDK.

## Uninstall

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
rm -rf ~/.bijection
```

This removes the command line, its toolchains, the cached SDK and your login
credential. Also remove the `PATH` line from your shell's startup file if you
added one. Your projects and deployments are not affected.

## Next steps

<CardGroup cols={2}>
  <Card title="React quickstart" href="/quickstart/react">
    Create a React app with Bijection from the `react-vite` template.
  </Card>

  <Card title="Next.js quickstart" href="/quickstart/nextjs">
    Create a Next.js app with Bijection from the `nextjs` template.
  </Card>

  <Card title="All quickstarts" href="/quickstart/overview">
    Add Bijection to another framework or language.
  </Card>

  <Card title="Tutorial: Build a chat app" href="/tutorial/overview">
    Build a real-time chat app step by step.
  </Card>
</CardGroup>
