Skip to content

Feature request: add agent sub-command #650

Open
@zanminkian

Description

@zanminkian

Backgroud

@antfu/ni has an na command, which is agent alias. Running na install or na run build will detect and use the right package manager to execute the corresponding command.

  • na install ➡️ npm install / pnpm install / yarn install
  • na run build ➡️ npm run build / pnpm run build / yarn run build
  • na foo bar ➡️ npm foo bar / pnpm foo bar / yarn foo bar

Solution

It's good provide a sub-command named agent in corepack. So that we don't need @antfu/ni

  • corepack agent install ➡️ npm install / pnpm install / yarn install
  • corepack agent run build ➡️ npm run build / pnpm run build / yarn run build
  • corepack agent foo bar ➡️ npm foo bar / pnpm foo bar / yarn foo bar
  • ...

If there is no packageManager field in package.json, use npm by default.

Addintion

Providing a cpa command which is the alias of corepack agent will be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions