-
Add CLI dev mode config toggle (#3181)
发布于
2026-04-14 02:12:30 +00:00 Summary
Turns
composio devinto a real developer-mode switch backed by CLI
user config, and hides the developer subcommand tree when the mode is
off.composio devchanges- New
--mode on|offoption on thedevcommand
(Options.choice('mode', ['on', 'off']), optional). - Visibility-gated subcommands.
buildDevCommand(visibility)only
attaches the developer subcommand tree (init,tools execute,
triggers listen,logs,toolkits,auth-configs,
connected-accounts,triggers,projects) when
visibility.isDevModeEnabledis true. When off,composio devis a
leaf command whose only job is toggling the mode. - Handler behavior:
composio devwith no flag → interactiveselectprompt (Turn on /
Turn off / Keep current). Non-TTY → prints current state and exits with
a hint to pass--mode on|off.composio dev --mode on→ shows a boxed warning note about unlocking
advanced commands, thenconfirmbefore flipping. Non-TTY refuses to
enable and points the user at the config file path.composio dev --mode off→ flips immediately.
- No-op if the requested state already matches; logs current state
instead of rewriting config. - Description swaps with mode. When dev mode is on: "Developer
workflows: init, playground execution, logs, projects, toolkits,
accounts, and triggers." When off: "Developer mode controls access to
developer-only workflows. When off, onlycomposio dev --mode on|offis
available."
Config wiring
CliUserConfiggains adeveloperstruct ({ enabled, destructive_actions }) replacing the flatdeveloper_mode_enabled/
developer_dangerous_commands_enabledkeys.normalizeRawConfigJson
migrates existing configs on read.ComposioCliUserConfigservice exposesisDevModeEnabled(),
areDeveloperDangerousCommandsEnabled(), and anupdate()that
persists partial changes to~/.composio/<cli-config>.json.cli-main.ts/root-help.ts/commands/index.tsconsume
visibility so the help output and command tree match the toggle.
Collateral cleanup
Removed deprecated destructive/info commands that were being guarded
ad-hoc and now fall under the dev-mode gate:auth-configs delete,auth-configs infoconnected-accounts delete,connected-accounts infotriggers delete- Corresponding tests deleted;
auth-configs create,projects list/switch, andtriggersmutation tests updated for the new
layer/visibility shape.
Testing
ts/packages/cli/test/src/commands/dev.cmd.test.ts— new coverage for
the toggle handler (TTY/non-TTY, on→on no-op, confirm path, persisted
config).ts/packages/cli/test/src/services/cli-user-config.test.ts— new
coverage for thedeveloperstruct, legacy key migration, and
update().ts/packages/cli/test/src/commands/feature-visibility.test.ts—
updated to exercise visibility-gated subcommands.- Not run: full workspace test suite.
Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
下载附件
- New