Skip to content

Add Auto-Switch Option to project:add Command #278

@butschster

Description

@butschster

Currently, when adding a new project to CTX, users must execute two separate commands:

# Step 1: Add the project
ctx project:add . --name=my-backend

# Step 2: Switch to the newly added project  
ctx project my-backend
# or
ctx project .

This creates unnecessary friction in a common workflow, especially for users who frequently add new projects and immediately want to start working with them.

Proposed Solution

Add an optional --current (or -c) flag to the project:add command that automatically switches to the newly added project after successful registration.

Usage Example

# Add project and automatically switch to it
ctx project:add . --name=my-backend --current

# Short form
ctx project:add . --name=my-backend -c

Expected Behavior

  1. Without --current flag (current behavior):

    • Add project to registry
    • Display success message
    • User remains on current project
  2. With --current flag (new behavior):

    • Add project to registry
    • Automatically switch to the newly added project
    • Display success message indicating both addition and switch
    • User is now working with the new project context

Metadata

Metadata

Assignees

No one assigned

    Labels

    mcpMCP server componentsmcp:projectsMCP projects

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions