setup-pm

A setup command that selects the package manager—npm, pnpm, yarn, or Bun—for a project or for your whole environment.

In plain words
What is it for?
Use it to detect the current choice, set a project or global preference, list available managers, or override detection with an environment variable.
Why use it?
It removes guesswork when different projects use different JavaScript package managers and lock files.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/luohaothu/everything-codex/setup-pm
Clone the repo
git clone --depth 1 https://github.com/Luohaothu/everything-codex
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.00432
Opus 5 $0.00009 $0.00216
Sonnet 5 $0.00003 $0.00086
Haiku 4.5 $0.00002 $0.00043

Measured 2d ago against content hash 6961fe19e3ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-pm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/zh-CN/commands/setup-pm.md · 84 lines

What it actually says

包管理器设置

配置您为此项目或全局偏好的包管理器。

使用方式

# Detect current package manager
node scripts/setup-package-manager.js --detect

# Set global preference
node scripts/setup-package-manager.js --global pnpm

# Set project preference
node scripts/setup-package-manager.js --project bun

# List available package managers
node scripts/setup-package-manager.js --list

检测优先级

在确定使用哪个包管理器时,会按以下顺序检查:

  1. 环境变量CLAUDE_PACKAGE_MANAGER
  2. 项目配置.claude/package-manager.json
  3. package.jsonpackageManager 字段
  4. 锁文件:package-lock.json、yarn.lock、pnpm-lock.yaml 或 bun.lockb 的存在
  5. 全局配置~/.claude/package-manager.json
  6. 回退方案:第一个可用的包管理器 (pnpm > bun > yarn > npm)

配置文件

全局配置

// ~/.claude/package-manager.json
{
  "packageManager": "pnpm"
}

项目配置

// .claude/package-manager.json
{
  "packageManager": "bun"
}

package.json

{
  "packageManager": "[email protected]"
}

环境变量

设置 CLAUDE_PACKAGE_MANAGER 以覆盖所有其他检测方法:

# Windows (PowerShell)
$env:CLAUDE_PACKAGE_MANAGER = "pnpm"

# macOS/Linux
export CLAUDE_PACKAGE_MANAGER=pnpm

运行检测

要查看当前包管理器检测结果,请运行:

node scripts/setup-package-manager.js --detect
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 84 lines · 17 tokens per session scan A 6961fe19e3ec

Subscribe to this mod's changes

setup-pm is a command published in the GitHub repository Luohaothu/everything-codex (24 stars, last pushed 21d ago), licensed MIT. It adds 17 tokens to every session and 432 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.