{"id":18250,"library":"cp-cli","title":"cp-cli","description":"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.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/screendriver/cp-cli","tags":["javascript","cp","cp -R -L","copy"],"install":[{"cmd":"npm install cp-cli","lang":"bash","label":"npm"},{"cmd":"yarn add cp-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add cp-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is an ESM module since v2.0.0. Use import instead of require.","wrong":"const cp = require('cp-cli');","symbol":"default","correct":"#!/usr/bin/env node\nimport cp from 'cp-cli';"},{"note":"The package exports a default function, not a named export.","wrong":"import { cp } from 'cp-cli';","symbol":"cp","correct":"import cp from 'cp-cli';"},{"note":"For CLI usage, install globally or use npx. Not a node require() use case.","wrong":"npm run cp-cli -- source target","symbol":"cli","correct":"npx cp-cli source target"},{"note":"The -d flag enables dereferencing symlinks, but both forms work. Only listing -d as common shorthand.","wrong":"cp-cli --dereference source target","symbol":"dereference option","correct":"cp-cli -d source target"}],"quickstart":{"code":"# Install globally\nnpm install -g cp-cli\n\n# Copy a file\ncp-cli foo.txt bar.txt\n\n# Copy file into directory\ncp-cli foo.txt dest/\n\n# Using npx (no install)\nnpx cp-cli source.txt target.txt","lang":"javascript","description":"Demonstrates global installation and common copy operations using cp-cli CLI."},"warnings":[{"fix":"Update scripts that check exit codes: errors now return 1 instead of 0.","message":"Exit code changed from 0 to 1 on error in v2.0.0","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use other tools like fs-extra or ncp for recursive directory copying.","message":"Does not support recursive copying by default; no -R option","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use bash cp or other tools like copyfiles for glob patterns.","message":"Only copies a single file or into an existing directory; no glob or multiple sources","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'0':40 '1':35 '2.0.0':30 'altern':49 'behavior':83 'break':78 'build':56 'cadenc':68 'chang':79 'cli':3,6,10 'code':34,82 'command':17,52 'complex':55 'copi':25,89 'cp':2,5,16,85,86 'cp-cli':1,4 'cross':20 'cross-platform':19 'current':26 'dep':66 'depend':61 'dev':65 'directori':24 'error':37 'exit':32,81 'file':22 'instal':63 'instead':38 'irregular':70 'javascript':84 'l':88 'last':72 'lightweight':48 'node.js':9 'platform':21 'prior':43 'r':87 'releas':67,73 'replic':13 'runtim':60 'shell':51 'stabl':27 'tool':11,57 'unix':15 'v2.0.0':75 'version':28,44","created_at":"2026-04-25T07:37:15.206541+00:00","updated_at":"2026-04-25T07:37:15.206541+00:00","problems":[{"fix":"Run 'npm install -g cp-cli' or use 'npx cp-cli'.","cause":"Package not installed locally or globally.","error":"Error: Cannot find module 'cp-cli'"},{"fix":"Provide both source and target file paths (e.g., 'cp-cli foo.txt bar.txt').","cause":"Missing source or target arguments.","error":"Usage: cp-cli [-d] source target"},{"fix":"Check that the source path is correct and the file exists.","cause":"Source file does not exist.","error":"Error: ENOENT: no such file or directory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.3","cli_name":"cp-cli","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/screendriver/cp-cli","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/cp-cli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}