pub struct Config {
pub source_dir: String,
pub compress_agents_md: bool,
pub default_agents: Vec<String>,
pub agents: BTreeMap<String, AgentConfig>,
pub gitignore: GitignoreConfig,
pub mcp: McpGlobalConfig,
pub mcp_servers: BTreeMap<String, McpServerConfig>,
}Expand description
Represents the root of the agentsync.toml configuration file.
Fields§
§source_dir: StringThe directory where source files for agents are stored, relative to the configuration file. Defaults to “.”.
compress_agents_md: boolIf true, generate a compressed AGENTS.md and point AGENTS.md symlinks to it.
default_agents: Vec<String>Default agents to run when –agents is not specified. Uses case-insensitive substring matching. If empty, all enabled agents will be processed.
agents: BTreeMap<String, AgentConfig>A map of agent configurations, where the key is the agent’s name (e.g., “claude”). Uses BTreeMap to ensure deterministic ordering in config and generated files while avoiding redundant sorting overhead.
gitignore: GitignoreConfigSettings for managing the project’s .gitignore file.
mcp: McpGlobalConfigGlobal settings for Model Context Protocol (MCP) integration.
mcp_servers: BTreeMap<String, McpServerConfig>A map of MCP server configurations, where the key is a unique server name. Uses BTreeMap to maintain deterministic order without manual sorting.
Implementations§
Source§impl Config
impl Config
Sourcepub fn find_config(start_dir: &Path) -> Result<PathBuf>
pub fn find_config(start_dir: &Path) -> Result<PathBuf>
Find configuration file by searching up from current directory
Sourcepub fn project_root(config_path: &Path) -> PathBuf
pub fn project_root(config_path: &Path) -> PathBuf
Get the project root directory (parent of .agents or location of config)
Sourcepub fn source_dir(&self, config_path: &Path) -> PathBuf
pub fn source_dir(&self, config_path: &Path) -> PathBuf
Get the source directory (where source files are located)
Sourcepub fn all_gitignore_entries(&self) -> Vec<String>
pub fn all_gitignore_entries(&self) -> Vec<String>
Get all gitignore entries (from config + auto-generated from targets + known patterns) Uses a BTreeSet for efficient deduplication and automatic sorting.
Sourcepub fn known_ignore_patterns(agent_name: &str) -> &'static [&'static str]
pub fn known_ignore_patterns(agent_name: &str) -> &'static [&'static str]
Get known gitignore patterns for a specific agent. These are files/directories that agents generate but are not direct symlink targets.