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
)
| 735 | help="Clear all agent instructions", |
| 736 | ) |
| 737 | def 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 |
nothing calls this directly
no test coverage detected