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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cosmah/flowspec-cli

v1.0.2

Published

FlowSpec CLI - Autonomous React test generation

Downloads

150

Readme

FlowSpec CLI

Autonomous React test generation powered by AI.

Installation

# Install globally
npm install -g @cosmah/flowspec-cli

Quick Start

# 1. Create account
flowspec register
# or
flowspec signup

# 2. Login (if you already have an account)
flowspec login

# 3. Initialize in your React project
cd my-react-app
flowspec init

# 4. Embed your codebase for AI context
flowspec embed

# 5. Generate tests automatically
flowspec watch

# Or generate for specific files
flowspec generate src/components/Button.tsx

Commands

Authentication

  • flowspec register - Create a new FlowSpec account
  • flowspec signup - Create a new FlowSpec account (alias)
  • flowspec login - Login to existing account
  • flowspec logout - Logout from FlowSpec

Project Management

  • flowspec init - Initialize FlowSpec in current project
  • flowspec embed - Embed codebase for AI context
  • flowspec status - Show project status and info

Test Generation

  • flowspec generate <files...> - Generate tests for specific files
  • flowspec watch - Watch for changes and auto-generate tests
  • flowspec dashboard - Open web dashboard

Utility

  • flowspec uninstall - Show uninstall instructions
  • flowspec --help - Show all commands
  • flowspec --version - Show version

Configuration

FlowSpec creates a .flowspec/config.json file in your project:

{
  "projectId": "proj_123",
  "userId": "user_456", 
  "name": "My App",
  "framework": "react",
  "apiUrl": "https://api.cosmah.me"
}

Environment Variables

  • FLOWSPEC_API_URL - API Server URL (default: https://api.cosmah.me)

Requirements

  • Node.js 16+
  • React/Vue/Svelte project with package.json
  • Vitest for test execution

How It Works

  1. Authentication: Secure JWT-based auth with FlowSpec cloud
  2. Project Initialization: Links your local project to FlowSpec cloud
  3. Code Embedding: Analyzes and uploads code context for AI
  4. Test Generation: AI generates comprehensive Vitest tests
  5. Self-Healing: Automatically fixes failing tests
  6. Dashboard: View results and analytics in web UI

Supported Frameworks

  • ✅ React (TypeScript/JavaScript)
  • 🚧 Vue (coming soon)
  • 🚧 Svelte (coming soon)

File Patterns

FlowSpec automatically detects and generates tests for:

  • src/**/*.{tsx,jsx} - React components
  • components/**/*.{tsx,jsx} - Component directories
  • lib/**/*.{tsx,jsx} - Library components

Files must:

  • Start with capital letter (PascalCase)
  • Export a React component
  • Not be test files (.test., .spec.)

Examples

Generate tests for a component

flowspec generate src/components/Button.tsx
# Creates: src/components/Button.test.tsx

Watch mode for automatic generation

flowspec watch
# Monitors file changes and generates tests automatically

Check project status

flowspec status
# Shows authentication, project info, and server connection

Troubleshooting

"Project not initialized"

Run flowspec init in your project root.

"Not logged in"

Run flowspec login or flowspec signup.

"Cannot connect to FlowSpec server"

Make sure the Brain Server is running on the configured URL.

"Vitest not found"

Install Vitest in your project:

npm install -D vitest @testing-library/react jsdom

Support

  • Documentation: https://docs.cosmah.me
  • Issues: https://github.com/cosmah/flowspec-cli/issues