{"id":15288617,"url":"https://github.com/davestewart/spaceman","last_synced_at":"2025-04-13T06:32:09.402Z","repository":{"id":61078556,"uuid":"548146211","full_name":"davestewart/spaceman","owner":"davestewart","description":"Manage monorepo workspaces with a prompt-based CLI","archived":false,"fork":false,"pushed_at":"2023-03-16T10:20:45.000Z","size":1098,"stargazers_count":31,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T09:12:53.625Z","etag":null,"topics":["monorepo","npm","npm-workspaces","pnpm","turborepo","workspace-management","workspace-manager","yarn-workspaces"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davestewart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-09T02:04:52.000Z","updated_at":"2024-12-14T10:39:34.000Z","dependencies_parsed_at":"2024-11-15T03:29:42.507Z","dependency_job_id":"3dd75b88-8a25-472f-baab-a15fe646a55e","html_url":"https://github.com/davestewart/spaceman","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"7e1b74bea898628bd7914cde6b13fcd8f56b217e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fspaceman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fspaceman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fspaceman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fspaceman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davestewart","download_url":"https://codeload.github.com/davestewart/spaceman/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674659,"owners_count":21143760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monorepo","npm","npm-workspaces","pnpm","turborepo","workspace-management","workspace-manager","yarn-workspaces"],"created_at":"2024-09-30T15:51:21.422Z","updated_at":"2025-04-13T06:32:08.794Z","avatar_url":"https://github.com/davestewart.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Spaceman\n\n\u003e Manage monorepo workspaces with a prompt-based CLI\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/davestewart/spaceman/master/res/splash.png\" alt=\"Spaceman\"\u003e\n\u003c/p\u003e\n\n## Abstract\n\n[Monorepos](https://turbo.build/repo/docs/handbook/what-is-a-monorepo) provide a way to manage multiple self-contained applications and packages within a single codebase:\n\n```\n+- my-awesome-app\n    +- apps\n    |   +- backend\n    |   |   +- package.json\n    |   +- frontend\n    |   |   +- package.json\n    +- packages\n    |   +- tools\n    |   |   +- package.json\n    |   +- utils\n    |       +- package.json\n    + package.json\n```\n\n[Workspaces](https://turbo.build/repo/docs/handbook/workspaces) are the building blocks of monorepos, but require a certain amount of knowledge, configuration and terminal-fu for everyday tasks.\n\nSpaceman simplifies complex or multistep workspace tasks by presenting them as prompts, and batching commands on confirmation:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/davestewart/spaceman/master/res/spaceman.gif\" alt=\"Spaceman CLI\"\u003e\n\u003c/p\u003e\n\nWhy read the docs when you can just answer questions?\n\nSpaceman supports [NPM](https://docs.npmjs.com/cli/v8/using-npm/workspaces) and [Yarn](https://classic.yarnpkg.com/lang/en/docs/workspaces/) with support for [PNPM](https://pnpm.io/workspaces) coming in the next release. It also plays nice with monorepo tools such as [Turborepo](https://turborepo.org/), [Lerna](https://lerna.js.org/) and [Rush](https://rushjs.io/). \n\n## Overview\n\nThe following tasks are available:\n\n**Scripts**\n\n- [Run](#run)\u003cbr\u003e\n  Run any root or package script\n\n**Packages**\n\n- [Install](#install)\u003cbr\u003e\n  Install one or more packages to a workspace\n- [Uninstall](#uninstall)\u003cbr\u003e\n  Uninstall one or more packages from a workspace\n- [Update](#update)\u003cbr\u003e\n  Update one or more packages in a workspace\n- [Reset](#reset)\u003cbr\u003e\n  Remove all Node modules-related files in the root and all workspaces, and reinstall\n\n**Workspaces**\n\n- [Share](#share)\u003cbr\u003e\n  Make a workspace available for use within another workspace\n- [Group](#group)\u003cbr\u003e\n  Add a new top-level workspace group\n- [Add](#add)\u003cbr\u003e\n  Add a new workspace\n- [Remove](#remove)\u003cbr\u003e\n  Remove an existing workspace\n\n## Setup\n\nInstall the library via NPM:\n\n```bash\nnpm i spaceman --save-dev\n```\n\n## Usage\n\nRun the library by typing its name:\n\n```bash\nspaceman\n```\n\nYou should immediately see set of navigable tasks:\n\n```\n? 🚀 Task … \n  Scripts\n  ❯ run\n  Packages\n    install\n    uninstall\n    update\n    reset\n  Workspaces\n    share\n    group\n    add\n    remove\n```\n\nTo run a specific task, pass the task name as a second argument:\n\n```\nspaceman install\n```\n\nChoose a task to run it and view further options:\n\n```\n✔ 🚀 Task · install\n? Workspace … \n  apps\n  ❯ docs\n    web\n  packages\n    eslint-config-custom\n    tsconfig\n    ui\n```\n\nThe choices should be self-explanatory, but check the documentation below for more detail.\n\n# Tasks\n\n## Scripts\n\n### Run\n\nRun any root or package script:\n\n```\nScript              - type to filter scripts (use spaces for partial matching)\n```\n\nConfirming will run the selected script.\n\nSee [Configuration](#configuration) for additional options.\n\n## Packages\n\n### Install\n\nInstall one or more packages to a workspace:\n\n```\nWorkspace           - pick the target workspace to install to\nPackages            - type a space-separated list of packages to install\nDependency type     - pick one of normal, development, peer\n```\n\nConfirming will install the new packages.\n\n### Uninstall\n\nUninstall one or more packages from a workspace:\n\n```\nWorkspace           - pick the target workspace to uninstall from\nPackages            - pick one or more packages to uninstall\n```\n\nConfirming will remove the selected packages.\n\n### Update\n\nUpdate one or more packages in a workspace:\n\n```\nWorkspace           - pick the target workspace to update\nPackages            - type a space-separated list of packages to install\n```\n\nConfirming will update the selected packages.\n\n### Reset\n\nRemove all Node modules-related files in the root and all workspaces, and reinstall:\n\n```\nConfirm reset?      - confirm to reset root and workspaces\n```\n\nConfirming will:\n\n- remove all `lock` files\n- remove all `node_modules` folders\n- re-run `npm|pnpm|yarn install`\n\nRunning `reset` can get you out of tricky situations where workspace installs [fail](https://github.com/npm/cli/issues/3847) or your IDE reports that seemingly-installed workspaces aren't. \n\n## Workspaces\n\n### Share\n\nMake a workspace available for use within another workspace:\n\n```\nSource workspace    - pick the source workspace to share\nTarget workspace(s)  - pick the target workspace(s) to update\n```\n\nConfirming will:\n\n- set the source workspace as a dependency of the target workspace\n- run `npm|pnpm|yarn install`\n\n### Group\n\nAdd a new workspace group:\n\n```\nGroup name          - type a name for the new group\n```\n\nConfirming will:\n\n- create a new top-level folder\n- add it to the list of workspaces in `package.json`\n- ask if the user wants to [add](#add) a new workspace\n\n### Add\n\nAdd a new workspace:\n\n```\nWorkspace group     - pick the target workspace group\nWorkspace info\n - Workspace        - add name, optional description and `main` file\n - Dependencies     - add optional dependencies\n - Scripts          - add optional scripts\n```\n\nConfirming will:\n\n- create a new workspace folder\n- create a private package file\n- create a stub `\"main\": \"index.ts/js\"` file with named export\n- optionally install dependencies\n\n### Remove\n\nRemove an existing workspace:\n\n```\nWorkspace           - pick the target workspace\nType to confirm     - type the name of the workspace to confirm deletion\n```\n\nConfirming will:\n\n- remove the dependency from other workspaces\n- uninstall workspace dependencies \n- remove the workspace folder\n- optionally update the `workspaces` list\n\n\n## Configuration\n\nSome of Spaceman's tasks can be configured.\n\nTo do this, add a `spaceman` section to your `package.json` and include the relevant sections:\n\n```json5\n{\n  \"spaceman\": {\n    \"scripts\": {\n      // regexp to exclude scripts from `run` list, e.g. scripts that start with ~\n      \"exclude\": \"^~\",\n      \n      // autocomplete match algorithm; choose between \"tight\" (default) or \"loose\" \n      \"match\": \"loose\",\n    }\n  }\n}\n```\n\nSome information on the `script.match` types:\n\n- `tight`: matches on sequential characters, use spaces to start new match groups, i.e. `cli dev`\n- `loose`: matches on any character, i.e. `clde`\n\n## Finally...\n\nIf you like the package, a [tweet](https://twitter.com/intent/tweet?text=🧑‍🚀%20Spaceman%20is%20a%20new%20package%20by%20%40dave_stewart%20to%20easily%20manage%20NPM%20and%20Yarn%20monorepo%20tasks%20via%20a%20prompt-based%20CLI%20🚀%0A%0Ahttps%3A//github.com/davestewart/spaceman%0A%0A%23javascript%20%23node%20%23monorepo) is always helpful; be sure to let me know via [@dave_stewart](https://twitter.com/dave_stewart).\n\nThanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavestewart%2Fspaceman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavestewart%2Fspaceman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavestewart%2Fspaceman/lists"}