{"id":17893,"library":"recursive-copy-cli","title":"Recursive Copy CLI Tool","description":"This package provides a command-line interface (CLI) for the `recursive-copy` library, enabling robust and flexible file and directory copying operations directly from the terminal. As of April 2026, the current stable version is `1.0.20`, released in August 2021. The release cadence appears to be infrequent, primarily driven by dependency updates rather than new feature development, suggesting a stable but largely maintained project. Key differentiators of `recursive-copy-cli` include its support for advanced copying scenarios: filtering files using glob patterns or regular expressions, transforming file contents via external JavaScript modules, and renaming files based on custom patterns or logic provided by modules. It provides fine-grained control over recursive copying, offering options for overwriting existing files, expanding symbolic links, and explicitly including or excluding dotfiles and OS-specific junk files (e.g., `.DS_Store`, `Thumbs.db`), which distinguishes it from simpler `cp` commands by offering a programmatic and configurable approach to file synchronization and preparation tasks.","status":"maintenance","version":"1.0.20","language":"javascript","source_language":"en","source_url":"https://github.com/libinvarghese/recursive-copy-cli","tags":["javascript","cli","copy","recursive-copy","rename-files","transforming-files"],"install":[{"cmd":"npm install recursive-copy-cli","lang":"bash","label":"npm"},{"cmd":"yarn add recursive-copy-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add recursive-copy-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library for recursive file operations.","package":"recursive-copy","optional":false},{"reason":"Used for parsing command-line arguments and building the CLI interface.","package":"yargs","optional":false}],"imports":[{"note":"This package is a command-line interface (CLI) tool and is not intended for direct JavaScript/TypeScript import. It should be installed globally and executed from the terminal.","wrong":"import { recursiveCopy } from 'recursive-copy-cli'","symbol":"recursive-copy","correct":"npm install -g recursive-copy-cli"},{"note":"Transformation modules must be external JavaScript files that export a function returning a transform stream. The module path is provided as a CLI argument, not the function itself or inline code.","wrong":"recursive-copy src dest --transform-module { myTransformFunction }","symbol":"Transformation Module","correct":"recursive-copy src dest --transform-module ./my-transform-module.js"},{"note":"Similar to transformation modules, renaming functionality requires an external JavaScript file exporting a function that dictates the new path based on the original. Ensure the path is correct.","wrong":"recursive-copy src dest --rename-module myRenameFunction","symbol":"Renaming Module","correct":"recursive-copy src dest --rename-module ./my-rename-module.js"}],"quickstart":{"code":"npm install -g recursive-copy-cli\n\nmkdir source-files\necho \"Hello World\" > source-files/test.txt\necho \"hidden file\" > source-files/.gitignore\n\n# Basic copy, excluding dotfiles\nrecursive-copy source-files destination-folder\n\n# Copying with dotfiles and overwriting\nrecursive-copy source-files destination-folder --dot --overwrite\n\n# Example with transformation: converts content to uppercase\necho \"module.exports = (path) => require('through2')((chunk, enc, cb) => { cb(null, chunk.toString().toUpperCase()); });\" > uppercase-transform.js\nrecursive-copy source-files destination-folder --transform-module ./uppercase-transform.js --overwrite\n\ncat destination-folder/test.txt # Should output 'HELLO WORLD'\n","lang":"javascript","description":"Demonstrates global installation and basic usage, including copying with options and a simple content transformation using an external module."},"warnings":[{"fix":"While no new versions are available for this CLI, ensure your project's `npm` dependencies are regularly audited (`npm audit`). Consider using the underlying `recursive-copy` library directly if more up-to-date functionality or direct control is needed, or if security concerns arise.","message":"The package has not seen active development or new feature releases since August 2021. Its core dependencies, including `recursive-copy` and `yargs`, have received security updates in the interim. Using an older version might expose projects to known vulnerabilities.","severity":"gotcha","affected_versions":"<=1.0.20"},{"fix":"Test the CLI thoroughly in your target Node.js environment. If issues arise, consider isolating its usage to a container with a compatible Node.js version or exploring alternatives for recursive copying in modern Node.js environments.","message":"The `engines.node` field specifies `>=10.19.0`, which is a very old Node.js version. While the CLI might still function on newer Node.js runtimes (e.g., Node 18, 20), compatibility issues with underlying dependencies or new language features are not explicitly tested or guaranteed. Newer Node.js versions might exhibit unexpected behavior or performance regressions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always ensure paths to transformation/renaming modules are correct and accessible from the execution directory. For `--filter`, use valid glob patterns or regular expressions. Debug with `--debug` flag to see more verbose output.","message":"The `--filter`, `--transform-module`, and `--rename-module` options expect specific formats (glob/regex for filter, file paths for modules). Incorrect syntax or non-existent paths for module arguments will lead to silent failures or errors during execution, as the CLI will not be able to load or apply them.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Install the package globally using `npm install -g recursive-copy-cli`. If the issue persists, verify your system's PATH configuration to ensure npm's global bin directory is included.","cause":"The `recursive-copy-cli` package was not installed globally, or the global `node_modules` bin directory is not in your system's PATH.","error":"command not found: recursive-copy"},{"fix":"Ensure that any external modules specified with `--transform-module` or `--rename-module` have their own dependencies correctly installed (e.g., by running `npm install` in the directory of the external module) or are self-contained.","cause":"An external transformation or renaming module relies on a dependency (like 'through2') that is not installed in the context where the CLI is running or where the module is located.","error":"Error: Cannot find module 'through2' (or similar for other modules)"},{"fix":"Review the available options by running `recursive-copy --help`. Correct any typos or remove unsupported arguments.","cause":"You are attempting to use a command-line option that is not supported by `recursive-copy-cli` or has a typo.","error":"Error: Unknown argument: --some-unrecognized-option"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}