1pub const MESSAGE_ONLY: bool = false;
5pub const NO_DIFF_STATS: bool = false;
6pub const SHOW_RAW_DIFF: bool = false;
7pub const CONTEXT_LINES: u32 = 20; pub const MAX_LINES_PER_FILE: usize = 2000; pub const MAX_LINE_WIDTH: usize = 500; pub const MAX_FILE_LINES: usize = 5000; pub const CMTIGNORE_FILENAME: &str = ".cmtignore";
14
15pub const DEFAULT_PROVIDER: &str = "gemini";
17
18pub const INCLUDE_RECENT_COMMITS: bool = true;
20pub const RECENT_COMMITS_COUNT: usize = 10; pub const DEFAULT_CONFIG_FILENAME: &str = ".cmt.toml";
24pub const GLOBAL_CONFIG_DIRNAME: &str = ".config/cmt";
25pub const GLOBAL_CONFIG_FILENAME: &str = "config.toml";
26
27pub const DEFAULT_TEMPLATE: &str = "conventional";
29
30pub const AVAILABLE_PROVIDERS: &[&str] = &["claude", "openai", "gemini"];
32
33pub const DEFAULT_CLAUDE_MODEL: &str = "claude-sonnet-4-5-20250929";
35pub const DEFAULT_OPENAI_MODEL: &str = "gpt-5.2";
37pub const DEFAULT_GEMINI_MODEL: &str = "gemini-3-flash-preview";
39
40pub const AVAILABLE_TEMPLATES: &[&str] = &["conventional", "simple", "detailed"];
42
43pub fn example_config() -> String {
45 format!(
46 r#"# cmt configuration file
47
48# General options
49message_only = {}
50no_diff_stats = {}
51show_raw_diff = {}
52context_lines = {}
53max_lines_per_file = {}
54max_line_width = {}
55max_file_lines = {}
56
57# AI provider options
58provider = "{}" # Options: {}
59# model = "{}" # Uncomment to set a specific model
60# temperature = 0.3 # Uncomment to set a specific temperature
61
62# Git options
63include_recent_commits = {}
64recent_commits_count = {}
65
66# Template options
67# template = "{}" # Uncomment to use a specific template
68
69# You can add a default hint that will be used for all commits
70# hint = "Focus on the technical details"
71"#,
72 MESSAGE_ONLY,
73 NO_DIFF_STATS,
74 SHOW_RAW_DIFF,
75 CONTEXT_LINES,
76 MAX_LINES_PER_FILE,
77 MAX_LINE_WIDTH,
78 MAX_FILE_LINES,
79 DEFAULT_PROVIDER,
80 AVAILABLE_PROVIDERS.join(", "),
81 DEFAULT_CLAUDE_MODEL,
82 INCLUDE_RECENT_COMMITS,
83 RECENT_COMMITS_COUNT,
84 DEFAULT_TEMPLATE,
85 )
86}
87
88pub fn simple_template() -> String {
90 r#"{{{subject}}}
91
92{{{details}}}"#
93 .to_string()
94}
95
96pub fn conventional_template() -> String {
98 r#"{{type}}{{#if scope}}({{{scope}}}){{/if}}: {{{subject}}}
99
100{{#if details}}
101{{{details}}}
102{{/if}}"#
103 .to_string()
104}
105
106pub fn detailed_template() -> String {
108 r#"{{type}}{{#if scope}}({{{scope}}}){{/if}}: {{{subject}}}
109
110{{#if details}}
111{{{details}}}
112{{/if}}
113
114{{#if issues}}
115Fixes: {{{issues}}}
116{{/if}}
117
118{{#if breaking}}
119BREAKING CHANGE: {{{breaking}}}
120{{/if}}"#
121 .to_string()
122}