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

@whyuds/ask-user

v1.0.3

Published

A cross-platform command-line tool and MCP server to show dialog windows and get user input for AI code editors

Readme

AskUser

A cross-platform command-line tool that shows a dialog window to get user input. Works on Windows, macOS, and Linux.

Features

  • 🖥️ Cross-platform support (Windows, macOS, Linux)
  • 💬 Simple dialog window interface
  • ⌨️ Keyboard shortcuts (Enter to submit, ESC to cancel)
  • 🎨 Clean and modern UI
  • 📦 Easy to install via npm
  • 📝 Multi-line text input support
  • 🪟 Minimalist UI with no menu bar or window frame
  • 🖱️ Draggable title bar
  • ⚡ Ctrl+Enter shortcut for submitting input

Installation

Global Installation (Recommended)

npm install -g @whyuds/ask-user

MCP Server Support

AskUser can be used as an MCP (Model Context Protocol) server for AI code editors like Cursor, Windsurf, and Trae. This allows AI assistants to interact with users during code generation.

Quick MCP Setup

Add to your AI editor's MCP configuration:

{
  "mcpServers": {
    "ask-user": {
      "command": "npx",
      "args": ["-y", "ask-user-mcp"],
      "env": {}
    }
  }
}

For detailed MCP usage instructions, see MCP-USAGE.md.

Local Installation

npm install ask-user

Usage

Command Line

# Basic usage
ask --title "Question" --message "What is 1+1?"

# Short form
ask -t "Question" -m "What is 1+1?"

# Only title
ask --title "Please enter your name"

# Only message
ask --message "Enter your response:"

# No parameters (default dialog)
ask

# Multi-line input example
ask --title "Feedback" --message "Please provide your detailed feedback:"

User Interface

  • Multi-line input: The dialog supports multi-line text input in a resizable textarea
  • Submit: Click the "Submit" button or press Ctrl+Enter to submit your input
  • Cancel: Click the "Cancel" button, press Escape, or click the × button to cancel
  • Drag: Use the blue title bar to drag the window around

Programmatic Usage

const AskUser = require('ask-user');
const { app } = require('electron');

async function example() {
  const askUser = new AskUser();
  const result = await askUser.showDialog('Question', 'What is your name?');
  console.log('User input:', result);
  app.quit();
}

app.whenReady().then(example);

Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --title | -t | Dialog window title | "Please provide your input" | | --message | -m | Message to display | "Enter your response below:" | | --help | -h | Show help information | - | | --version | -V | Show version number | - |

Examples

Example 1: Simple Question

ask --title "Math Question" --message "What is 1+1?"

Example 2: User Information

ask --title "User Info" --message "Please enter your email address:"

Example 3: Confirmation

ask --title "Confirmation" --message "Are you sure you want to continue? (yes/no)"

Keyboard Shortcuts

  • Enter: Submit the input
  • ESC: Cancel and close the dialog
  • Tab: Navigate between elements

Output

The tool outputs the user's input to stdout. If the user cancels or closes the dialog, an empty string is returned.

$ ask -t "Name" -m "Enter your name:"
John Doe

$ ask -t "Cancelled" -m "This will be cancelled"
# User presses ESC or closes window
# (empty output)

Requirements

  • Node.js 14.0.0 or higher
  • npm or yarn

Platform Support

  • ✅ Windows 10/11
  • ✅ macOS 10.14+
  • ✅ Linux (Ubuntu, Debian, CentOS, etc.)

Development

Clone and Install

git clone https://github.com/whyuds/AskUser.git
cd AskUser
npm install

Test Locally

node bin/ask.js --title "Test" --message "Testing locally"

Publish to npm

# Login to npm (if not already logged in)
npm login

# Publish the package
npm publish

Test the Package

# Run the test script
node test.js

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Issues

If you encounter any issues, please report them on the GitHub Issues page.

Changelog

v1.0.0

  • Initial release
  • Cross-platform dialog support
  • Command-line interface
  • Keyboard shortcuts
  • Modern UI design