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

@workglow/cli

v0.3.44

Published

Command-line interface example for Workglow, demonstrating how to build and run AI task pipelines from the terminal.

Downloads

3,177

Readme

Workglow CLI Example

A command-line interface for running Workglow AI tasks and workflows.

Overview

The Workglow CLI provides a terminal-based interface for creating, managing, and executing AI task pipelines. It features an interactive task runner with real-time progress visualization, making it easy to run AI workflows from the command line.

Features

  • Real-time Visualization: Live updates of task execution progress
  • Multi-Provider Support: Works with HuggingFace Transformers and TensorFlow MediaPipe
  • Local AI Models: Run AI models locally without external API calls
  • JSON Configuration: Define workflows using JSON configuration files

Getting Started

Prerequisites

  • Bun runtime (recommended) or Node.js 18+
  • Terminal with Unicode support for best experience

Installation

bun install @workglow/cli

Running

bun src/workglow.ts

Usage

Basic Commands

# Show help
workglow --help

# Run a simple text generation task
workglow generate --model "onnx:Xenova/LaMini-Flan-T5-783M:q8" "Write a story about a robot"

# Create an embedding from text
workglow embedding --model "onnx:Xenova/LaMini-Flan-T5-783M:q8" "Hello world"

Example Workflows

Text Generation

workglow generate \
  --text "The future of AI is" \
  --model "onnx:Xenova/LaMini-Flan-T5-783M:q8" \
  --max-length 100

Workflow from JSON

Create a workflow.json file:

[
  {
    "type": "ModelDownload",
    "config": {
      "model": ["onnx:Xenova/LaMini-Flan-T5-783M:q8"]
    }
  },
  {
    "type": "TextRewriter",
    "config": {
      "text": "The quick brown fox jumps over the lazy dog.",
      "prompt": "Rewrite this text to sound like a pirate:"
    }
  },
  {
    "type": "DebugLog",
    "config": {
      "log_level": "info"
    }
  }
]

Then run:

cat workflow.json | workglow json

Command Reference

Global Options

  • --version, -v: Show version information
  • --help, -h: Show help information

Commands

generate

Generate text using AI models.

workglow generate [options] <text>

Options:

  • --model, -m <model>: AI model to use
  • --max-length <length>: Maximum output length
  • --temperature <temp>: Sampling temperature (0.0-1.0)

Configuration

Model Configuration

The CLI automatically downloads and caches AI models. You can configure model settings:

Development

Project Structure

src/
├── workglow.ts              # Main CLI entry point
├── TaskCLI.ts             # CLI command definitions
├── TaskGraphToUI.ts       # Terminal UI components
├── components/            # Reusable CLI components
├── lib.ts                 # Library exports
└── worker_hft.ts          # HuggingFace worker

Adding New Commands

  1. Define the command in TaskCLI.ts:
program
  .command("my-command")
  .description("My custom command")
  .option("-t, --text <text>", "Input text")
  .action(async (options) => {
    // Command implementation
  });
  1. Implement the command logic using Workglow workflows:
const workflow = new Workflow();
workflow.MyCustomTask(options);
await workflow.run();

Available Models

HuggingFace Transformers (ONNX)

  • Text Generation:

    • onnx:Xenova/LaMini-Flan-T5-783M:q8
    • onnx:Xenova/distilgpt2:q8
  • Translation:

    • onnx:Xenova/m2m100_418M:q8
    • onnx:Xenova/opus-mt-en-de:q8
  • Classification:

    • onnx:Xenova/distilbert-base-uncased:q8
    • onnx:Xenova/roberta-base-sentiment:q8

TensorFlow MediaPipe

  • Text Embeddings:
    • mediapipe:universal-sentence-encoder

Performance

  • Model Caching: Models are cached after first download
  • Quantized Models: Use quantized models (q8) for better performance

Troubleshooting

Common Issues

  1. Model Download Failures:

    # Clear model cache
    rm -rf ~/.cache/
  2. Memory Issues:

    # Use smaller models or increase system memory
    workglow generate --model "onnx:Xenova/distilgpt2:q8"

Examples

Batch Processing

Process multiple files:

for file in *.txt; do
  workglow generate "$(cat $file)" > "${file%.txt}_generated.txt"
done

Pipeline Processing

Chain multiple operations:

# Generate text, then translate it
workglow generate --text "Write about AI" | \
workglow rewrite --prompt "Rewrite this text to sound like a pirate:"

License

Apache 2.0 - See LICENSE for details.