Docs/Author
Agents
Lumpcode invokes the CLI agent you already have. Set command to a shipped preset, a small module, or an inline function.
On this page
The lump field command is not a shell line. It is one of:
- Tag —
"cursor","copilot","claude-code","opencode","codex", or your module name. - Lump-relative file — no whitespace, ends in
.tsor.js. Loaded as a command module.commandNameis the literal string. - Inline
CommandFn— JS/TS only. Return{ executable, args, env? }to run, ornull/undefined/ nothing to skip (no process;postCommandExecFnstill runs).
Agent flags belong in executable + args. Resolve order for a tag: project .lumpcode/commands/<name>.ts then .js, then the same under ~/.lumpcode/commands/, then shipped presets (.js only). lumpcode reset-presets restores the shipped files.
command: 'cursor'
command: './runAgent.ts'
command: ({ prompt }) => ({ executable: 'my-agent', args: ['-p', prompt] })Shipped presets
| Config value | Binary on PATH |
Default model flag |
|---|---|---|
cursor |
cursor-agent |
auto |
copilot |
copilot |
auto |
claude-code |
claude |
omitted when unset |
opencode |
opencode |
omitted when unset |
codex |
codex |
omitted when unset |
Claude Code and ChatGPT Codex reject auto. Leave model unset for those two unless you have a real model id.
Presets run headless. Copilot and Claude Code deny agent git commit / git push. Cursor, OpenCode, and Codex do not always; deny git write in those agents. Lumpcode owns marker commits.
model and permissions
Presets read lumpVariables and stepVariables. Step overrides lump. Closed types: CursorPresetLumpVariables, CopilotAgentPermissions, … on @lumpcode/cli-utils. Step-only session keys: newChat, chatIdIndex.
import { defineConfig } from '@lumpcode/cli-utils'
export default defineConfig({
command: 'cursor',
lumpVariables: { model: 'auto' },
steps: [
{
promptTemplate: 'Analyze @{FILE}. Do not edit.',
stepVariables: { model: 'composer-2' },
},
{ promptTemplate: 'Apply the safe fixes to @{FILE}.' },
],
})| Preset | agentPermissions |
|---|---|
cursor |
cursorConfigDir → CURSOR_CONFIG_DIR |
copilot |
writablePaths, denyShell (preset already denies git commit / git push) |
claude-code |
permissionMode (default acceptEdits), allowedTools, disallowedTools, addDirs, bare |
opencode |
auto (default on), agent |
codex |
sandbox (default workspace-write), addDirs; dangerouslyBypassApprovalsAndSandbox only when true |
Unattended Cursor: a dedicated cli-config.json that denies git commit / git push, pointed at with agentPermissions.cursorConfigDir:
{
"version": 1,
"permissions": {
"allow": ["Write(**)", "Read(**)", "Shell(*)"],
"deny": ["Shell(git:commit*)", "Shell(git:push*)"]
}
}lumpVariables: {
agentPermissions: { cursorConfigDir: '/home/worker/.cursor-unattended' },
}Custom command module
import { defineCommand } from '@lumpcode/cli-utils'
export const command = defineCommand(({ prompt }) => ({
executable: 'my-agent',
args: ['--message', prompt],
}))Optional setup and teardown compose with the lump’s setupFn / teardownFn (lump setup first; teardown reversed). Command setup state lives at contextRunState["<commandName>Setup"].
Same skip contract as inline command: return nothing and no process runs.
import { defineCommand } from '@lumpcode/cli-utils'
export const command = defineCommand(({ prompt }) => {
if (prompt.trim() === '') return
return { executable: 'my-agent', args: ['--message', prompt] }
})The agent cwd is the branch workspace (workspacePath). projectRoot is the source checkout that contains .lumpcode/. In shared mode those are different folders.
Signatures: types.
Skill versus the agent inside a lump
npx skills add lumpcode/skills helps the agent in your editor write lumps. It is not invoked when a lump runs. The lump’s command is.