Skip to content

mlund01/plugin_shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin_shell

A Squadron plugin that gives agents the ability to execute shell commands. Supports local execution, remote execution over SSH, and execution inside Docker containers.

Installation

plugin "shell" {
  source  = "github.com/mlund01/plugin_shell"
  version = "v0.0.1"
}

Tool: exec

Execute a shell command on the configured target.

Parameter Type Required Description
command string yes The shell command to execute
timeout integer no Timeout in seconds (default: 120, 0 = no timeout)

Configuration

The plugin supports three execution modes configured via plugin settings.

Local (default)

Execute commands on the local machine:

plugin "shell" {
  source  = "github.com/mlund01/plugin_shell"
  version = "v0.0.1"
  settings = {
    mode  = "local"
    shell = "bash"   # optional, defaults to bash (unix) or cmd (windows)
  }
}

SSH

Execute commands on a remote host over SSH:

plugin "shell" {
  source  = "github.com/mlund01/plugin_shell"
  version = "v0.0.1"
  settings = {
    mode     = "ssh"
    host     = "10.0.0.5"
    user     = "deploy"
    port     = "22"        # optional, default 22
    key_file = "/path/to/key"  # preferred over password
    password = vars.ssh_password  # fallback if no key_file
    shell    = "bash"      # optional
  }
}

Docker

Execute commands inside a running container or a fresh container from an image:

# Attach to a running container
plugin "shell" {
  source  = "github.com/mlund01/plugin_shell"
  version = "v0.0.1"
  settings = {
    mode      = "docker"
    container = "my-app"
    shell     = "sh"       # optional, defaults to sh
  }
}

# Create a container from an image
plugin "shell" {
  source  = "github.com/mlund01/plugin_shell"
  version = "v0.0.1"
  settings = {
    mode  = "docker"
    image = "ubuntu:24.04"
  }
}

Usage

Assign the plugin's tools to an agent:

agent "ops" {
  model = models.anthropic.claude_sonnet_4
  role  = "DevOps engineer"
  tools = [plugins.shell.all]
}

License

See LICENSE.

About

Shell plugin for squadron

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages