pub struct Config {
pub repo_path: PathBuf,
pub max_tokens: usize,
pub output_file: String,
pub include_hidden: bool,
pub include_deps: bool,
}Expand description
Configuration structure for the AI Context Generator.
This structure holds all the configuration options that control how the context generation process behaves, including input/output paths, token limits, and scanning options.
§Examples
use ai_context_gen::Config;
use std::path::PathBuf;
// Create a default configuration
let config = Config::default();
// Create a custom configuration
let custom_config = Config {
repo_path: PathBuf::from("./my-project"),
max_tokens: 100000,
output_file: "custom_context.md".to_string(),
include_hidden: true,
include_deps: false,
};Fields§
§repo_path: PathBufPath to the repository to analyze.
This should point to the root directory of the project you want to analyze. The scanner will recursively process all supported files within this directory.
max_tokens: usizeMaximum number of tokens to include in the generated context.
This limit helps ensure the generated context fits within LLM token limits. When the limit is reached, lower priority content will be truncated. Uses GPT-4 tokenizer for accurate counting.
output_file: StringOutput file path for the generated context.
The generated markdown context will be written to this file. If the file already exists, it will be overwritten.
Whether to include hidden files and directories in the analysis.
When true, files and directories starting with . will be included
in the scan (except for those in IGNORED_DIRS).
include_deps: boolWhether to include external dependency analysis.
When true, the generator will attempt to analyze and include
information about external dependencies from Cargo.toml.
Trait Implementations§
Source§impl Default for Config
impl Default for Config
Source§fn default() -> Self
fn default() -> Self
Creates a default configuration with sensible defaults.
§Default Values
repo_path: Current directory (.)max_tokens: 50,000 tokensoutput_file:"repo_context.md"include_hidden:falseinclude_deps:false
§Examples
use ai_context_gen::Config;
let config = Config::default();
assert_eq!(config.max_tokens, 50000);
assert_eq!(config.output_file, "repo_context.md");