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

n8n-nodes-shell-commands-executor

v0.1.1

Published

Execute shell commands on self-hosted n8n instances with pre-configured templates

Readme

n8n-nodes-command-executor

This is an n8n community node that allows you to execute shell commands on self-hosted n8n instances.

n8n is a fair-code licensed workflow automation platform.

⚠️ Security Warning

IMPORTANT: This node executes arbitrary commands on your server. It should ONLY be used on self-hosted n8n instances that you control. Never use this node if you don't understand the security implications.

  • Commands run with the same permissions as your n8n process
  • Malicious commands could damage your system or compromise security
  • Always validate and sanitize inputs when using generic command mode
  • Consider using templates for common operations to reduce risk

Installation

Follow the installation guide in the n8n community nodes documentation.

NPM

npm install n8n-nodes-command-executor

Manual Installation (Development)

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run build to build the node
  4. Copy the built files to your n8n custom nodes directory

Operations

The Command Executor node supports two modes:

Generic Command Mode

Execute any shell command you specify. This mode gives you complete flexibility but requires careful attention to security.

Example:

echo "Hello from n8n!"

Template Mode

Use pre-configured command templates with safe, parameterized inputs. This is the recommended mode for most use cases.

Available Templates

| Template | Description | Parameters | |----------|-------------|------------| | System Information | Get OS info, disk usage, and memory | None | | List Files | List files in a directory | Path, Options | | Read File | Read file contents | File Path | | Find Files | Find files matching a pattern | Search Path, Pattern | | Process List | List running processes | Filter (optional) | | Network Ping | Ping a host | Host, Count | | HTTP Request (curl) | Make HTTP requests with curl | URL, Options | | Disk Usage | Show disk usage for a path | Path | | Execute Python Code | Run Python code or script files | Execution Mode, Interpreter, Code/File Path, Arguments | | Execute Node.js Code | Run JavaScript code or script files | Execution Mode, Code/File Path, Arguments |

Configuration

Common Options

  • Working Directory: Set the working directory for command execution
  • Timeout: Maximum execution time in seconds (1-300, default: 30)
  • Environment Variables: Add custom environment variables for your command
  • Continue on Error: If enabled, the workflow continues even if the command fails

Output

The node returns the following data for each execution:

{
  "command": "echo 'test'",
  "exitCode": 0,
  "stdout": "test\n",
  "stderr": "",
  "executionTimeMs": 45,
  "success": true
}

Usage Examples

Example 1: System Information

Use the "System Information" template to get details about your server:

  1. Add Command Executor node
  2. Select Mode: "Template"
  3. Select Template: "System Information"
  4. Run the workflow

Example 2: List Files

List all files in a directory with details:

  1. Add Command Executor node
  2. Select Mode: "Template"
  3. Select Template: "List Files"
  4. Path: /var/log
  5. Options: "Long format with hidden files (-lah)"

Example 3: Generic Command

Execute a custom command:

  1. Add Command Executor node
  2. Select Mode: "Generic Command"
  3. Command: df -h | grep /dev/
  4. Run the workflow

Example 4: Backup Database

Use generic mode to backup a database:

mysqldump -u root -p'password' mydb > /backups/mydb_$(date +%Y%m%d).sql

⚠️ Security Note: Never hardcode sensitive credentials. Use environment variables or n8n credentials instead.

Example 5: Execute Python Code

Run Python code inline:

  1. Add Command Executor node
  2. Select Mode: "Template"
  3. Select Template: "Execute Python Code"
  4. Execution Mode: "Inline Code"
  5. Python Interpreter: "Python 3"
  6. Code: import sys; print(f"Python {sys.version}")
  7. Run the workflow

Or execute a Python script file:

  1. Execution Mode: "File Path"
  2. File Path: /path/to/script.py
  3. Arguments: --arg1 value1

Example 6: Execute Node.js Code

Run JavaScript code inline:

  1. Add Command Executor node
  2. Select Mode: "Template"
  3. Select Template: "Execute Node.js Code"
  4. Execution Mode: "Inline Code"
  5. Code: console.log(process.version); console.log("Hello from Node!")
  6. Run the workflow

Or execute a JavaScript file:

  1. Execution Mode: "File Path"
  2. File Path: /path/to/script.js
  3. Arguments: --experimental-modules

Development

Setup

git clone https://github.com/your-repo/n8n-nodes-command-executor.git
cd n8n-nodes-command-executor
npm install

Build

npm run build

Run in Development Mode

npm run dev

This will start n8n with your node loaded and watch for changes.

Lint

npm run lint
npm run lint:fix

Compatibility

  • Tested with n8n v1.0+
  • Compatible with Node.js v20+

Resources

License

MIT

Version History

0.1.0

  • Initial release
  • Generic command execution
  • 10 pre-configured templates (including Python and Node.js code execution)
  • Environment variable support
  • Configurable timeouts and working directory

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

Support

If you have any issues or questions, please open an issue on GitHub or ask in the n8n community forum.

Disclaimer

This node is provided as-is with no warranties. Use at your own risk. The authors are not responsible for any damage or security issues that may arise from using this node.