Skip to content

A coder tools plugin for elizaOS that provides filesystem, shell, and git capabilities in a restricted/sandboxed environment.

Notifications You must be signed in to change notification settings

elizaos-plugins/plugin-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@elizaos/plugin-code

A coder tools plugin for elizaOS that provides filesystem, shell, and git capabilities in a restricted/sandboxed environment.

Features

  • File Operations: Read, write, edit, list, and search files
  • Shell Execution: Run shell commands in a sandboxed directory
  • Git Commands: Execute git operations
  • Directory Navigation: Change working directory (restricted)
  • Safety Controls: Command filtering, path validation, forbidden command blocking

Installation

bun add @elizaos/plugin-code

Configuration

Set the following environment variables:

Variable Description Required Default
CODER_ENABLED Enable/disable the plugin No false
CODER_ALLOWED_DIRECTORY Directory for operations Yes process.cwd()
CODER_TIMEOUT Command timeout (ms) No 30000
CODER_FORBIDDEN_COMMANDS Additional forbidden commands (comma-separated) No -

Usage

import { coderPlugin } from '@elizaos/plugin-code';

// Add to your agent's plugins
const agent = {
  plugins: [coderPlugin],
  // ...
};

Actions

Action Description Similes
READ_FILE Read file contents VIEW_FILE, OPEN_FILE, CAT_FILE, SHOW_FILE, GET_FILE
WRITE_FILE Create or overwrite a file CREATE_FILE, SAVE_FILE, OUTPUT_FILE
EDIT_FILE Replace substring in file REPLACE_IN_FILE, PATCH_FILE, MODIFY_FILE
LIST_FILES List directory contents LS, LIST_DIR, LIST_DIRECTORY, DIR
SEARCH_FILES Search text in files GREP, RG, FIND_IN_FILES, SEARCH
CHANGE_DIRECTORY Change working directory CD, CWD
EXECUTE_SHELL Run shell command SHELL, RUN_COMMAND, EXEC, TERMINAL
GIT Run git command GIT_COMMAND, GIT_RUN

Provider

The CODER_STATUS provider supplies context about:

  • Current working directory
  • Allowed directory
  • Recent command history
  • Recent file operations

Security

The plugin implements several security measures:

  1. Path Validation: All file operations are restricted to CODER_ALLOWED_DIRECTORY
  2. Command Filtering: Blocks shell control operators (&&, ||, ;, $(, backticks)
  3. Forbidden Commands: Blocks dangerous commands like rm -rf /, sudo rm, etc.
  4. Timeout: Commands are killed after CODER_TIMEOUT milliseconds
  5. Disabled by Default: Must explicitly set CODER_ENABLED=true

License

MIT

About

A coder tools plugin for elizaOS that provides filesystem, shell, and git capabilities in a restricted/sandboxed environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published