goshell is a sandboxed virtual shell written in Go. It runs against an in-memory filesystem and embeds common agent tools directly into the binary.
- In-memory VFS with
ls,cd,pwd,mkdir,touch,cp,mv,rm,cat,find,dump,grep,awk,env, andexport - Pipelines and redirection with
|,>, and>> - Embedded tools:
jq,sqlite3,python,node, andwhich - SQLite dot commands:
.tables,.schema,.databases,.indexes,.mode,.headers,.separator,.nullvalue,.output,.read,.import,.dump - Configurable allowlists and blacklist rules
- Host import and VFS export support
go run ./cmd/goshellWith config:
go run ./cmd/goshell -config example_config.jsonImport a host directory:
go run ./cmd/goshell -import /full/path/on/hostexample_config.json supports these fields:
{
"allowed_builtins": ["ls", "cd", "pwd", "mkdir", "touch", "cat", "rm", "cp", "mv", "find", "dump", "echo", "grep", "awk", "env", "export", "source", "which"],
"allowed_external": ["python", "python3", "sqlite3", "jq", "node"],
"embedded_tools": ["jq", "sqlite3", "python", "python3", "node", "nodejs", "which"],
"import_path": "./test",
"blacklist": ["rm\\s+-rf\\s+/"] ,
"init_commands": ["echo \"Welcome to goshell\""],
"prompt": "goshell:{cwd}$ "
}goshell:/$ echo '{"a":1}' | jq '.a'
1
goshell:/$ sqlite3 main.db
sqlite> .tables
sqlite> .schema
goshell:/$ echo 'print("hello")' | python
hello
goshell:/$ echo 'console.log("ok")' | node
ok