Metadata-Version: 2.4
Name: mas-automation-cli
Version: 1.3.1
Summary: AI-powered test automation CLI for NetScaler Console (MAS/ADM)
Author: NetScaler Team
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Developers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0
Requires-Dist: colorama>=0.4.4
Requires-Dist: tabulate>=0.9.0
Requires-Dist: requests>=2.20.0
Requires-Dist: urllib3>=1.24.0
Requires-Dist: paramiko>=2.7.0
Requires-Dist: pexpect>=4.6.0
Requires-Dist: ipaddr>=2.2.0
Requires-Dist: setuptools>=40.0.0
Provides-Extra: ai
Requires-Dist: anthropic>=0.25.0; extra == "ai"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# mas-automation-cli

AI-powered test automation CLI for **NetScaler Console (MAS/ADM)** functional test cases.

Connects to **StarWars** (Citrix internal test case database), **Claude AI** (script generation),
and a live **MAS + VPX** lab environment — automating the entire
discover → generate → execute → report cycle.

---

## Install

```bash
# With AI support (recommended)
pip install "mas-automation-cli[ai]"

# Standard (no AI generation)
pip install mas-automation-cli
```

Requires Python 3.8+. For AI features, also set one of:
- `ANTHROPIC_API_KEY` — Anthropic direct API
- `ANTHROPIC_VERTEX_PROJECT_ID` — Google Cloud Vertex AI (Citrix employees: project `claude-code-citrix`)

---

## Quick start

```bash
# 1. First-time setup: MAS/VPX/SDK credentials + AI provider
mas-cli init

# 2. Verify everything is reachable (run every session)
mas-cli health-check

# 3. Preview what automate will do — safe, no files written
mas-cli automate 111.3 --dry-run

# 4. Generate + execute all missing test cases for a folder
mas-cli automate 111.3
```

---

## What mas-cli automate does

`mas-cli automate <folder>` runs a 7-step pipeline:

| Step | What happens |
|------|-------------|
| **Preflight** | Checks AI + StarWars MCP + Atlassian — blocks if any required service is down |
| **1. Infra config** | Interactive setup (skipped if already configured) |
| **2. Validate infra** | Pings MAS, VPX, SDK |
| **3. Agent + StarWars** | Fetches all TC IDs for the folder (automated + pending) |
| **3.5. Folder cleanup** | Moves stale legacy scripts to `BACKUP/` — runs even in dry-run |
| **4. Analyze** | Counts total / automated / broken / pending vs StarWars ground truth |
| **5. Generate** | Fetches procedures from StarWars → Claude generates Python test scripts |
| **6. Execute** | Runs all tests via `asterix.py` against live MAS lab |
| **7. Summary** | StarWars coverage breakdown + pass/fail counts |

Example summary output:

```
  --- StarWars (Source of Truth) ---
  Total TCs in folder:       899
    Automated in StarWars:   790  (have scripts in some system)
    Not automated anywhere:  109  (first-time automation targets)

  --- Coverage ---
  Before this run:           112/899  (12%)
  After  this run:           901/899  (100%)
  Added by mas-cli:          +789 script(s)
```

---

## Commands

| Command | Description |
|---------|-------------|
| `mas-cli init` | First-time setup: MAS/VPX/SDK + AI credentials |
| `mas-cli health-check` | 9-point tiered health check (5 core + 3 required + 1 advisory) |
| `mas-cli automate <prefix>` | Full AI pipeline: cleanup → StarWars → generate → execute → report |
| `mas-cli automate <prefix> --dry-run` | Preview only — cleanup runs, no files written |
| `mas-cli automate <prefix> --skip-generate` | Skip AI generation, run existing scripts + show coverage |
| `mas-cli automate <prefix> --skip-execute` | Generate scripts only, skip test execution |
| `mas-cli test <id>` | Run one test or all tests matching a prefix |
| `mas-cli suite <name>` | Run an entire STF suite |
| `mas-cli list-tests` | List all tests registered in the suite |
| `mas-cli config-show` | Show current config (passwords masked) |

---

## Health check tiers

```bash
mas-cli health-check
```

| Tier | Checks | Blocks if down |
|------|--------|----------------|
| **CORE** (5) | Framework, config, SDK, helper modules, OpenSSL | `mas-cli test` |
| **REQUIRED** (3) | AI (Claude API), StarWars MCP, Atlassian MCP | `mas-cli automate` |
| **ADVISORY** (1) | citrix-documentation MCP | Nothing — `[WARN]` only |

---

## Requirements

- Python 3.8+
- Access to a **NetScaler MAS** lab environment
- **StarWars MCP server** reachable (`10.146.91.151:8600`) — Citrix internal network / VPN
- **Claude AI**: Anthropic API key or Vertex AI credentials

---

## Links

- [GitHub repository](https://github.com/csg-netscaler/console_mas_automation)
- [Full setup and user guide](https://github.com/csg-netscaler/console_mas_automation#getting-started--setup-to-first-run)
- [Anthropic API keys](https://console.anthropic.com)

---

## License

Copyright 2026 NetScaler Team
