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

@ellie-ai/agent-fs-tools-plugin

v0.2.0

Published

File system and command execution tools for Ellie agents

Readme

@ellie-ai/agent-fs-tools-plugin

File system and command execution tools for Ellie agents.

Overview

This plugin provides agents with the ability to:

  • Read files - Read file contents in UTF-8 or base64 encoding
  • Write files - Create or overwrite files with content
  • Edit files - Make precise string replacements in files
  • Execute commands - Run shell commands via bash
  • Find files - Use glob patterns to locate files
  • Search content - Search file contents with regex patterns

Installation

bun add @ellie-ai/agent-fs-tools-plugin

Usage

import { createRuntime } from "@ellie-ai/runtime";
import { agentPlugin } from "@ellie-ai/agent-plugin";
import { fsToolsPlugin } from "@ellie-ai/agent-fs-tools-plugin";
import { openAI } from "@ellie-ai/model-providers";

const runtime = createRuntime({
  plugins: [
    agentPlugin({
      model: openAI(),
      toolPlugins: [fsToolsPlugin()],
    }),
  ],
});

Tools

read

Read file contents from the file system.

Parameters:

  • path (string, required): Absolute or relative file path
  • encoding (string, optional): "utf8" (default) or "base64"

Example:

{
  "path": "/path/to/file.txt",
  "encoding": "utf8"
}

write

Create or overwrite a file with content.

Parameters:

  • path (string, required): File path to write to
  • content (string, required): Content to write
  • encoding (string, optional): "utf8" (default) or "base64"

Example:

{
  "path": "/path/to/file.txt",
  "content": "Hello world"
}

edit

Make precise edits by replacing old_string with new_string.

Parameters:

  • path (string, required): File path to edit
  • old_string (string, required): Exact text to find
  • new_string (string, required): Text to replace with
  • replace_all (boolean, optional): Replace all occurrences (default: false)

Example:

{
  "path": "/path/to/file.txt",
  "old_string": "Hello",
  "new_string": "Hi",
  "replace_all": true
}

bash

Execute shell commands.

Parameters:

  • command (string, required): Shell command to execute
  • cwd (string, optional): Working directory
  • timeout (number, optional): Timeout in milliseconds (default: 30000)

Example:

{
  "command": "ls -la",
  "cwd": "/tmp"
}

Returns: JSON with exitCode, stdout, and stderr

glob

Find files matching a pattern.

Parameters:

  • pattern (string, required): Glob pattern (e.g., "**/*.ts")
  • cwd (string, optional): Directory to search in

Example:

{
  "pattern": "src/**/*.ts",
  "cwd": "/path/to/project"
}

Returns: JSON array of matching file paths, sorted by modification time

grep

Search file contents with regex.

Parameters:

  • pattern (string, required): Regular expression pattern
  • path (string, optional): File or directory to search in
  • glob (string, optional): File filter pattern (default: "**/*")
  • context (number, optional): Number of context lines (default: 0)

Example:

{
  "pattern": "function.*test",
  "path": "/path/to/project",
  "glob": "**/*.ts",
  "context": 2
}

Configuration

Enable/Disable Tools

fsToolsPlugin({
  tools: {
    read: true,
    write: true,
    edit: true,
    bash: true,
    glob: true,
    grep: false, // Disable grep tool
  },
});

Permission System

Restrict which paths and commands agents can access:

fsToolsPlugin({
  permissions: {
    // Allow access to specific paths (glob patterns)
    allowedPaths: ["/tmp/**", "/home/user/projects/**"],

    // Deny access to specific paths (takes precedence)
    deniedPaths: ["/etc/**", "/home/user/.ssh/**"],

    // Restrict bash commands to specific prefixes
    allowedCommands: ["ls", "cat", "grep", "find"],

    // Maximum file size for read operations (in bytes)
    maxFileSize: 1024 * 1024, // 1MB
  },
});

Permission Examples

Allow only project directory:

fsToolsPlugin({
  permissions: {
    allowedPaths: ["/home/user/my-project/**"],
  },
});

Deny sensitive files:

fsToolsPlugin({
  permissions: {
    deniedPaths: [
      "/etc/**",
      "/home/user/.ssh/**",
      "/home/user/.aws/**",
      "**/.env",
    ],
  },
});

Restrict bash to read-only commands:

fsToolsPlugin({
  permissions: {
    allowedCommands: ["ls", "cat", "grep", "find", "head", "tail"],
  },
});

Security Considerations

⚠️ File System Access: This plugin gives agents full file system access by default. Always configure permissions in production environments.

⚠️ Command Execution: The bash tool can execute arbitrary commands. Consider:

  • Disabling bash entirely in untrusted environments
  • Using allowedCommands to restrict to safe read-only commands
  • Running agents in sandboxed environments

⚠️ Path Traversal: Permission checks use glob patterns. Test your patterns carefully to avoid unintended access.

Recommended Production Config

fsToolsPlugin({
  tools: {
    bash: false, // Disable command execution
  },
  permissions: {
    allowedPaths: ["/var/app/data/**", "/tmp/agent-workspace/**"],
    deniedPaths: ["**/.env", "**/.git/**", "**/node_modules/**"],
    maxFileSize: 10 * 1024 * 1024, // 10MB limit
  },
});

License

MIT