MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / open_repository_with_vault

Function open_repository_with_vault

atomic-cli/src/commands/mod.rs:434–438  ·  view source on GitHub ↗

Open the repository at `root` for a command that writes to the vault, creating the vault when it does not exist yet. Vault *writes* — `goal start/stop/resume`, `materialize`, `sync`, `intent new/update/delete/link/attest`, `memory new/write/attest` — open through this helper so a repository created without a vault (`atomic init --no-vault`, or one that never ran `atomic vault init`) works on firs

(root: &Path)

Source from the content-addressed store, hash-verified

432/// path `atomic vault init` uses. It runs at most once: an existing vault is
433/// never re-initialized.
434pub fn open_repository_with_vault(root: &Path) -> CliResult<Repository> {
435 let repo = Repository::open(root).map_err(CliError::from)?;
436 ensure_vault_exists(&repo)?;
437 Ok(repo)
438}
439
440/// One-time implicit vault initialization, announced on stderr so `--json`
441/// output stays parseable.

Callers 11

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls 2

openFunction · 0.85
ensure_vault_existsFunction · 0.85

Tested by 2

runMethod · 0.68
runMethod · 0.68