Sakura Copy helps you quickly copy the contents of all open files (with full file paths) into a single new document. Designed for sharing code with AI tools or collaborators, it supports filtering secrets and irrelevant files so you can safely and efficiently pass along your codebase context.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Sakura Copy helps you quickly copy the contents of all open files (with full file paths) into a single new document. Designed for sharing code with AI tools or collaborators, it supports filtering secrets and irrelevant files so you can safely and efficiently pass along your codebase context.
Features
Copy to New File: Merges all open, non-empty files into a new untitled document.
Copy to Clipboard: Merges all content directly into your clipboard.
Secret Detection: Automatically detects and redacts secrets (like API keys and passwords) before copying. You can configure it to replace secrets with a placeholder or exclude files containing secrets entirely.
Customizable Paths: Choose to include full absolute paths, project-relative paths, or just filenames.
File Exclusion: Exclude files from being copied using glob patterns (e.g., *.log, **/node_modules/**).
Configurable Default: Set your preferred default copy behavior (new file or clipboard).
Commands
SakuraCopy: Copy Open Files: Copies open files based on your default setting.
SakuraCopy: Copy Open Files to Clipboard: Explicitly copies all open files to the clipboard.
SakuraCopy: Manage Secret Patterns: Opens a webview to interactively manage secret detection patterns.
SakuraCopy: Open Settings: Quickly access the extension's settings.
SakuraCopy: Reset Secret Patterns to Defaults: Resets secret detection patterns to their default values.
Extension Settings
This extension contributes the following settings:
SakuraCopy.defaultCopyBehaviour: Sets the default action for the Copy Open Files command (file or clipboard).
SakuraCopy.includePaths: Toggles whether to include file paths above the content (true or false).
SakuraCopy.pathStyle: Sets the path format when includePaths is enabled (full or relative).
SakuraCopy.excludePatterns: List of glob patterns for files to exclude from copying. Supports wildcards like *, **, and ?. Examples: *.log, **/node_modules/**, .env*.
SakuraCopy.secretDetection.enabled: Enable or disable automatic secret detection.
SakuraCopy.secretDetection.action: Choose what to do when a secret is found: replace it with a placeholder or exclude the entire file.
SakuraCopy.secretDetection.placeholder: The text that replaces a detected secret (e.g., XXXX-REDACTED-SECRET-XXXX).
SakuraCopy.secretDetection.patterns: Configure secret detection patterns. While you can edit the JSON in settings.json directly, we recommend using the SakuraCopy: Manage Secret Patterns command for a much easier experience.
SakuraCopy.secretDetection.contextLength: Number of characters to preserve before and after detected secrets when replacing (0 = replace entire match).