pub struct SetupConfig {
pub auto_inject_rules: Option<bool>,
pub auto_inject_skills: Option<bool>,
pub auto_update_mcp: bool,
pub manage_hooks: bool,
pub agents: Option<Vec<String>>,
}Expand description
Controls what lean-ctx injects during setup and update --rewire.
Fresh installs default to non-invasive (rules/skills off, MCP on).
Users who ran setup interactively get explicit true/false.
None = undecided (legacy: check if rules already exist and preserve behavior).
Fields§
§auto_inject_rules: Option<bool>Inject agent rule files (CLAUDE.md, .cursor/rules/, etc.). None = undecided (legacy compat: inject if rules already present). Some(true) = always inject. Some(false) = never inject.
auto_inject_skills: Option<bool>Install SKILL.md files for supported agents. None = undecided. Some(true) = install. Some(false) = skip.
auto_update_mcp: boolRegister lean-ctx as an MCP server in editor configs.
manage_hooks: boolKeep already-installed agent hooks current on MCP server start (#1879).
false leaves hook entries, permissions.deny and the status line in
agent settings exactly as the user wrote them; only an explicit
lean-ctx setup / init --agent / doctor --fix writes them.
agents: Option<Vec<String>>AI tools (agent keys, e.g. claude, cursor) that setup, onboard
and the post-update refresh may configure. Written by the setup
selection or --agents. None = no choice recorded yet: setup offers
every detected tool, an update refreshes only already-connected ones.
Implementations§
Source§impl SetupConfig
impl SetupConfig
Sourcepub fn should_inject_rules(&self) -> bool
pub fn should_inject_rules(&self) -> bool
Returns whether rules should be injected, considering legacy installs. If undecided (None), checks if lean-ctx rules markers already exist in any agent config — if so, keeps injecting for backward compat.
Sourcepub fn should_inject_skills(&self) -> bool
pub fn should_inject_skills(&self) -> bool
Returns whether skills should be installed.
Sourcepub fn should_update_mcp(&self) -> bool
pub fn should_update_mcp(&self) -> bool
Returns whether setup/onboard/init may (re)register the lean-ctx
MCP server in editor configs. Honors auto_update_mcp (#281) so locked-
down environments can keep MCP out of agent settings while still getting
hooks, rules and skills.
Trait Implementations§
Source§impl Clone for SetupConfig
impl Clone for SetupConfig
Source§fn clone(&self) -> SetupConfig
fn clone(&self) -> SetupConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SetupConfig
impl Debug for SetupConfig
Source§impl Default for SetupConfig
impl Default for SetupConfig
Source§fn default() -> SetupConfig
fn default() -> SetupConfig
Source§impl<'de> Deserialize<'de> for SetupConfigwhere
SetupConfig: Default,
impl<'de> Deserialize<'de> for SetupConfigwhere
SetupConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SetupConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SetupConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SetupConfig
impl Serialize for SetupConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for SetupConfig
impl Freeze for SetupConfig
impl Move for SetupConfig
impl RefUnwindSafe for SetupConfig
impl Send for SetupConfigwhere
RawVecInner: Send,
impl Sync for SetupConfigwhere
RawVecInner: Sync,
impl Unpin for SetupConfig
impl UnsafeUnpin for SetupConfig
impl UnwindSafe for SetupConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more