Skip to content

feat: add disableExec config option#26

Open
voidborne-d wants to merge 1 commit intoopenclaw:mainfrom
voidborne-d:feat/disable-exec-config
Open

feat: add disableExec config option#26
voidborne-d wants to merge 1 commit intoopenclaw:mainfrom
voidborne-d:feat/disable-exec-config

Conversation

@voidborne-d
Copy link

Closes #15

Summary

Adds a disableExec boolean config field (global + project) that prevents the exec subcommand from running.

Usage

Global (~/.acpx/config.json):

{
  "disableExec": true
}

Per-project (.acpxrc.json):

{
  "disableExec": true
}

When enabled:

$ acpx codex exec "do something"
Error: exec is disabled by configuration (disableExec: true). Use prompt with a persistent session instead.

Changes

  • src/config.ts: add disableExec to config schema, parsing, merging, and display
  • src/cli.ts: check config.disableExec at the top of handleExec
  • test/config.test.ts: 4 new tests (default false, global read, project override, invalid type rejection)

Checklist

  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run build
  • npm test — 134/134 pass ✅

Project override takes priority over global, matching existing config precedence. Default is false (exec stays enabled).

Closes openclaw#15

Adds a `disableExec` boolean config field (global + project) that
prevents the `exec` subcommand from running. When set to `true`,
`acpx <agent> exec` and `acpx exec` exit with a clear error message
directing users to use persistent sessions instead.

Config precedence follows existing patterns: project .acpxrc.json
overrides global ~/.acpx/config.json. Default is `false` (exec
enabled).

Changes:
- src/config.ts: add disableExec to ConfigFileShape, ResolvedAcpxConfig,
  parsing, merging, and config display
- src/cli.ts: check config.disableExec at the top of handleExec
- test/config.test.ts: 4 new tests (default, global, project override,
  invalid type rejection)

All 134 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add config option to disable exec subcommand

1 participant