Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -329,7 +329,7 @@ def info(

\b
Examples:
as workspace info eager-turing
agentspaces workspace info eager-turing
"""
try:
metadata = _service.get_info(name)
Expand Down
14 changes: 7 additions & 7 deletions src/agentspaces/cli/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -82,7 +82,7 @@ def launch(
if not workspace:
print_error("--use-purpose requires a workspace name")
print_info(
"Specify workspace: as agent launch <workspace-name> --use-purpose"
"Specify workspace: agentspaces agent launch <workspace-name> --use-purpose"
)
raise typer.Exit(1)

Expand All @@ -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}")
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 9 additions & 9 deletions src/agentspaces/cli/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/agentspaces/cli/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
]
)

Expand Down
50 changes: 25 additions & 25 deletions src/agentspaces/cli/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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))
Expand All @@ -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")
Expand All @@ -239,16 +239,16 @@ 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:
active = _service.get_active()
if active is None:
print_error("No workspace specified and no active workspace set.")
print_info(
"Use 'as workspace status <name>' or 'as workspace activate <name>'"
"Use 'agentspaces workspace status <name>' or 'agentspaces workspace activate <name>'"
)
raise typer.Exit(1)
name = active.name
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -329,7 +329,7 @@ def current() -> None:

if active is None:
print_info("No active workspace set.")
print_info("Use 'as workspace activate <name>' to set one.")
print_info("Use 'agentspaces workspace activate <name>' to set one.")
raise typer.Exit(0)

print_info(f"Active workspace: [cyan]{active.name}[/cyan]")
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/agentspaces/infrastructure/active.py
Original file line number Diff line number Diff line change
@@ -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.
"""

Expand Down
4 changes: 2 additions & 2 deletions src/agentspaces/modules/agent/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <workspace-name>' or "
"'as workspace activate <workspace-name>'."
"Use 'agentspaces agent launch <workspace-name>' or "
"'agentspaces workspace activate <workspace-name>'."
)

# Get workspace info to validate it exists and get path
Expand Down
2 changes: 1 addition & 1 deletion src/agentspaces/modules/workspace/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def sync_deps(
else:
raise WorkspaceError(
"No workspace specified and no active workspace. "
"Use 'as workspace sync <name>' or 'as workspace activate <name>'."
"Use 'agentspaces workspace sync <name>' or 'agentspaces workspace activate <name>'."
)

workspace = self.get(name, cwd=cwd)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/cli/test_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down