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

@zhizuqiu/openshell

v1.2.8

Published

OpenShell CLI - Natural Language Command-Line Assistant

Downloads

2,554

Readme

English | 中文

OpenShell

🚀 OpenShell is a state-of-the-art AI-powered shell operations assistant terminal tool built with Ink and LangChain.

Interact with your system using natural language. No more memorizing complex commands—just ask and let the AI handle the heavy lifting with full Human-in-the-Loop safety.

✨ Key Features

  • 🤖 Natural Language Intelligence: Query system info ("How many processes are running?") or modify files ("Create a backup of config.yaml") with ease.
  • 📡 Robust Streaming UI: Experience real-time AI reasoning and output with a premium, flick-free terminal interface.
  • 🛡️ Human-in-the-Loop (HITL): Safety first. Sensitive operations (file modifications, system changes) require explicit user approval.
  • Autonomous Mode: Switch to "Auto-execute" with Ctrl+A for the AI to perform operations without interruptions (best for trusted environments).
  • 🧩 Deep Type Safety: Built with strict TypeScript and aligned with official LangChain/LangGraph schemas for maximum reliability.
  • ⌨️ Input Stability: Custom keyboard parser ensures no character loss, even during high-frequency streaming.
  • 🔍 Dynamic Command Execution: Supports cross-platform commands (bash/zsh on Unix, PowerShell/cmd on Windows).

📸 Demo

asciicast

🚀 Quick Start

Prerequisites

  • Node.js: >= 20.0.0 (required)

Note: OpenShell uses modern ESM modules and requires Node.js 20 or later. If you encounter SyntaxError: Unexpected token {, please upgrade Node.js.

Upgrade Node.js:

# Using nvm (recommended)
nvm install 20 && nvm use 20

# Using Homebrew (macOS)
brew install node@20

# Official installer
# https://nodejs.org/en/download/

Global Installation

npm install -g @zhizuqiu/openshell@latest
openshell

Local Development

git clone https://github.com/zhizuqiu/openshell.git
cd openshell/openshell
npm install
npm run build
npm start

⚙️ Configuration

OpenShell supports two configuration methods: Environment Variables and Configuration Files.

Environment Variables

| Variable | Required | Description | Default | | :----------------------- | :------- | :------------------------------------------- | :-------------------------- | | OPENAI_API_KEY | Yes | AI model API Key | - | | OPENAI_API_MODEL | No | Model name (e.g., qwen-max, gpt-4o) | gpt-4o | | OPENAI_BASE_URL | No | Custom provider endpoint | https://api.openai.com/v1 | | OPENSHELL_LANG | No | UI language (zh-CN or en-US) | en-US | | OPENSHELL_DEBUG | No | Enable debug mode (true or false) | false | | OPENSHELL_AUTO_EXECUTE | No | Enable auto-execute mode (true or false) | false | | OPENSHELL_SHOW_BANNER | No | Show startup banner (true or false) | true | | OPENSHELL_DB_PATH | No | SQLite database path for sessions | ~/.openshell/openshell.db |

Configuration File

OpenShell reads configuration from .env files in the following order (later files override earlier):

  1. ~/.config/openshell/.env (Global config, recommended)
  2. ./.env (Project-level config)

Setup:

# Create global config directory
mkdir -p ~/.config/openshell

# Create and edit config file
vim ~/.config/openshell/.env

Example:

# Required: AI model API Key
OPENAI_API_KEY=your-api-key-here

# Optional: Model name (default: gpt-4o)
OPENAI_API_MODEL=gpt-4o

# Optional: Custom API endpoint
OPENAI_BASE_URL=https://api.openai.com/v1

# Optional: UI language (zh-CN or en-US, default: en-US)
OPENSHELL_LANG=en-US

# Optional: Enable auto-execute mode (default: false)
OPENSHELL_AUTO_EXECUTE=false

# Optional: Enable debug mode (default: false)
OPENSHELL_DEBUG=false

🕹️ Controls

  • Enter: Send message
  • ! (at start): Enter Shell Mode (direct command execution)
  • Esc: Exit Shell Mode / Cancel current task
  • Ctrl+A: Toggle Autonomous Mode (Auto-execute)
  • Arrow Up/Down: Command history (separate for Agent/Shell modes)
  • Ctrl+C: Exit

🐚 Shell Mode

Press ! at the beginning of the input box to enter Shell Mode for direct command execution:

[Shell] > ls -la    # Press Enter to execute directly, no AI involved
[Shell] > git status
[Shell] > pwd
  • Enter: Execute command immediately
  • Esc or Backspace (at position 0): Exit Shell Mode back to Agent Mode
  • Command history is separate from Agent Mode
  • Auto-exits to Agent Mode after command execution

📄 License

MIT © zhizuqiu