diff --git a/README.md b/README.md index 6976b3c..3190c7c 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ veet # Launch TUI veet open # Open a problem in $EDITOR (vim) veet open two-sum # Open specific problem veet list # List all problems +veet update # Update to latest version veet install-commands # Install Claude slash commands cd $(veet problems-dir) # cd to problems folder ``` diff --git a/install.sh b/install.sh index b43c8eb..580e963 100755 --- a/install.sh +++ b/install.sh @@ -47,6 +47,7 @@ echo "Commands:" echo " veet Launch TUI" echo " veet open Open problem in \$EDITOR" echo " veet list List all problems" +echo " veet update Update to latest version" echo " cd \$(veet problems-dir) Navigate to problems" echo "" echo "Claude slash commands:" diff --git a/veetcode/cli.py b/veetcode/cli.py index dbc7b49..4190d84 100644 --- a/veetcode/cli.py +++ b/veetcode/cli.py @@ -163,5 +163,43 @@ def problems_dir() -> None: typer.echo(repo / "problems") +@app.command() +def update() -> None: + """Update veetcode to the latest version.""" + import subprocess + + repo = find_repo_root() + typer.echo(f"Updating veetcode in {repo}...") + + # Git pull + result = subprocess.run( + ["git", "pull"], + cwd=repo, + capture_output=True, + text=True + ) + + if result.returncode != 0: + typer.echo(f"Git pull failed: {result.stderr}") + raise typer.Exit(1) + + typer.echo(result.stdout.strip()) + + # Sync dependencies + typer.echo("Syncing dependencies...") + result = subprocess.run( + ["uv", "sync"], + cwd=repo, + capture_output=True, + text=True + ) + + if result.returncode != 0: + typer.echo(f"uv sync failed: {result.stderr}") + raise typer.Exit(1) + + typer.echo("✓ veetcode updated!") + + if __name__ == "__main__": app()