From 17c2626f3903311aa69273ece86227e86f27734e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 27 Aug 2024 08:46:54 -0700 Subject: [PATCH] feat: Add --upgrade argument to upgrade aider to the latest version --- aider/args.py | 6 ++++++ aider/main.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/aider/args.py b/aider/args.py index f228bbfd2..b952f62ed 100644 --- a/aider/args.py +++ b/aider/args.py @@ -509,6 +509,12 @@ def get_parser(default_config_files, git_root): help="Install the latest version from the main branch", default=False, ) + group.add_argument( + "--upgrade", + action="store_true", + help="Upgrade aider to the latest version from PyPI", + default=False, + ) group.add_argument( "--apply", metavar="FILE", diff --git a/aider/main.py b/aider/main.py index 5bda6c520..bb837ef43 100644 --- a/aider/main.py +++ b/aider/main.py @@ -434,6 +434,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F success = install_from_main_branch(io) return 0 if success else 1 + if args.upgrade: + success = install_upgrade(io) + return 0 if success else 1 + if args.check_update: check_version(io, verbose=args.verbose)