From d2d5887936fccbde4c7404abc59a50213f5845ef Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 5 Dec 2024 18:44:50 -0800 Subject: [PATCH] feat: add clipboard watcher with --copypaste flag --- aider/args.py | 6 ++++++ aider/main.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/aider/args.py b/aider/args.py index 5e4b09f76..e123801a8 100644 --- a/aider/args.py +++ b/aider/args.py @@ -535,6 +535,12 @@ def get_parser(default_config_files, git_root): default=False, help="Enable/disable watching files for ai coding comments (default: False)", ) + group.add_argument( + "--copypaste", + action=argparse.BooleanOptionalAction, + default=False, + help="Enable/disable watching clipboard for changes (default: False)", + ) group = parser.add_argument_group("Fixing and committing") group.add_argument( "--lint", diff --git a/aider/main.py b/aider/main.py index 2bebed34c..5573b07e1 100644 --- a/aider/main.py +++ b/aider/main.py @@ -825,6 +825,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F file_watcher = FileWatcher(coder, gitignores=ignores, verbose=args.verbose) coder.file_watcher = file_watcher + if args.copypaste: + from aider.copypaste import ClipboardWatcher + clipboard_watcher = ClipboardWatcher(coder.io, verbose=args.verbose) + clipboard_watcher.start() + coder.show_announcements() if args.show_prompts: