# AI Agentic Data Stack Framework - Testing Guide

## Basic CLI Commands

  # Test various commands directly
  node tools/cli.js --version

  node tools/cli.js --help

  node tools/cli.js info

  node tools/cli.js agents list

  node tools/cli.js agents show data-engineer

  node tools/cli.js templates list

  node tools/cli.js templates show data-contract-tmpl

  node tools/cli.js examples list

## Interactive Agent Testing

  # Test agent activation (will prompt for interactive input)
  echo "exit" | node tools/cli.js agent data-analyst
  echo "exit" | node tools/cli.js agent data-engineer  
  echo "exit" | node tools/cli.js agent data-product-manager
  echo "exit" | node tools/cli.js agent data-quality-engineer

  # Test interactive shell mode
  echo "exit" | node tools/cli.js interactive

## Workflow Testing

  # Test workflow execution (will prompt for confirmation)
  echo "n" | node tools/cli.js workflow analytics-workflow
  echo "n" | node tools/cli.js workflow community-analytics-workflow
  echo "n" | node tools/cli.js workflow data-ingestion-workflow

## Task Testing

  # Test individual task execution
  echo "n" | node tools/cli.js task analyze-data
  echo "n" | node tools/cli.js task build-pipeline

  # NPM Scripts

  ## Run the automated test suite
  npm test

  ## Run the CLI through npm start
  npm start -- --help
  npm start -- agents list

  ## Install Locally as Global Command

  ### Link the package globally (from project root)
  npm link

  ### Now you can use the CLI commands globally
  agentic-data --version
  agentic-data info
  agentic-data agents list
  agentic-data agents show data-analyst
  agentic-data templates list

  ### Test interactive features globally
  echo "exit" | agentic-data agent data-analyst
  echo "n" | agentic-data workflow community-analytics-workflow
  echo "exit" | agentic-data interactive

  ### Or use the alternative command name
  adsf-community --help

  ### When done testing, unlink
  npm unlink -g agentic-data-stack-community

  ## Test the Init Command (Interactive)

  ### Create a test directory
  mkdir test-project && cd test-project

  ### Run the init command
  node ../tools/cli.js init

  ### Follow the prompts to create a new project
  ### It will ask for:
  ### - Project name
  ### - Template choice (ecommerce/basic/custom)
  ### - Whether to include examples

  ## Test Error Handling

  ### Test invalid commands
  node tools/cli.js invalid-command

  ### Test missing arguments
  node tools/cli.js agents show

  ### Test non-existent resources
  node tools/cli.js agents show non-existent-agent
  node tools/cli.js templates show fake-template

  ## Test Validation Command

  ### Run validation on current directory
  node tools/cli.js validate

  ### Run validation on specific path
  node tools/cli.js validate --path ./examples/simple-ecommerce-analytics

  ## Install Example

  ### Create a test directory
  mkdir example-test && cd example-test

  ### Install an example
  node ../tools/cli.js examples install simple-ecommerce-analytics

  ## Quick Test Script

  ### You can create a quick test script to run all commands:

  #!/bin/bash
  # save as test-cli.sh

  echo "Testing CLI commands..."
  echo "====================="

  echo -e "\n1. Version:"
  node tools/cli.js --version

  echo -e "\n2. Help:"
  node tools/cli.js --help | head -20

  echo -e "\n3. Info:"
  node tools/cli.js info | head -15

  echo -e "\n4. Agents List:"
  node tools/cli.js agents list

  echo -e "\n5. Agent Details:"
  node tools/cli.js agents show data-engineer | head -15

  echo -e "\n6. Templates List:"
  node tools/cli.js templates list

  echo -e "\n7. Template Details:"
  node tools/cli.js templates show customer-segmentation | head -15

  echo -e "\n8. Examples List:"
  node tools/cli.js examples list

  echo -e "\n9. Interactive Agent Test:"
  echo "exit" | node tools/cli.js agent data-analyst | head -10

  echo -e "\n10. Workflow Test:"  
  echo "n" | node tools/cli.js workflow community-analytics-workflow | head -10

  echo -e "\n11. Error Handling:"
  node tools/cli.js invalid-command 2>&1 | head -5

  echo -e "\nAll tests completed!"

EOF

# Make executable and run
chmod +x test-cli.sh
./test-cli.sh
```

## Agent Command Testing

```bash
# Test all agent commands individually
echo "Testing Data Analyst (Sam) commands:"
echo "*analyze-data" | echo "*exit" | node tools/cli.js agent data-analyst
echo "*segment-customers" | echo "*exit" | node tools/cli.js agent data-analyst
echo "*create-dashboard" | echo "*exit" | node tools/cli.js agent data-analyst
echo "*define-metrics" | echo "*exit" | node tools/cli.js agent data-analyst

echo "Testing Data Engineer (Emma) commands:"  
echo "*build-pipeline" | echo "*exit" | node tools/cli.js agent data-engineer
echo "*setup-monitoring" | echo "*exit" | node tools/cli.js agent data-engineer
echo "*implement-quality-checks" | echo "*exit" | node tools/cli.js agent data-engineer
echo "*profile-data" | echo "*exit" | node tools/cli.js agent data-engineer

echo "Testing Data Product Manager (Alex) commands:"
echo "*gather-requirements" | echo "*exit" | node tools/cli.js agent data-product-manager
echo "*create-data-contract" | echo "*exit" | node tools/cli.js agent data-product-manager
echo "*define-metrics" | echo "*exit" | node tools/cli.js agent data-product-manager
echo "*map-business-value" | echo "*exit" | node tools/cli.js agent data-product-manager

echo "Testing Data Quality Engineer (Quinn) commands:"
echo "*validate-data-quality" | echo "*exit" | node tools/cli.js agent data-quality-engineer
echo "*profile-data" | echo "*exit" | node tools/cli.js agent data-quality-engineer
echo "*setup-quality-monitoring" | echo "*exit" | node tools/cli.js agent data-quality-engineer
```

## Performance Testing

```bash
# Test response times
echo "Testing CLI performance:"
time node tools/cli.js --version
time node tools/cli.js info
time node tools/cli.js agents list
time node tools/cli.js templates list

# Test agent activation performance
echo "Testing agent activation speed:"
time echo "*exit" | node tools/cli.js agent data-analyst
time echo "*exit" | node tools/cli.js agent data-engineer
```