pub struct Config {Show 25 fields
pub home_dir: PathBuf,
pub schema_version: u32,
pub last_cleared_schema_version: Option<u32>,
pub shell_type: ShellType,
pub presets_dir_override: Option<PathBuf>,
pub external_shell_mode: ExternalShellMode,
pub presets_overlay_dir_override: Option<PathBuf>,
pub presets_overlay_git: Option<String>,
pub presets_overlay_git_branch: Option<String>,
pub app_default_dest_root_override: Option<PathBuf>,
pub is_external_presets: bool,
pub legacy_allow_app_hooks: bool,
pub legacy_allow_sys_code: bool,
pub sync_terminal_theme: bool,
pub self_install_dest: Option<PathBuf>,
pub gpg_recipients: Vec<String>,
pub legacy_gpg_key_id: Option<String>,
pub secret_backend: Option<String>,
pub age_recipients: Vec<String>,
pub age_identity: Option<String>,
pub age_identities: Vec<String>,
pub env: BTreeMap<String, String>,
pub env_proxy: Vec<EnvProxyRule>,
pub env_descriptions: BTreeMap<String, String>,
pub env_override_sources: BTreeMap<String, EnvOverrideSource>,
/* private fields */
}Fields§
§home_dir: PathBuf§schema_version: u32§last_cleared_schema_version: Option<u32>§shell_type: ShellType§presets_dir_override: Option<PathBuf>Optional persistent presets_dir override stored in the active config. Takes effect when neither SHINE_CONFIG_DIR nor SHINE_PRESETS is set.
external_shell_mode: ExternalShellModeDeployment policy for shell commands sourced from an external presets directory. Snapshot mode is the safe default; live mode is an explicit preset-development opt-in.
presets_overlay_dir_override: Option<PathBuf>Optional overlay directory merged over the active presets source.
presets_overlay_git: Option<String>Optional Git URL for a shine-managed overlay. When set (and no explicit
presets_overlay_dir is configured), shine owns the overlay checkout at
<shine_dir>/overlay, cloning it --depth 1 on shine preset pull and keeping
it as an always-latest mirror of the remote tip.
presets_overlay_git_branch: Option<String>Optional branch to track for presets_overlay_git. When unset, the
remote’s default branch is used.
app_default_dest_root_override: Option<PathBuf>Optional override for the default destination root used by shine app install
when a preset file carries no shine-dest: annotation.
Defaults to ~/.config when not set.
is_external_presets: booltrue when the presets directory is provided by the user (via env var or config
presets_dir key) rather than the default ~/.shine/presets/.
When true, commands resolve desired presets from disk without extracting embedded
assets. Shell deployment then follows external_shell_mode.
legacy_allow_app_hooks: boolRetired coarse App trust flag, read only to emit a migration warning.
legacy_allow_sys_code: boolRetired coarse Sys trust flag, read only to emit a migration warning.
sync_terminal_theme: boolWhether the managed sys pre profile auto-syncs the terminal theme
(shine theme sync --auto) on interactive shell startup. Defaults to
true. The SHINE_SYNC_TERMINAL_THEME env var overrides this at
runtime regardless of value (docs/terminal-theme-sync-prd.md §5).
Deliberately not project-overridable: this is a terminal/session-level
toggle, not something that varies per project.
self_install_dest: Option<PathBuf>Path where shine self install last copied the binary.
When set, shine self upgrade will try to sync the new binary there automatically.
gpg_recipients: Vec<String>Default GPG recipients used by shine env secret encrypt/seal when
neither -r/--recipient nor a workspace GPG recipient list is given.
legacy_gpg_key_id: Option<String>§secret_backend: Option<String>Selects the default crate::secret::BackendKind used by shine env encrypt/seal when neither -r/--recipient nor a workspace backend
override is given. Absent means GPG. Decryption never consults this
field — it is resolved purely from the ciphertext’s backend tag.
age_recipients: Vec<String>Default age recipients (age1... / age1se1...) used by shine env encrypt/seal when the age backend is active and no -r/--recipient
is given. Encrypting to every team member’s recipient lets any of them
decrypt the resulting ciphertext with their own identity.
age_identity: Option<String>Legacy primary age identity file used to decrypt age:-tagged secrets.
The file may itself contain multiple identity lines. Defaults to
<shine_dir>/age/identity.txt when unset and that file exists.
age_identities: Vec<String>Additional age identity files. These are merged after age_identity
and allow hardware-backed identities to coexist without copying them.
env: BTreeMap<String, String>Environment variables substituted into template-enabled presets.
env_proxy: Vec<EnvProxyRule>Command-specific, explicitly allow-listed secret injection rules.
env_descriptions: BTreeMap<String, String>Per-variable descriptions read from detailed [env] entries.
env_override_sources: BTreeMap<String, EnvOverrideSource>Which env override file (if any) currently supplies each key’s effective
value. Only override files populate this — config.toml [env] layers
never do, since a plain write there is always effective unless shadowed
by one of these. Used to detect when env set/encrypt/delete would
otherwise silently write a value that an override file keeps shadowing.
Implementations§
Source§impl Config
impl Config
pub async fn init_current_dir_config() -> Result<PathBuf>
pub async fn load_or_init() -> Result<Self>
pub async fn load_global_runtime_or_init() -> Result<Self>
pub async fn load_global_runtime_for_dry_run() -> Result<Self>
pub async fn read_global_runtime_schema_version() -> Result<u32>
Source§impl Config
impl Config
pub fn presets_dir(&self) -> &Path
pub fn bin_dir(&self) -> &Path
pub fn shine_dir(&self) -> &Path
pub fn config_path(&self) -> &Path
Sourcepub fn global_config_path(&self) -> PathBuf
pub fn global_config_path(&self) -> PathBuf
Global configuration path, even when a project configuration is active.
Sourcepub fn is_project_config(&self) -> bool
pub fn is_project_config(&self) -> bool
Whether configuration was discovered from a project shine.config.toml.
Sourcepub fn rendered_dir(&self) -> PathBuf
pub fn rendered_dir(&self) -> PathBuf
Directory where template-rendered shell scripts are written. Always inside shine_dir so it is never confused with user-owned presets.
Sourcepub fn installed_shell_dir(&self) -> PathBuf
pub fn installed_shell_dir(&self) -> PathBuf
Shine-owned snapshots of external shell categories.
pub fn app_default_dest_root(&self) -> PathBuf
pub fn new_for_test(dir: &Path) -> Self
Sourcepub fn resolved_age_identities(&self) -> Vec<PathBuf>
pub fn resolved_age_identities(&self) -> Vec<PathBuf>
Age identity file(s) used to decrypt age:-tagged secrets, resolved
from age_identity plus age_identities (tilde-expanded) or, when
neither is set, the default path under shine_dir if it exists.
Sourcepub fn project_overrides_age_identities(&self) -> bool
pub fn project_overrides_age_identities(&self) -> bool
Whether the active project explicitly replaces global age identities.
Sourcepub fn with_presets_dir_override(self, value: Option<PathBuf>) -> Self
pub fn with_presets_dir_override(self, value: Option<PathBuf>) -> Self
Return a clone of this config with presets_dir_override replaced.
pub fn with_external_shell_mode(self, value: ExternalShellMode) -> Self
Sourcepub fn with_presets_overlay_git(
self,
url: Option<String>,
branch: Option<String>,
) -> Self
pub fn with_presets_overlay_git( self, url: Option<String>, branch: Option<String>, ) -> Self
Return a clone of this config with the Git-managed overlay source
replaced. Setting a URL clears any manual presets_overlay_dir override
so the two overlay modes never coexist; clearing the URL leaves the
managed checkout on disk untouched.
Sourcepub fn with_presets_overlay_dir_override(self, value: Option<PathBuf>) -> Self
pub fn with_presets_overlay_dir_override(self, value: Option<PathBuf>) -> Self
Return a clone of this config with presets_overlay_dir_override replaced.
Sourcepub fn env_override_source(&self, key: &str) -> Option<&EnvOverrideSource>
pub fn env_override_source(&self, key: &str) -> Option<&EnvOverrideSource>
Which override file (if any) currently supplies key’s effective value.
None means the key resolves purely from config.toml [env] (global or
project), so writing there via env set/encrypt/delete is effective.
pub fn active_presets_overlay_dir(&self) -> Option<&Path>
Sourcepub fn overlay_git_source(&self) -> Option<(&str, Option<&str>, &Path)>
pub fn overlay_git_source(&self) -> Option<(&str, Option<&str>, &Path)>
Git source for a shine-managed overlay, if configured: (url, branch, managed_dir). Returned regardless of whether the checkout exists yet,
so shine preset pull can clone it on first use.
Sourcepub fn preset_path(&self, relative: impl AsRef<Path>) -> PathBuf
pub fn preset_path(&self, relative: impl AsRef<Path>) -> PathBuf
Resolve a preset file with the overlay taking precedence over the base source.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more