From bd95efb42c27ee5a1a242750dc827cb51b8ef1c1 Mon Sep 17 00:00:00 2001 From: Chris Krough <461869+ckrough@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:16:22 -0500 Subject: [PATCH] refactor: replace 'as' alias with 'agentspaces' in docs and output The 'as' command alias was removed, but documentation, help text, and error messages still referenced it. Updated all occurrences to use the full 'agentspaces' command name for consistency. Files updated: - CLI help text examples (workspace.py, agent.py, docs.py) - User-facing output messages (formatters.py) - Error messages (service.py, launcher.py) - Documentation (CONTRIBUTING.md, active.py docstring) - Test assertions (test_formatters.py) --- CONTRIBUTING.md | 10 ++-- src/agentspaces/cli/agent.py | 14 +++--- src/agentspaces/cli/docs.py | 18 +++---- src/agentspaces/cli/formatters.py | 4 +- src/agentspaces/cli/workspace.py | 50 ++++++++++---------- src/agentspaces/infrastructure/active.py | 2 +- src/agentspaces/modules/agent/launcher.py | 4 +- src/agentspaces/modules/workspace/service.py | 2 +- tests/unit/cli/test_formatters.py | 6 +-- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1c7357..47fd66a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ Always use `uv run` to execute commands: ```bash uv run agentspaces --help -uv run as workspace list +uv run agentspaces workspace list ``` ## Project Structure @@ -75,7 +75,7 @@ src/agentspaces/ ### Data Flow Example ``` -User runs: as workspace create main +User runs: agentspaces workspace create main 1. cli/workspace.py: create() command handler 2. modules/workspace/service.py: WorkspaceService.create() @@ -268,8 +268,8 @@ def new_command( \b Examples: - as workspace new-command foo - as workspace new-command bar --option + agentspaces workspace new-command foo + agentspaces workspace new-command bar --option """ try: result = _service.new_operation(arg) @@ -329,7 +329,7 @@ def info( \b Examples: - as workspace info eager-turing + agentspaces workspace info eager-turing """ try: metadata = _service.get_info(name) diff --git a/src/agentspaces/cli/agent.py b/src/agentspaces/cli/agent.py index 5893922..bf04410 100644 --- a/src/agentspaces/cli/agent.py +++ b/src/agentspaces/cli/agent.py @@ -63,10 +63,10 @@ def launch( \b Examples: - as agent launch eager-turing # Launch in specific workspace - as agent launch # Auto-detect from current directory - as agent launch -p "Fix auth bug" # With initial prompt - as agent launch --use-purpose # Use workspace purpose as prompt + agentspaces agent launch eager-turing # Launch in specific workspace + agentspaces agent launch # Auto-detect from current directory + agentspaces agent launch -p "Fix auth bug" # With initial prompt + agentspaces agent launch --use-purpose # Use workspace purpose as prompt """ # Validate mutually exclusive flags if use_purpose and prompt: @@ -82,7 +82,7 @@ def launch( if not workspace: print_error("--use-purpose requires a workspace name") print_info( - "Specify workspace: as agent launch --use-purpose" + "Specify workspace: agentspaces agent launch --use-purpose" ) raise typer.Exit(1) @@ -99,7 +99,7 @@ def launch( except WorkspaceNotFoundError: print_error(f"Workspace not found: {workspace}") _suggest_similar_workspaces(workspace) - print_info("Use 'as workspace list' to see available workspaces") + print_info("Use 'agentspaces workspace list' to see available workspaces") raise typer.Exit(1) from None except WorkspaceError as e: print_error(f"Could not read workspace: {e}") @@ -131,7 +131,7 @@ def launch( except WorkspaceNotFoundError: print_error(f"Workspace not found: {workspace}") _suggest_similar_workspaces(workspace) - print_info("Use 'as workspace list' to see available workspaces") + print_info("Use 'agentspaces workspace list' to see available workspaces") raise typer.Exit(1) from None except (AgentError, WorkspaceError) as e: diff --git a/src/agentspaces/cli/docs.py b/src/agentspaces/cli/docs.py index 65bd381..7ccfaa6 100644 --- a/src/agentspaces/cli/docs.py +++ b/src/agentspaces/cli/docs.py @@ -118,8 +118,8 @@ def list_templates( \b Examples: - as docs list # List all templates - as docs list -c planning # List only planning templates + agentspaces docs list # List all templates + agentspaces docs list -c planning # List only planning templates """ try: templates = list_design_templates() @@ -163,8 +163,8 @@ def info( \b Examples: - as docs info architecture # Show architecture template details - as docs info adr-template # Show ADR template details + agentspaces docs info architecture # Show architecture template details + agentspaces docs info adr-template # Show ADR template details """ try: template = get_design_template(template_name) @@ -205,9 +205,9 @@ def create( \b Examples: - as docs create architecture -n "MyApp" -d "A web app" - as docs create adr-template -o docs/decisions/ - as docs create development-standards --force + agentspaces docs create architecture -n "MyApp" -d "A web app" + agentspaces docs create adr-template -o docs/decisions/ + agentspaces docs create development-standards --force """ try: template = get_design_template(template_name) @@ -298,8 +298,8 @@ def scaffold( \b Examples: - as docs scaffold ./my-project -n "MyApp" -d "A web application" - as docs scaffold /tmp/new-proj -n "CLI Tool" -d "Command-line utility" -f + agentspaces docs scaffold ./my-project -n "MyApp" -d "A web application" + agentspaces docs scaffold /tmp/new-proj -n "CLI Tool" -d "Command-line utility" -f """ # Create target directory target = target.resolve() diff --git a/src/agentspaces/cli/formatters.py b/src/agentspaces/cli/formatters.py index 525f41d..d577593 100644 --- a/src/agentspaces/cli/formatters.py +++ b/src/agentspaces/cli/formatters.py @@ -121,8 +121,8 @@ def print_next_steps(workspace_name: str, workspace_path: str, has_venv: bool) - steps.append("source .venv/bin/activate") steps.extend( [ - "as agent launch", - f"as workspace remove {workspace_name}", + "agentspaces agent launch", + f"agentspaces workspace remove {workspace_name}", ] ) diff --git a/src/agentspaces/cli/workspace.py b/src/agentspaces/cli/workspace.py index ce07326..63bf3b9 100644 --- a/src/agentspaces/cli/workspace.py +++ b/src/agentspaces/cli/workspace.py @@ -65,10 +65,10 @@ def create( \b Examples: - as workspace create # From current HEAD - as workspace create main # From main branch - as workspace create -p "Fix auth bug" # With purpose - as workspace create --no-venv # Skip venv setup + agentspaces workspace create # From current HEAD + agentspaces workspace create main # From main branch + agentspaces workspace create -p "Fix auth bug" # With purpose + agentspaces workspace create --no-venv # Skip venv setup """ try: workspace = _service.create( @@ -116,10 +116,10 @@ def list_workspaces( \b Examples: - as workspace list # List workspaces for current repo - as workspace list -p myproject # List workspaces for specific project - as workspace list --sort created # Sort by creation date (newest first) - as workspace list -s branch # Sort by branch name + agentspaces workspace list # List workspaces for current repo + agentspaces workspace list -p myproject # List workspaces for specific project + agentspaces workspace list --sort created # Sort by creation date (newest first) + agentspaces workspace list -s branch # Sort by branch name """ # If no project specified, try to detect from current directory if project is None: @@ -169,9 +169,9 @@ def remove( \b Examples: - as workspace remove eager-turing # Remove with confirmation - as workspace remove eager-turing -y # Skip confirmation - as workspace remove eager-turing -f # Force remove dirty workspace + agentspaces workspace remove eager-turing # Remove with confirmation + agentspaces workspace remove eager-turing -y # Skip confirmation + agentspaces workspace remove eager-turing -f # Force remove dirty workspace """ # Check we're not removing the current worktree try: @@ -205,7 +205,7 @@ def remove( print_did_you_mean(suggestions) except WorkspaceError: pass # Don't fail on suggestion lookup - print_info("Use 'as workspace list' to see available workspaces") + print_info("Use 'agentspaces workspace list' to see available workspaces") raise typer.Exit(1) from None except WorkspaceError as e: print_error(str(e)) @@ -222,7 +222,7 @@ def _suggest_similar_workspaces(name: str) -> None: print_did_you_mean(suggestions) except WorkspaceError: pass # Don't fail on suggestion lookup - print_info("Use 'as workspace list' to see available workspaces") + print_info("Use 'agentspaces workspace list' to see available workspaces") @app.command("status") @@ -239,8 +239,8 @@ def status( \b Examples: - as workspace status # Status of active workspace - as workspace status eager-turing # Status of specific workspace + agentspaces workspace status # Status of active workspace + agentspaces workspace status eager-turing # Status of specific workspace """ # Determine which workspace to show if name is None: @@ -248,7 +248,7 @@ def status( if active is None: print_error("No workspace specified and no active workspace set.") print_info( - "Use 'as workspace status ' or 'as workspace activate '" + "Use 'agentspaces workspace status ' or 'agentspaces workspace activate '" ) raise typer.Exit(1) name = active.name @@ -289,12 +289,12 @@ def activate( """Set a workspace as the active workspace. The active workspace is used as the default for commands like - 'as agent launch' when no workspace is specified. + 'agentspaces agent launch' when no workspace is specified. \b Examples: - as workspace activate eager-turing # Set as active - as workspace current # Show current active + agentspaces workspace activate eager-turing # Set as active + agentspaces workspace current # Show current active """ try: _service.set_active(name) @@ -314,12 +314,12 @@ def current() -> None: """Show the currently active workspace. The active workspace is used as the default for commands like - 'as agent launch' when no workspace is specified. + 'agentspaces agent launch' when no workspace is specified. \b Examples: - as workspace current # Show active workspace - as workspace activate eager-turing # Set active workspace + agentspaces workspace current # Show active workspace + agentspaces workspace activate eager-turing # Set active workspace """ try: active = _service.get_active() @@ -329,7 +329,7 @@ def current() -> None: if active is None: print_info("No active workspace set.") - print_info("Use 'as workspace activate ' to set one.") + print_info("Use 'agentspaces workspace activate ' to set one.") raise typer.Exit(0) print_info(f"Active workspace: [cyan]{active.name}[/cyan]") @@ -350,8 +350,8 @@ def sync( \b Examples: - as workspace sync # Sync active workspace - as workspace sync eager-turing # Sync specific workspace + agentspaces workspace sync # Sync active workspace + agentspaces workspace sync eager-turing # Sync specific workspace """ try: workspace = _service.sync_deps(name) diff --git a/src/agentspaces/infrastructure/active.py b/src/agentspaces/infrastructure/active.py index 7a03b85..d0868c3 100644 --- a/src/agentspaces/infrastructure/active.py +++ b/src/agentspaces/infrastructure/active.py @@ -1,7 +1,7 @@ """Active workspace tracking. Manages the .active file that stores the currently active workspace -for a project. This enables the 'as agent launch' command to fall back +for a project. This enables the 'agentspaces agent launch' command to fall back to the active workspace when not inside a workspace directory. """ diff --git a/src/agentspaces/modules/agent/launcher.py b/src/agentspaces/modules/agent/launcher.py index 7f9d3bd..5f831fc 100644 --- a/src/agentspaces/modules/agent/launcher.py +++ b/src/agentspaces/modules/agent/launcher.py @@ -109,8 +109,8 @@ def launch_claude( raise AgentError( "No workspace specified, not in a workspace directory, " "and no active workspace set. " - "Use 'as agent launch ' or " - "'as workspace activate '." + "Use 'agentspaces agent launch ' or " + "'agentspaces workspace activate '." ) # Get workspace info to validate it exists and get path diff --git a/src/agentspaces/modules/workspace/service.py b/src/agentspaces/modules/workspace/service.py index 7ef248c..1d74e5c 100644 --- a/src/agentspaces/modules/workspace/service.py +++ b/src/agentspaces/modules/workspace/service.py @@ -483,7 +483,7 @@ def sync_deps( else: raise WorkspaceError( "No workspace specified and no active workspace. " - "Use 'as workspace sync ' or 'as workspace activate '." + "Use 'agentspaces workspace sync ' or 'agentspaces workspace activate '." ) workspace = self.get(name, cwd=cwd) diff --git a/tests/unit/cli/test_formatters.py b/tests/unit/cli/test_formatters.py index 5bceb1d..e481d9d 100644 --- a/tests/unit/cli/test_formatters.py +++ b/tests/unit/cli/test_formatters.py @@ -76,18 +76,18 @@ def test_excludes_venv_activation_when_no_venv(self) -> None: assert "source .venv/bin/activate" not in panel.renderable def test_includes_agent_launch(self) -> None: - """Should include as agent launch step.""" + """Should include agentspaces agent launch step.""" with patch("agentspaces.cli.formatters.console") as mock_console: print_next_steps("test-ws", "/path/to/workspace", has_venv=False) panel = mock_console.print.call_args[0][0] - assert "as agent launch" in panel.renderable + assert "agentspaces agent launch" in panel.renderable def test_includes_remove_step(self) -> None: """Should include workspace remove step with workspace name.""" with patch("agentspaces.cli.formatters.console") as mock_console: print_next_steps("test-ws", "/path/to/workspace", has_venv=False) panel = mock_console.print.call_args[0][0] - assert "as workspace remove test-ws" in panel.renderable + assert "agentspaces workspace remove test-ws" in panel.renderable def test_suppressed_in_quiet_mode(self) -> None: """Should not print when quiet mode is enabled."""