Skip to content

Shell

Terminal window
carbon add plugin Shell
{
"plugins": {
"shell": {
"allowedPrograms": ["git"],
"allowedCwds": ["$APPDATA/repos"],
"allowedEnv": ["PATH", "HOME"],
"allowedUrlSchemes": ["https", "mailto"],
"allowOpenPaths": false
}
}
}
import { shell } from '@dotcarbon/plugin-shell'
const result = await shell.execute({
program: 'git',
args: ['status', '--short'],
cwd: repoPath,
})
console.log(result.exitCode, result.stdout, result.stderr)

Process execution is default-deny. Carbon validates the program, working directory, and environment keys before starting it. Do not expose a command that accepts a shell-formatted string.