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

# Installation

Commonality works with any existing JavaScript project and all package managers.

**Supported package managers:**

* [npm](https://docs.npmjs.com/cli/v8/)
* [yarn](https://yarnpkg.com/)
* [pnpm](https://pnpm.io)
* [bun](https://bun.sh)

**System requirements:**

* [Node.js 18.17](https://nodejs.org) or later.

* macOS, Windows, and Linux are supported.

## Install globally

A global installation of Commonality will automatically detect the structure of your project based on the directory that the command is run in.

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install commonality --global
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn global add commonality
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm install commonality --global
    ```
  </Tab>
</Tabs>

After installation, navigate to any JavaScript project and start Commonality Studio.

```bash theme={null}
commonality studio
```

## Install in your project

If you're collaborating with others on the same project or if you're planning on running Commonality in CI you may want to add `commonality` as a dev dependency at the root of your project.

<Tabs items={['npm', 'yarn', 'pnpm']} storageKey="selected-pkg-manager">
  <Tab title="npm">
    ```bash theme={null}
    npm install commonality --save-dev
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add commonality --dev --ignore-workspace-root-check
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add commonality --save-dev --ignore-workspace-root-check
    ```
  </Tab>
</Tabs>

Your global installation of Commonality will continue to work in other projects.
However, if Commonality is installed locally in a project, the local installation will always take precedence over the global one.
