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

@tst-studio/tst

v0.2.0

Published

LLM-powered unit test generator CLI by TST-Studio

Downloads

5

Readme

About the Project

tst is a tool from TST-Studio that automatically generates unit tests for JavaScript and TypeScript code, helping developers maintain flow, reduce boilerplate, and improve test coverage. Built with TypeScript, Vitest, OCLIF, ts-morph, and LLMs (like OpenAI, Claude, etc).

Example

Math.ts

export function add(a: number, b: number): number {
  return a + b;
}

Generated test (math.test.ts):

import { describe, it, expect } from 'vitest';
import { add } from './math';

describe('add', () => {
  it('adds two numbers', () => {
    expect(add(2, 3)).toBe(5);
  });
});

Table of Contents

Tech Stack

  • Language: TypeScript
  • Test Runner: Vitest
  • CLI Framework: OCLIF
  • LLM Integration: OpenAI
  • AST Parsing: ts-morph

Features

  • Generate unit tests automatically from source files
  • Output structured, runnable Vitest test files
  • CLI interface for smooth developer workflow

Getting Started

You can use this tool in your own repositories.

Installation

$ npm install @tst-studio/tst

Configuration

Automatically add tst.config.json configuration file:

$ tst configure --outFormat=sameLocation
Wrote tst.config.json

Usage

Generate tests for a file

tst generate ./src/queue.js

This will submit the whole file to the LLM and create a test file in the appropriate location.

How to Contribute

Help us build the most seamless automated test generation tool possible.

Issues & PRs welcome!

  • Repo: https://github.com/TST-Studio/tst-cli
  • Issues: https://github.com/TST-Studio/tst-cli/issues

Before opening a PR:

  • Write tests where appropriate (or use this tool! 😀 )
  • Run npm run format:check && npm test.

Prerequisites

Ensure you have the following installed:

Tech Stack

Developing

The dev.js command is a development command that represents the tst command but will continue to compile Typescript on the fly while developing.

$ bin/dev.js
LLM-powered unit test generator CLI by TST-Studio

VERSION
  @tst-studio/tst/0.1.0 darwin-arm64 node-v22.17.1

USAGE
  $ tst [COMMAND]

TOPICS
  auth  Write API key to local .env or create one

COMMANDS
  configure  Create or update tst.config.json
  generate   Generate Vitest tests from a source file

To test outside of the tst-cli repo (e.g., to test against a different tsconfig.json file without breaking the tst command), use another repository like this sandbox repository:

https://github.com/TST-Studio/demo-test-script


Publish (maintainers only)

Use this checklist when cutting a new release to npm.

0) Prerequisites

  • [x] You are a maintainer for the @tst-studio org/package.
  • [x] Your npm account has 2FA enabled.
  • [x] You’re logged in: npm whoami (login with npm login if needed)

1) Branch is clean

Ensure:

  • All code is formatted consistently: npm run format
  • README.md is up to date
  • All code is committed

Ensure main is clean:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

Next steps may fail if main is not clean.

2) Prep the release

Verify the package contents

  1. Build the tst command:
npm run build
  1. Pack the tst command and inspect the tarball
npm pack
  1. View a publish dry run. Sanity check what is included:
npm publish --dry-run

3) Bump the version (SemVer)

This step updates package.json, creates a git tag (e.g., v0.1.1), and commits.

Determine if this is:

  • A patch (bug fix. No functionality changed)

  • A minor release (functionality was added)

  • A major release (backwards incompatible changes added)

  • Ensure main is clean (see step 1).

NOTE: The following instructions need to have single quotes (not double quotes) as they can include an exclamation mark (used by the "npm version" command). Without the single quotes, the exclamation mark can be interpreted as a history command by the shell.

If Patch

npm version patch -m 'chore(release): %s'

If Minor

npm version minor -m 'feat!: %s'

If Major

npm version major -m 'feat!: %s'

4) Publish to NPM

npm publish

5) Push tag and verify

git push --follow-tags
npm view @tst-studio/tst version

Common Pitfalls

  • EPUBLISHCONFLICT: That version already exists

  • E403 / not authorized to publish: You’re not a maintainer for @tst-studio/tst under the org; ask an admin to add you or your team.

  • 2FA errors: Provide --otp=(Your code) or re-enable 2FA on your account.

  • Wrong files in the tarball: Use .npmignore or files in package.json; re-run npm pack to confirm.


Documentation

Output Location

You can control where test files are generated using the outFormat option in tst.config.json.

  • sameLocation

    tst generate ./src/queue.js --outFormat=sameLocation

    Produces: ./src/queue.test.js

  • testDir

    tst generate ./src/queue.js --outFormat=testDir --outBaseSrc=./src --outBaseTest=./tests

    Produces: ./tests/queue.test.js


Configuration

tst expects a configuration file in your project root:

tst.config.json

Example:

{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "outFormat": "testDir",
  "outBaseSrc": "./src",
  "outBaseTest": "./tests",
  "astLibrary": "ts-morph",
  "testingFramework": "vitest",
  "moduleType": "module"
}
Fields
  • provider: "openai" (future: "anthropic", "vertex", "azure-openai", "bedrock", etc.)
  • model: "gpt-4o-mini" (future: "gpt-4o", "gpt-4.1", "gpt-4.1-mini")
  • outFormat: "sameLocation" | "testDir"
  • outBaseSrc: Root including src (used when outFormat is testDir)
  • outBaseTest: Root including tests (used when outFormat is testDir)
  • astLibrary: "ts-morph" (future: "babel")
  • testingFramework: "vitest" (future: "jest", etc.)
  • moduleType: "module" (future: "commonjs", etc.)

Commands

Configure

tst configure

Generates tst.config.json. You can also specify fields via flags:

tst configure --provider=openai --model=gpt-4o-mini --outFormat=testDir --outBaseSrc=./src --outBaseTest=./tests --astLibrary=ts-morph --testingFramework=vitest --moduleType=module

Generate

tst generate ./src/utils/math.js                  # Generate unit tests for an entire file
tst generate ./src/utils/math.js --function=add   # Generate unit tests for a specific function

Auth

tst auth set --provider=openai --api-key=$TST_OPENAI_API_KEY
  # Store API key for a specific provider
tst auth status
  # Show current authentication status

Other Commands

tst --help      # Display available commands and usage
tst --version   # Show the current CLI version

Environment Variables

export TST_OPENAI_API_KEY=sk-...

The API key is required to communicate with the LLM.


License

MIT (c) TST-Studio