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

@apparatus-technology/exec

v0.0.4

Published

Execute bash commands with regex filtering from YAML config shortcuts. Designed for LLM workflows to reduce token usage by filtering output.

Readme

Apparatus Exec

A powerful CLI tool that executes bash commands through predefined shortcuts and filters their output using regex patterns. Designed specifically for LLM-driven development workflows to reduce token usage by filtering out noise and showing only relevant output.

Features

  • LLM-Optimized Output - Filters out verbose logs and clutter to reduce token usage in AI conversations
  • Shortcuts - Execute command sequences with simple names
  • Regex Filtering - Filter command output using configurable regex patterns
  • Working Directory Support - Run commands in specific directories
  • Token Efficiency - Show only errors, warnings, and critical information to LLMs

Installation

Global Installation (Recommended)

npm install -g @apparatus-technology/exec

After installation, you can use the aex command anywhere:

aex --help

Local Development

git clone <repository>
cd apparatus-exec
bun install
bun run dev --help

Quick Start

1. Initialize Configuration

aex init

This creates an exec.config.yml file with predefined shortcuts and filter patterns.

2. Run a Shortcut

aex backend-build    # Clean and build .NET backend
aex git-status      # Show git status in short format
aex test-frontend   # Run frontend tests

3. List Available Shortcuts

aex nonexistent-shortcut  # Shows all available shortcuts

Configuration

The exec.config.yml file contains two main sections:

Shortcuts

Define command sequences that can be executed by name:

shortcuts:
  backend-build:
    commands:
      - dotnet clean
      - dotnet build
    description: Clean and build .NET backend solution
    working-dir: ./backend
    
  deploy:
    commands:
      - npm run build
      - docker build -t myapp .
      - docker push myapp
    description: Build and deploy application

Filters

Regex patterns to filter command output:

filters:
  - name: Error Messages
    pattern: (?i)error|exception|fail
    description: Captures error messages, exceptions, and failures
    
  - name: Build Errors
    pattern: error CS\d+:
    description: C# compiler errors

Pattern Templates

When initializing, choose from predefined pattern collections:

  • General - Common patterns (errors, warnings, IPs, URLs)
  • .NET Build Errors - C# compiler and MSBuild errors
  • TypeScript Build Errors - TypeScript compiler errors
  • JavaScript/Node.js Errors - Runtime errors and npm issues
  • Docker Errors - Container and image build failures
  • Git Operations - Git command errors and conflicts
  • Test Framework Errors - Test failures and coverage issues
  • Web Server Errors - HTTP errors and connection issues

Advanced Usage

Custom Configuration File

aex backend-build --config ./custom-config.yml

Multiple Commands in Shortcuts

Commands execute sequentially in the same working directory:

shortcuts:
  full-test:
    commands:
      - npm install      # Install dependencies
      - npm run lint     # Check code style  
      - npm test         # Run tests
      - npm run build    # Build for production
    working-dir: ./frontend

Working Directories

  • Relative paths: Resolved from current working directory
  • Absolute paths: Used as-is
  • No working-dir: Commands run in current directory

Examples

Development Workflow

# Initialize config with .NET and TypeScript patterns
aex init

# Clean and build backend
aex backend-build

# Run tests and see only failures
aex test-backend

# Check git status in short format  
aex git-status

Custom Shortcut Example

shortcuts:
  deploy-staging:
    commands:
      - git pull origin main
      - npm ci
      - npm run build
      - docker build -t myapp:staging .
      - docker push myapp:staging
      - kubectl apply -f k8s/staging/
    description: Deploy to staging environment
    working-dir: .

Output Filtering for LLMs

The primary goal is to reduce token usage when working with LLMs by filtering out verbose, irrelevant output. Only lines matching your configured regex patterns are displayed, dramatically reducing the amount of text sent to AI models.

Without filtering (high token usage):

$ dotnet build
MSBuild version 17.8.5+b5de88f09 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Apparatus.Exec -> D:\path\to\bin\Debug\net8.0\Apparatus.Exec.dll
  Build succeeded.
      0 Warning(s)
      0 Error(s)
  Time Elapsed 00:00:01.23

With filtering (low token usage):

$ aex backend-build
error CS1002: ; expected
error CS0103: The name 'variableName' does not exist
Build FAILED.
Done

This reduces tokens by 80-90% while preserving critical information for LLMs to understand and respond to issues.

Command Line Options

Usage: aex [options] [command] [shortcut]

Arguments:
  shortcut             Shortcut name to execute

Options:
  -V, --version        Output version number
  -c, --config <path>  Path to YAML config file (default: "exec.config.yml")
  --no-filter          Disable output filtering to see full command output
  -h, --help           Display help

Commands:
  init [options]       Initialize configuration file with pattern templates

Debugging Filters

Use --no-filter to see the complete output when adjusting your regex patterns:

# See full output to understand what to filter
aex backend-build --no-filter

# Then run with filtering to test your patterns
aex backend-build

Development

This project uses Bun for development and compiles to Node.js for distribution.

Development Commands

bun install           # Install dependencies
bun run dev          # Run with TypeScript directly
bun run build        # Compile for Node.js distribution
npm publish          # Publish to npm registry

License

MIT