morpheus-smith
v0.1.3
Published
Smith — Standalone remote execution agent for Morpheus
Readme
SMITH Agent
The SMITH agent is a lightweight extension of the Morpheus framework designed to operate on remote machines. It allows for executing commands and managing tasks outside the user's local environment, effectively acting as a "clone" of the Morpheus agent.
Features
- Remote Command Execution: Execute commands on remote machines seamlessly.
- Agent Registration: Register the SMITH agent with the Morpheus daemon for management and monitoring.
- Heartbeat Mechanism: Maintain connectivity with the Morpheus daemon through periodic status updates.
- Sandbox Environment: Execute commands in a secure sandbox to prevent unauthorized access to the host system.
- Transport Layer: Utilize secure communication protocols for data exchange between the SMITH agent and the Morpheus daemon.
Installation
Clone the repository:
git clone https://github.com/marcosnunesmbs/smith cd smithInstall dependencies:
npm installConfigure environment variables: Copy the
.env.exampleto.envand update the necessary configurations.
Usage
Local
npx . init --name my-smith # generates config.yaml + auth token
npx . start # starts the agent
npx . status # check status
npx . stop # stop the agentGlobal (npm)
Install globally:
npm install -g morpheus-smithInitialize and start:
smith init --name my-smith # generates config.yaml + auth token smith start # starts the agent smith status # check status smith stop # stop the agent
Docker
Copy
.env.exampleto.envand adjust as needed:cp .env.example .envStart the container:
docker compose up -dCheck status:
docker compose exec smith node bin/smith.js statusView logs:
docker compose logs -f smith
Note:
auth_tokenis auto-generated if not provided. To persist a token, either setSMITH_AUTH_TOKENin.envor runsmith initbefore starting.
Environment Variables
| Variable | Default | Description |
|---|---|---|
| SMITH_NAME | smith | Instance name |
| SMITH_PORT | 7900 | WebSocket port |
| SMITH_AUTH_TOKEN | (auto-generated) | Auth token for Morpheus connection |
| SMITH_SANDBOX_DIR | /workspace | Sandbox root directory |
| SMITH_READONLY_MODE | false | Block write/delete operations |
| SMITH_ENABLE_FILESYSTEM | true | Enable filesystem tools |
| SMITH_ENABLE_SHELL | true | Enable shell tools |
| SMITH_ENABLE_GIT | true | Enable git tools |
| SMITH_ENABLE_NETWORK | true | Enable network tools |
| SMITH_ALLOWED_SHELL_COMMANDS | (empty = all) | Comma-separated command allowlist |
| SMITH_TIMEOUT_MS | 30000 | Tool execution timeout (ms) |
| SMITH_LOG_LEVEL | info | Log level: debug, info, warn, error |
Development
For contributions and feature requests, please refer to the specs directory for detailed specifications and implementation plans.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
