pub struct InitArgs {
pub path: PathBuf,
pub schema: String,
pub vcs_shared: bool,
pub no_gitignore: bool,
pub note: Option<String>,
pub reattach: bool,
pub force_overwrite: bool,
pub hard_cleanup_first: bool,
pub operator_mode: bool,
pub write_guidance: Option<String>,
}Expand description
memstead mem init <path> arguments.
--vcs-shared translates into the engine’s vcs block;
--no-gitignore suppresses the outer-repo .gitignore append. The
<path> argument supplies the new mem’s location (relative
to the workspace root) plus its name (basename of the path); a
slashed <a>/<b> form additionally derives --org-path a so
memstead mem init a/b and memstead mem init b --org-path a produce
identical engine calls. Cross-mem edge authorization is
workspace-level policy ([cross_mem_links] in .memstead/workspace.toml); the
previous --belongs-to flag is gone.
Fields§
§path: PathBufMem name — the full hierarchical identifier (e.g. foo for
a flat-layout mem, team/sub-mem for a hierarchical
layout). The value flows through to the engine verbatim with no
auto-split or composition step. Grammar:
[a-z0-9-]+(/[a-z0-9-]+)* — lowercase ASCII letters, digits,
hyphens; segments separated by /; no leading, trailing, or
double slashes (validated engine-side; bad names return
INVALID_INPUT).
schema: StringSchema pin (name@x.y.z) for the new mem. Defaults to
default@1.0.0 so the common case stays one argument.
Pass a shared-gitdir vcs block to memstead_mem_create:
{ "gitdir": "../.git", "worktree": ".." }. Without this flag the
engine uses the default isolated layout.
no_gitignore: boolSkip outer-repo .gitignore auto-append. Useful when the user
intends to track the workspace as a git submodule, or when the
detection heuristic would pick the wrong outer repo.
note: Option<String>Optional provenance note recorded in the seed commit’s body
(≤280 chars). Forwarded as the MCP tool’s note parameter.
reattach: boolAdopt residual entities left by a prior memstead mem unregister
at this mem’s path instead of failing on detected residue.
Default when the residue carries an unregistered_at tombstone
(the deliberate unregister signal); pass --reattach explicitly
to override for crash-residue you have verified is safe to adopt.
Mutually exclusive with --force-overwrite and
--hard-cleanup-first.
force_overwrite: boolDestroy residual storage at this mem’s path and proceed with a
fresh create. Not yet implemented — currently refuses with
INVALID_INPUT pointing at memstead mem delete <name>. Mutually
exclusive with --reattach and --hard-cleanup-first.
hard_cleanup_first: boolRefuse with MEM_STORAGE_RESIDUE_DETECTED instructing the
caller to run memstead mem delete <name> first — a hard barrier
that keeps residue cleanup a separate, named operation rather
than destructive auto-recovery. Mutually exclusive with
--reattach and --force-overwrite.
operator_mode: boolBypass the workspace [[mem_management.create]] allowlist
for this invocation. The CLI honours the allowlist by default
(matching the MCP-surface posture); operator-mode is explicit
opt-in. Also settable via the MEMSTEAD_OPERATOR_MODE=1 env var for
script convenience; the flag wins when both are set. Use this
when the CLI invocation is the operator administering the
workspace itself (initial scaffold, recovery flows) rather than
scripted/agent usage.
write_guidance: Option<String>Optional per-instance writing guidance as a JSON object, written
verbatim into the new mem’s config writeGuidance map — e.g.
--write-guidance '{"phase_context":"early design","stack":"Rust"}'.
Opaque to the engine (schema-strictness D8 — the keys are
client-owned vocabulary); a wrapper that read the schema
package’s mem-template.json fills the instance keys. Omit to
seed no guidance. Must be a JSON object; anything else refuses
with INVALID_INPUT.
Trait Implementations§
Source§impl Args for InitArgs
impl Args for InitArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for InitArgs
impl FromArgMatches for InitArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for InitArgs
impl RefUnwindSafe for InitArgs
impl Send for InitArgs
impl Sync for InitArgs
impl Unpin for InitArgs
impl UnsafeUnpin for InitArgs
impl UnwindSafe for InitArgs
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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