Skip to content

feat(cli): add -s/--silent flag to suppress non-essential output#141

Merged
8nevil8 merged 1 commit intocodemie-ai:mainfrom
sfedyakov:feat/add-silent-flag
Feb 11, 2026
Merged

feat(cli): add -s/--silent flag to suppress non-essential output#141
8nevil8 merged 1 commit intocodemie-ai:mainfrom
sfedyakov:feat/add-silent-flag

Conversation

@sfedyakov
Copy link
Contributor

Summary

Add global -s/--silent CLI parameter to enable silent mode for all agents (claude, gemini, codemie-code).

When enabled, suppresses:

  • Welcome ASCII art and messages
  • Version warning prompts
  • Update available prompts
  • Shutdown messages
  • Goodbye messages

Implementation Details

Approach: Setter Method on Adapter (Option 3)

Why this approach:

  • ✅ Explicit, type-safe API via public setSilentMode(boolean) method
  • ✅ No breaking changes to existing code
  • ✅ Backward compatible with plugins that have static silentMode: true in metadata
  • ✅ Metadata mutation controlled through well-defined public method

Changes

  1. src/agents/core/AgentCLI.ts:

    • Added -s, --silent CLI option (line 60)
    • Call setSilentMode(true) when flag is present (lines 126-132)
    • Added 'silent' to configOnlyOptions to prevent passing to agent executables (line 342)
  2. src/agents/core/BaseAgentAdapter.ts:

    • Made metadata mutable by cloning in constructor: this.metadata = { ...metadata }
    • Added public setSilentMode(enabled: boolean) method
  3. src/agents/core/__tests__/BaseAgentAdapter.test.ts (NEW):

    • 4 unit tests for setSilentMode() functionality
    • Tests verify: enable/disable, original metadata unchanged (cloning), shallow copy

Test Results

All tests passing: 1414 tests across 64 test files
Build successful: No TypeScript compilation errors
New tests: 4 tests added for BaseAgentAdapter

Usage

# Enable silent mode (long form)
codemie-claude --silent

# Enable silent mode (short form)
codemie-gemini -s

# Works with all agents
codemie-code -s --task "hello"

Backward Compatibility

  • ✅ Existing plugins with silentMode: true in metadata continue to work
  • ✅ No breaking API changes
  • ✅ All existing tests pass
  • ✅ Flag is consumed by CodeMie CLI and NOT passed to agent executables

Test plan

  • Build project successfully
  • All unit tests pass (1414/1414)
  • Help text shows -s, --silent option
  • Flag does not get passed to underlying agent executable
  • setSilentMode() correctly mutates metadata
  • Original metadata unchanged (cloning verified)

Add global -s/--silent CLI parameter to enable silent mode for all agents.
When enabled, suppresses welcome messages, version warnings, update prompts,
shutdown messages, and goodbye messages.

Implementation:
- Add -s/--silent option to AgentCLI (available for all agents)
- Add setSilentMode() method to BaseAgentAdapter for runtime override
- Clone metadata in constructor to allow mutation
- Add 'silent' to configOnlyOptions to prevent passing to agent executables
- Add 4 unit tests for setSilentMode() functionality

Changes:
- src/agents/core/AgentCLI.ts: Add CLI option and call setSilentMode()
- src/agents/core/BaseAgentAdapter.ts: Add setter method and clone metadata
- src/agents/core/__tests__/BaseAgentAdapter.test.ts: Unit tests

Backward compatible: Existing plugins with silentMode in metadata still work.

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@8nevil8 8nevil8 merged commit c717a09 into codemie-ai:main Feb 11, 2026
5 checks passed
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.

2 participants