MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / config_agent

Function config_agent

codewiki/cli/commands/config.py:737–861  ·  view source on GitHub ↗

Configure default agent instructions for documentation generation. These settings are used as defaults when running 'codewiki generate'. Runtime options (--include, --exclude, etc.) override these defaults. Examples: \b # Set include patterns for C# projects

(
    include: Optional[str],
    exclude: Optional[str],
    focus: Optional[str],
    doc_type: Optional[str],
    instructions: Optional[str],
    clear: bool
)

Source from the content-addressed store, hash-verified

735 help="Clear all agent instructions",
736)
737def config_agent(
738 include: Optional[str],
739 exclude: Optional[str],
740 focus: Optional[str],
741 doc_type: Optional[str],
742 instructions: Optional[str],
743 clear: bool
744):
745 """
746 Configure default agent instructions for documentation generation.
747
748 These settings are used as defaults when running 'codewiki generate'.
749 Runtime options (--include, --exclude, etc.) override these defaults.
750
751 Examples:
752
753 \b
754 # Set include patterns for C# projects
755 $ codewiki config agent --include "*.cs"
756
757 \b
758 # Exclude test projects
759 $ codewiki config agent --exclude "*Tests*,*Specs*,test_*"
760
761 \b
762 # Focus on specific modules
763 $ codewiki config agent --focus "src/core,src/api"
764
765 \b
766 # Set default doc type
767 $ codewiki config agent --doc-type architecture
768
769 \b
770 # Add custom instructions
771 $ codewiki config agent --instructions "Focus on public APIs and include usage examples"
772
773 \b
774 # Clear all agent instructions
775 $ codewiki config agent --clear
776 """
777 try:
778 manager = ConfigManager()
779
780 if not manager.load():
781 click.secho("\n✗ Configuration not found.", fg="red", err=True)
782 click.echo("\nPlease run 'codewiki config set' first to configure your API credentials.")
783 sys.exit(EXIT_CONFIG_ERROR)
784
785 config = manager.get_config()
786
787 if clear:
788 # Clear all agent instructions
789 config.agent_instructions = AgentInstructions()
790 manager.save()
791 click.echo()
792 click.secho("✓ Agent instructions cleared", fg="green")
793 click.echo()
794 return

Callers

nothing calls this directly

Calls 8

loadMethod · 0.95
get_configMethod · 0.95
saveMethod · 0.95
ConfigManagerClass · 0.90
AgentInstructionsClass · 0.90
handle_errorFunction · 0.90
is_emptyMethod · 0.80
parse_patternsFunction · 0.70

Tested by

no test coverage detected