Skip to content

Getting started with oneRepo

  1. Install the CLI

    First, install oneRepo’s one command into your path:

    Install via npm
    npx --package=onerepo one install
  2. Create your oneRepo

    Next, use the one create command to initialize into an existing or a new repository.

    Initialize oneRepo in a new or existing repository
    one create
  3. Bring your own Package Manager

    oneRepo is compatible with all major package managers for Node.js.

    Choose your own package manager
    ? Which package manager would you like to use?
    ❯ npm
    pnpm
    yarn
  4. Configure your repo

    Modify the root configuration file, ./onerepo.config.ts, for your repo’s specific needs.

    Refer to the full configuration documentation for more information.

    ./onerepo.config.js
    export default {
    root: true,
    codeowners: {},
    tasks: {},
    // And much more!
    };
  5. Ready to go!

    That’s it! Change into your monorepo’s root directory and use the one CLI.

    Terminal window
    cd my-monorepo
    one --help
    one <command> [options]
    one workspace <workspace-name> <command> [options]
    Commands:
    one tasks Run tasks against repo-defined lifecycles. This
    command will limit the tasks across the affected
    workspace set based on the current state of the
    repository.
    one hooks Manage git repository hooks
    one graph Run core Graph commands
    one generate Generate files, folders, and workspaces from
    templates. [aliases: gen]
    # …
  1. Install dependencies

    Install dependencies using your package manager of choice.

    Install via npm
    npm install --save-dev onerepo
  2. Install the CLI

    Install the CLI into your system. This will create a command, one, that can be run from anywhere in your path. It will always pick up a local version of onerepo, if it exists, otherwise fall back on the current version.

    Install via npm
    npm exec one install
  3. Configure workspaces

    Configure your package manager to work with workspaces

    package.json
    {
    "name": "my-monorepo",
    "private": true,
    "workspaces": ["apps/*", "modules/*"]
    }
  4. Configure

    Create a configuration file at the root of your repository. This may be either JavaScript or TypeScript.

    Refer to the full configuration documentation for more information.

    ./onerepo.config.js
    export default {
    root: true,
    };