Skip to content

Add context-aware project commands #13

@theantichris

Description

@theantichris

🎯 Objective

Add smart commands that adapt to current project type for faster development workflow.

🎨 Current Workflow

# In Go project: go test ./...
# In Node project: npm test  
# In Python project: pytest
# Different commands for each project type

✨ Smart Workflow

cybtest    # Runs appropriate test command for current project
cybrun     # Runs appropriate dev/start command
cybbuild   # Runs appropriate build command

📋 Implementation

  • File: dot_oh-my-zsh/custom/themes/cyberwave.zsh-theme
  • Detection Logic:
    • Go: go.mod present → go test ./..., go run ., go build
    • Node: package.json present → npm test, npm run dev, npm run build
    • Python: requirements.txt or pyproject.tomlpytest, python main.py, pip install
    • Rust: Cargo.toml present → cargo test, cargo run, cargo build

🔧 Function Examples

cybtest() {
    if [[ -f go.mod ]]; then
        go test -v ./...
    elif [[ -f package.json ]]; then
        npm test
    elif [[ -f requirements.txt ]] || [[ -f pyproject.toml ]]; then
        pytest || python -m unittest discover
    else
        echo "No recognized project type for testing"
    fi
}

✅ Acceptance Criteria

  • Correct project type detection
  • Fallback behavior for unknown projects
  • Error messages for missing tools
  • Works across all platforms
  • Smart defaults for each project type

🔧 Estimated Effort

⭐⭐ Medium - 25 minutes implementation

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions