# cpy-cli

> Copy files

Latest version **7.0.0** (published 2026-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install cpy-cli
pnpm add cpy-cli
yarn add cpy-cli
bun add cpy-cli
```

Provides the command `cpy`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2026-02-05 |
| First published | 2016-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 3 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 359 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | cli-app, cli, copy, cp, cpy, file, files, clone, fs, stream, glob, file-system, ncp, fast, quick, data, content, contents |

## Links

- npm: https://www.npmjs.com/package/cpy-cli
- Repository: https://github.com/sindresorhus/cpy-cli
- Homepage: https://github.com/sindresorhus/cpy-cli#readme
- Issues: https://github.com/sindresorhus/cpy-cli/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/cpy-cli

## Dependencies (3)

- [cpy](https://npm.io/package/cpy.md) ^13.2.0
- [meow](https://npm.io/package/meow.md) ^14.0.0
- [globby](https://npm.io/package/globby.md) ^16.1.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 7.0.0 (latest) — 2026-02-05
- 6.0.0 — 2025-08-13
- 5.0.0 — 2023-06-28
- 4.2.0 — 2022-08-23
- 4.1.0 — 2022-03-11
- 4.0.0 — 2022-03-01
- 3.1.1 — 2020-05-04
- 3.1.0 — 2020-02-13
- 3.0.0 — 2019-12-06
- 2.0.0 — 2018-05-25
- 1.0.1 — 2016-05-19
- 1.0.0 — 2016-01-03

## README

# cpy-cli

> Copy files

## Why

- Fast by using streams.
- Resilient by using [graceful-fs](https://github.com/isaacs/node-graceful-fs).
- User-friendly by accepting [globs](https://github.com/sindresorhus/globby#globbing-patterns) and creating non-existent destination directories.
- User-friendly error messages.

## Install

```sh
npm install --global cpy-cli
```

## Usage

```
$ cpy --help

  Usage
    $ cpy <source …> <destination>

  Options
    --no-overwrite       Don't overwrite the destination
    --ignore-existing    Skip files that already exist at the destination
    --update             Only overwrite if the source is newer, or if sizes differ with the same modification time
    --cwd=<dir>          Working directory for files
    --base=<mode>        Base mode for destination paths: cwd or pattern
    --rename=<filename>  Rename all <source> filenames to <filename>. Supports string templates.
    --dot                Allow patterns to match entries that begin with a period (.)
    --flat               Flatten directory structure. All copied files will be put in the same directory.
    --dry-run            List files that would be copied without actually copying
    --concurrency        Number of files being copied concurrently

  <source> can contain globs if quoted

  Errors if no files match, similar to cp.

  --update is ignored when --no-overwrite or --ignore-existing is set.

  If the source is a single file and the destination is not an existing directory, it will be treated as a file-to-file copy (like cp).

  Examples
    Copy all .png files in src folder into dist except src/goat.png
    $ cpy 'src/*.png' '!src/goat.png' dist

    Copy all files inside src folder into dist and preserve path structure
    $ cpy . '../dist/' --cwd=src

    Copy a single file to a specific filename
    $ cpy .env.development .env

    Copy all .png files in the src folder to dist and prefix the image filenames
    $ cpy 'src/*.png' dist --cwd=src --rename=hi-{{basename}}

    Copy only when the source is newer, or if sizes differ with the same modification time
    $ cpy src dist --update
```

## Related

- [cpy](https://github.com/sindresorhus/cpy) - API for this package

---
_Source: https://npm.io/package/cpy-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
