scalp install
Install packages via npm, pnpm, yarn, or bun with optional policy enforcement and hash sync.
Installs packages using your package manager of choice. Without --guarded, it's a transparent passthrough that syncs hashes after install. With --guarded, it evaluates policy and trust scores before anything hits disk.
Usage
scalp install [flags] [--] [pm args...]Flags
| Flag | Default | Description |
|---|---|---|
--pm | auto-detected | Package manager: npm, pnpm, yarn, bun |
--policy | .scalp/policy.json | Path to policy file |
--guarded | false | Enforce policy and hash checks before install |
--ci | false | Force enforcement to block |
Passthrough mode
Without --guarded, SCAL-P runs the install, then hashes every installed package directory and saves to .scalp/lockfile.json:
scalp installBehind the scenes:
- Runs
npm install/pnpm install/yarn install/bun installwith your args - Gets the dependency tree via
npm ls --all --json(PM-specific equivalent) - Hashes each package directory with SHA-512 via
hash.Dir() - Saves to
.scalp/lockfile.json
This mode is useful for gradually adopting SCAL-P. You get the lockfile and audit capability without any enforcement.
Guarded mode
With --guarded, SCAL-P evaluates policy before running the install:
scalp install --guardedFlow:
- Load policy (from
.scalp/policy.jsonor defaults) - Resolve dependencies (lockfile-only, no install)
- Parse the lockfile
- Evaluate policy: allow/deny rules, transitive depth limits
- Evaluate trust scores (if
min_score > 0orrequire_hash) - If violations → apply enforcement (block, warn, or log)
- If no violations (or enforcement is warn/log) → run the actual install
- Hash each installed package → update
.scalp/lockfile.json
If enforcement is block and violations are found, the install never runs. No packages land
in node_modules.
Guarded install with a violation
scalp install --guardedPolicy denies lodash-free:
! policy violations detected
policy violations detected:
- lodash-free@1.0.0 (denylist: pattern:*-free)Guarded install passing
scalp install --guardedOn success, the command exits silently. On violations, the policy enforcement takes effect and blocks the install:
Passing arguments to the package manager
Use -- to separate SCAL-P flags from PM arguments:
scalp install --guarded -- --save-dev typescriptThis passes --save-dev typescript to the underlying package manager.
Override package manager
Auto-detection works for most projects. Override when needed:
scalp install --pm npm --guardedscalp install --pm pnpm --guardedscalp install --pm yarn --guardedscalp install --pm bun --guardedUsing with CI enforcement
scalp install --guarded --ci--ci forces on_violation to block regardless of what's in your policy.
Guarded by default
If you want all installs to be guarded without passing --guarded every time, set default_mode to guarded in your policy:
{
"version": 1,
"enforcement": {
"default_mode": "guarded"
}
}Now plain scalp install behaves like scalp install --guarded.