CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-cpr

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%

Overview
Eval results
Files

task.mdevals/scenario-3/

Cross-Platform Copy CLI

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.

Capabilities

Recursive copy with exit codes

  • Running the CLI with --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
  • When a destination file already exists and --overwrite is not provided, the CLI exits with code 1 and leaves the pre-existing file content unchanged. @test

Delete-first synchronization

  • When --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

Filtered copy

  • Passing --filter '\\.log$' excludes matching files from the copy while copying other files in the same directories, and the command succeeds with code 0. @test

Post-copy verification

  • When run with --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

Implementation

@generates

API

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>;

Dependencies { .dependencies }

cpr { .dependency }

Cross-platform recursive copy utility providing delete-first, overwrite, regex filter, and verification options.

@satisfied-by

tessl i tessl/npm-cpr@3.0.0

tile.json