npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-test-cli

v0.3.1

Published

An autonomous AI software testing engineer that dynamically generates, evaluates, and auto-fixes test suites for complex codebases.

Readme


🌟 Why AI Test CLI?

Most AI coding tools just vomit boilerplate code and give up when tests fail. AI Test CLI is different. It is the first fully autonomous, Zero-Config QA agent that reads the room before it writes code.

  1. Zero-Config Contextual Style RAG: Whether your team uses jest, vitest, mocha, or the native node:test runner, the CLI automatically searches your workspace for existing tests, silently feeds them to the LLM as context, and flawlessly mimics your exact in-house importing, mocking, and assertion styles. No configuration required.
  2. Agentic File Routing: Hate writing messy glob patterns in config files? Just add a plain-English instruction to .aitestrc.json (e.g., "Save tests in a 'test' subfolder right next to the source file"), and the AI will dynamically resolve and route the generated test files to the perfect directory.
  3. Autonomous Auto-Fixing (Self-Healing Loop): It actually runs the tests it writes. If they fail, it reads the error stack trace, maps it back to your source code, and dynamically applies patches until the pipeline turns green.
  4. Massive File Support: The Agentic Chunking Generator explores massive files function-by-function, incrementally building out coverage without blowing up LLM token limits.
  5. Bring Your Own Key (BYOK): Supports DeepSeek, OpenAI, Anthropic, Gemini, and Local Models (Ollama/LMStudio) via the Vercel AI SDK.

🚀 Quickstart

Install globally via npm:

npm install -g ai-test-cli

Initialize the configuration in your project root. This creates an .aitestrc.json file.

aitest init

Set your API key in your .env file, or set it in your environment:

# Depending on your chosen provider:
export DEEPSEEK_API_KEY="sk-..."
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-..."

🛠️ Usage

Auto-Fix Broken Tests (Self-Healing)

Got a test suite that's failing because of broken mocks or outdated logic? Unleash the agentic fixer:

aitest fix

The AI will run your entire test suite, isolate the failures, analyze the error stack traces, and patch the broken test file until it turns green. (Note: The CLI currently handles fixing one failing file per run).

Generate Tests

Generate a test suite for a single file:

aitest generate --file src/controllers/userController.ts

Generate tests for your entire project (this will gracefully skip files that already have tests or lack testable logic):

aitest generate --all

Iterative Coverage: Run aitest generate --coverage to automatically run a coverage report, identify files missing branch coverage, and have the AI rewrite them for 100% coverage!

Generate Global Mocks

Mocking external dependencies (like Stripe or AWS) by hand is incredibly tedious. Tell the AI to read your package.json and generate global __mocks__:

aitest mock --dependencies

Continuous Integration (GitHub Action)

You can automate your team's debugging by dropping ai-test-cli directly into your GitHub Actions! If a developer breaks a test in a Pull Request, the Action will autonomously fix it.

Create .github/workflows/ai-test-fix.yml:

name: AI Test Auto-Fix
on: [pull_request]

jobs:
  auto-fix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Dependencies
        run: npm install
      
      - name: Run AI Test CLI (Auto-Fix)
        uses: aitesthq/cli@main
        with:
          provider: 'deepseek'
          api_key: ${{ secrets.DEEPSEEK_API_KEY }}
          command: 'fix'
          
      - name: Create Pull Request with Fixes
        uses: peter-evans/create-pull-request@v6
        with:
          title: "🤖 AI Test CLI: Auto-fixed broken tests"
          commit-message: "chore: Auto-fixed broken tests via AI"

Advanced Optional Inputs

You can lock down the action with enterprise-grade settings to completely override the developers' local .aitestrc.json configuration during the CI run:

      - name: Run AI Test CLI (Auto-Fix)
        uses: aitesthq/cli@main
        with:
          provider: 'custom'
          api_key: 'not-needed-for-proxy'
          command: 'fix'
          model: 'gpt-4o'                           # Force a specific model in CI
          max_loops: '10'                           # Allow up to 10 files to be fixed automatically
          custom_headers: '{"X-Token": "${{ secrets.PROXY }}"}' # Safely inject secret headers

GitLab CI (.gitlab-ci.yml)

ai-test-fix:
  stage: test
  image: node:20
  script:
    - npm install
    - npm install -g ai-test-cli
    - aitest fix --ci
  variables:
    DEEPSEEK_API_KEY: $DEEPSEEK_API_KEY
  only:
    - merge_requests

Bitbucket Pipelines (bitbucket-pipelines.yml)

pipelines:
  pull-requests:
    '**':
      - step:
          name: AI Test Auto-Fix
          image: node:20
          script:
            - npm install
            - npm install -g ai-test-cli
            - aitest fix --ci

🎨 Now available for VS Code!

Prefer a beautiful graphical interface over the terminal? We just launched AI Test Studio for VS Code! It bundles the entire AI Test CLI engine into a stunning native sidebar with inline diff previews and 1-click test generation.

Download from VS Code Marketplace


📄 License

MIT License. See LICENSE for more information.