Registry / devops / cp-cli

cp-cli

JSON →
library1.0.3jsnpmunverified

cp-cli is a Node.js CLI tool that replicates the UNIX cp command for cross-platform file and directory copying. Current stable version is 2.0.0, which exits with code 1 on error instead of 0 as in prior versions. It is a lightweight alternative to shell commands or more complex build tools, with no runtime dependencies after installation (only dev deps). Release cadence is irregular; the last release was v2.0.0 with a breaking change in exit code behavior.

npm install cp-cli
INSTALL
IMPORT
SIG · CP-CLI
C
cp-cli
devopsjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
#!/usr/bin/env node import cp from 'cp-cli';
const cp = require('cp-cli');
The package is an ESM module since v2.0.0. Use import instead of require.
cp
import cp from 'cp-cli';
import { cp } from 'cp-cli';
The package exports a default function, not a named export.
cli
npx cp-cli source target
npm run cp-cli -- source target
For CLI usage, install globally or use npx. Not a node require() use case.
dereference option
cp-cli -d source target
cp-cli --dereference source target
The -d flag enables dereferencing symlinks, but both forms work. Only listing -d as common shorthand.

Demonstrates global installation and common copy operations using cp-cli CLI.

# Install globally npm install -g cp-cli # Copy a file cp-cli foo.txt bar.txt # Copy file into directory cp-cli foo.txt dest/ # Using npx (no install) npx cp-cli source.txt target.txt
cp-cli --version
Debug
Known issues
breakingExit code changed from 0 to 1 on error in v2.0.0
fix
Update scripts that check exit codes: errors now return 1 instead of 0.
affects: >=2.0.0
gotchaDoes not support recursive copying by default; no -R option
fix
Use other tools like fs-extra or ncp for recursive directory copying.
affects: >=1.0.0
gotchaOnly copies a single file or into an existing directory; no glob or multiple sources
fix
Use bash cp or other tools like copyfiles for glob patterns.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cp-cli'
Package not installed locally or globally.
fix
Run 'npm install -g cp-cli' or use 'npx cp-cli'.
Usage: cp-cli [-d] source target
Missing source or target arguments.
fix
Provide both source and target file paths (e.g., 'cp-cli foo.txt bar.txt').
Error: ENOENT: no such file or directory
Source file does not exist.
fix
Check that the source path is correct and the file exists.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
Resources
cp-cli — npm install cp-cli · libregistry