rlm-code
v0.1.1
Published
rlm persistent JS code execution tool — vm.Context + shell + rlm SDK
Downloads
353
Maintainers
Readme
rlm-code
Persistent JavaScript code execution tool for rlm. Cordis Service. No Python.
What it does
!command→ shell out (line magic)%%bashcell → multi-line shell block- Persistent variables across calls (
vm.Context= kernel namespace) console.log()output captured as stdout- Last expression value captured as result
rlm.run()for in-process subagent spawningfs,path,os,child_process,fetch,import()all available
Install
npm install rlm-codeUsage
This is a Cordis plugin used by rlm. It's not standalone — it provides the rlmCode service to the rlm host.
# config/profile.yml
- id: code
name: 'rlm-code/src/index.ts'
config:
timeout: 60000
maxOutputChars: 65536Code tool interface
The code tool accepts a single code string and returns:
{
stdout: string;
stderr: string;
result?: string; // last expression value
status: "ok" | "error";
durationMs: number;
}Shell commands
!ls -la
!git statusMulti-line shell
%%bash
cd ./src
grep -r "TODO" .JavaScript
const fs = require("fs");
const files = fs.readdirSync(".");
console.log(files);License
MIT
