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

@framers/agentos-ext-cli-executor

v1.1.0

Published

CLI executor extension for AgentOS - execute shell commands and manage files

Downloads

712

Readme

CLI Executor Extension for AgentOS

Execute shell commands, run scripts, and manage files for AgentOS agents. This is one of the two fundamental primitives (along with Web Browser) that enables recursive self-building agent capabilities.

Features

  • Shell Execution: Run any shell command with output capture
  • File Management: Read, write, and list files/directories
  • Security Controls: Dangerous command detection and blocking
  • Cross-Platform: Works on Windows, macOS, and Linux

Installation

npm install @framers/agentos-ext-cli-executor

Quick Start

import { createExtensionPack } from '@framers/agentos-ext-cli-executor';
import { ExtensionManager } from '@framers/agentos';

const extensionManager = new ExtensionManager();

// Register the CLI extension
extensionManager.register(createExtensionPack({
  options: {
    defaultShell: 'bash',
    timeout: 60000,
    blockedCommands: ['rm -rf /', 'format']
  },
  logger: console
}));

Tools

shellExecute

Execute a shell command.

const result = await gmi.executeTool('shellExecute', {
  command: 'npm install lodash',
  cwd: '/path/to/project',
  timeout: 30000
});
// Returns: { command, exitCode, stdout, stderr, duration, success }

fileRead

Read file contents.

const result = await gmi.executeTool('fileRead', {
  path: './package.json',
  encoding: 'utf-8'
});
// Returns: { path, content, size, truncated, encoding }

// Read last 50 lines
const logs = await gmi.executeTool('fileRead', {
  path: './app.log',
  lines: 50,
  fromEnd: true
});

fileWrite

Write content to a file.

const result = await gmi.executeTool('fileWrite', {
  path: './config.json',
  content: JSON.stringify({ key: 'value' }),
  createDirs: true
});
// Returns: { path, bytesWritten, created, appended }

listDirectory

List directory contents.

const result = await gmi.executeTool('listDirectory', {
  path: './src',
  recursive: true,
  pattern: '*.ts',
  includeStats: true
});
// Returns: { path, entries: [{ name, path, type, size, ... }], count }

Security

The extension includes built-in security controls:

Dangerous Pattern Detection

Commands matching these patterns are blocked by default:

  • rm -rf / (recursive delete root)
  • format C: (format drives)
  • Fork bombs
  • Direct disk writes
  • System shutdown/reboot commands

Custom Blocklists

createExtensionPack({
  options: {
    blockedCommands: ['sudo', 'su', 'chmod 777'],
    allowedCommands: ['npm', 'node', 'python', 'git'] // Whitelist mode
  }
});

Risk Assessment

Each command is assessed for risk level:

| Risk Level | Examples | |------------|----------| | safe | ls, cat, npm list | | low | echo "text" > file.txt | | medium | rm file.txt, eval | | high | sudo, curl | sh | | critical | rm -rf /, blocked patterns |

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | defaultShell | string | auto | Shell to use (bash, powershell, cmd, zsh) | | timeout | number | 60000 | Default timeout (ms) | | workingDirectory | string | process.cwd() | Default working directory | | allowedCommands | string[] | [] | Command whitelist (empty = all) | | blockedCommands | string[] | [...] | Command blacklist | | env | object | {} | Environment variables |

Use Cases

Code Generation and Execution

// Write generated code
await gmi.executeTool('fileWrite', {
  path: './generated/app.py',
  content: generatedPythonCode,
  createDirs: true
});

// Execute it
await gmi.executeTool('shellExecute', {
  command: 'python ./generated/app.py',
  timeout: 30000
});

Project Setup

// Create project structure
await gmi.executeTool('shellExecute', {
  command: 'npx create-react-app my-app --template typescript'
});

// Install dependencies
await gmi.executeTool('shellExecute', {
  command: 'npm install axios lodash',
  cwd: './my-app'
});

Log Analysis

// Read recent logs
const logs = await gmi.executeTool('fileRead', {
  path: '/var/log/app.log',
  lines: 100,
  fromEnd: true
});

// Parse and analyze
const errorCount = logs.output.content.match(/ERROR/g)?.length || 0;

The Two Primitives Theory

This extension, combined with the Web Browser extension, provides the two fundamental capabilities needed for a recursive self-building agent:

  1. CLI Executor (this extension)

    • Execute arbitrary code
    • Manage files
    • Install dependencies
    • Run tests and builds
  2. Web Browser (see web-browser extension)

    • Search for information
    • Read documentation
    • Learn new techniques
    • Verify implementations

Together, an intelligent agent can:

  1. Identify what it needs to learn → Web search
  2. Find documentation/tutorials → Web scraping
  3. Write code → File write
  4. Execute and test → Shell execute
  5. Debug and iterate → Repeat

License

MIT © Frame.dev