An open API service indexing awesome lists of open source software.

https://github.com/moinsen-dev/testronaut

Testronaut is an AI-powered, containerized framework for end-to-end testing of CLI tools. It analyzes commands, generates test plans, verifies outputs semantically with LLMs, and runs everything safely in Docker.
https://github.com/moinsen-dev/testronaut

ai cli docker llm python3 test-automation testing-tools

Last synced: 10 months ago
JSON representation

Testronaut is an AI-powered, containerized framework for end-to-end testing of CLI tools. It analyzes commands, generates test plans, verifies outputs semantically with LLMs, and runs everything safely in Docker.

Awesome Lists containing this project

README

          

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Version](https://img.shields.io/badge/version-0.5.0-blue.svg)](https://github.com/your-username/testronaut)
[![Code Coverage](https://img.shields.io/badge/coverage-72%25-yellow.svg)](https://github.com/your-username/testronaut)
[![CI Status](https://img.shields.io/github/actions/workflow/status/your-username/testronaut/main.yml?label=CI)](https://github.com/your-username/testronaut/actions/workflows/main.yml)
[![Documentation Status](https://img.shields.io/github/actions/workflow/status/your-username/testronaut/docs.yml?label=docs)](https://github.com/your-username/testronaut/actions/workflows/docs.yml)
[![Security Status](https://img.shields.io/github/actions/workflow/status/your-username/testronaut/security.yml?label=security)](https://github.com/your-username/testronaut/actions/workflows/security.yml)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/your-username/testronaut/issues)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/your-username/testronaut/graphs/commit-activity)
[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://github.com/your-username/testronaut/discussions)

# Testronaut ๐Ÿš€


Testronaut Logo

AI-powered testing for CLI tools - from analysis to execution


Testronaut is an AI-powered framework that revolutionizes CLI testing by automatically analyzing command-line tools, generating comprehensive test plans, and executing them with intelligent result verification.

## ๐ŸŒŸ What's New in v0.5.0

- โœจ **Test Plan Generation**: Automatically generate test plans from analyzed CLI tools
- ๐Ÿš€ **Test Execution**: Execute test plans locally with detailed result reporting
- ๐Ÿ“Š **Smart Analysis**: Enhanced CLI analysis with better command discovery
- ๐ŸŽฏ **End-to-End Workflow**: Complete pipeline from analysis to test execution

## ๐ŸŽฌ Quick Demo

```bash
# Analyze a CLI tool
$ testronaut analyze git
โœ“ Found 27 commands in git

# Generate a test plan
$ testronaut generate plan git --output git_tests.json
โœ“ Generated 54 test cases

# Execute the tests
$ testronaut execute plan git_tests.json
โœ“ Executing 54 tests...
โœ“ 21 passed, 33 failed (commands need proper setup)
```

## ๐Ÿš€ Key Features

### ๐Ÿ” Intelligent CLI Analysis
- Automatically discovers commands and subcommands
- Extracts options, arguments, and help text
- Handles complex command hierarchies
- LLM-enhanced parsing for challenging formats

### ๐Ÿงช Smart Test Generation
- Creates comprehensive test plans automatically
- Generates both positive and negative test cases
- Produces executable pytest files
- Covers help commands, basic usage, and edge cases

### โšก Automated Test Execution
- Runs tests in isolated environments
- Captures stdout, stderr, and exit codes
- Provides detailed failure reports
- Supports timeout configuration

### ๐Ÿค– AI-Powered Verification (Coming Soon)
- Semantic comparison of outputs
- Handles dynamic content gracefully
- Reduces false positives
- Supports multiple LLM providers

## ๐Ÿ“ฆ Installation

### Development Setup

We use [uv](https://github.com/astral-sh/uv) for fast, reliable Python packaging:

```bash
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and setup
git clone https://github.com/yourusername/testronaut.git
cd testronaut
./setup.sh

# Activate environment
source .venv/bin/activate
```

### Quick Start

```bash
# Configure your LLM provider (optional for basic features)
testronaut config set-key openai YOUR_API_KEY

# Analyze a CLI tool
testronaut analyze npm

# Generate a test plan
testronaut generate plan npm --output npm_tests.json

# Execute the tests
testronaut execute plan npm_tests.json

# View analyzed tools
testronaut generate list
```

## ๐Ÿ› ๏ธ Usage Examples

### Analyze Popular CLI Tools

```bash
# Analyze git
testronaut analyze git

# Analyze with enhanced LLM parsing
testronaut analyze kubectl --enhanced

# Interactive browser for results
testronaut analyze browser
```

### Generate Test Plans

```bash
# Generate JSON test plan
testronaut generate plan docker --output docker_tests.json

# Generate pytest file too
testronaut generate plan npm --pytest tests/test_npm.py

# List all analyzed tools
testronaut generate list
```

### Execute Tests

```bash
# Execute test plan
testronaut execute plan my_tests.json

# Custom timeout (seconds)
testronaut execute plan my_tests.json --timeout 10

# Save results to specific directory
testronaut execute plan my_tests.json --output results/
```

## ๐Ÿ—๏ธ Architecture


Testronaut Architecture

Testronaut consists of five main components:

1. **CLI Analyzer**: Parses and understands command structure
2. **Test Generator**: Creates comprehensive test plans
3. **Test Executor**: Runs tests in isolated environments
4. **Result Verifier**: Compares expected vs actual results
5. **LLM Integration**: Enhances analysis and verification

## ๐Ÿงช Project Status

| Phase | Component | Status | Progress |
|-------|-----------|--------|----------|
| 004 | CLI Analysis Engine | โœ… Completed | 100% |
| 005 | Test Plan Generator | โœ… Completed | 100% |
| 006 | Test Executor (Local) | โœ… Completed | 100% |
| 007 | Docker Execution | ๐Ÿšง In Progress | 20% |
| 008 | AI Result Verification | ๐Ÿ“‹ Planned | 0% |
| 009 | Reporting System | ๐Ÿ“‹ Planned | 0% |

## ๐Ÿค Contributing

We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

### Development Workflow

```bash
# Run tests
uv run pytest

# Check code quality
ruff check .
ruff format .

# Type checking
mypy src/testronaut

# Run all checks
pre-commit run --all-files
```

## ๐Ÿ“Š Roadmap

### Near Term (v0.6.0)
- [ ] Docker-based test execution
- [ ] Basic semantic verification
- [ ] HTML test reports
- [ ] Test retry mechanisms

### Medium Term (v0.7.0)
- [ ] Advanced LLM verification
- [ ] Parallel test execution
- [ ] CI/CD integration helpers
- [ ] Test coverage analysis

### Long Term (v1.0.0)
- [ ] Multi-language CLI support
- [ ] Distributed test execution
- [ ] Custom test generators
- [ ] Enterprise features

## ๐Ÿ“š Documentation

Full documentation is available at our [documentation site](https://your-username.github.io/testronaut/).

- [Installation Guide](docs/guides/installation.md)
- [Quick Start Tutorial](docs/guides/quickstart.md)
- [Architecture Overview](docs/api/overview.md)
- [CLI Reference](docs/reference/cli.md)

## ๐Ÿ™ Acknowledgments

- Built with [Typer](https://typer.tiangolo.com/) for the CLI
- Uses [Rich](https://rich.readthedocs.io/) for beautiful terminal output
- Powered by [SQLModel](https://sqlmodel.tiangolo.com/) for data persistence
- Package management by [uv](https://github.com/astral-sh/uv)

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---


Made with โค๏ธ by the Testronaut team



Report Bug
ยท
Request Feature
ยท
Join Discussion