Cross-platform recursive file copying library that replicates Unix 'cp -R' command functionality
Agent Success
Agent success rate when using this tile
66%
Improvement
Agent success rate improvement when using this tile compared to baseline
1x
Baseline
Agent success rate without this tile
66%
A command-line tool that mirrors a source directory into a destination using a cross-platform recursive copy dependency, with options for cleanup, filtering, overwrite control, and post-copy verification.
--src pointing to a directory containing nested files and --dest pointing to a new path copies all files/directories, preserves relative paths, and exits with code 0. @test--overwrite is not provided, the CLI exits with code 1 and leaves the pre-existing file content unchanged. @test--delete-first is provided and the destination already contains differing files, the CLI removes the destination tree before copying, so outdated files are replaced by the source versions. @test--filter '\\.log$' excludes matching files from the copy while copying other files in the same directories, and the command succeeds with code 0. @test--verify, the CLI checks that every file it attempted to copy now exists at the destination; if any expected file is missing, it exits with code 1 and reports the missing path. @test@generates
export interface CopyOptions {
src: string;
dest: string;
filter?: RegExp | string;
deleteFirst?: boolean;
overwrite?: boolean;
verify?: boolean;
}
/**
* Executes a recursive copy according to the provided options.
* Resolves with the list of destination paths attempted or copied; rejects on any failure.
*/
export function runCopy(options: CopyOptions): Promise<string[]>;
/**
* CLI entry point. Parses argv, runs the copy, and sets process exit code accordingly.
*/
export function cli(argv: string[]): Promise<void>;Cross-platform recursive copy utility providing delete-first, overwrite, regex filter, and verification options.
@satisfied-by
tessl i tessl/npm-cpr@3.0.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10