jdx/mise · error

unknown trigger ; use save, agent, or update

Error message

unknown trigger {other:?}; use save, agent, or update

What it means

`mise dot save` validates its trigger positional argument against the exact strings save, agent, and update. Any other value is rejected before any history work happens. This prevents silently recording checkpoints with unrecognized provenance.

Solutions

  1. Use one of: save, agent, or update
  2. Check `mise dot save --help` for the accepted trigger values

Example fix

// before
mise dot save manual
// after
mise dot save update
Defensive patterns

Strategy: validation

Validate before calling

case "$trigger" in
  save|agent|update) ;;
  *) echo "invalid trigger: $trigger"; exit 2 ;;
esac

Try / catch

out=$(mise dot save "$trigger" 2>&1) || {
  echo "$out"   # includes the accepted trigger names
  exit 1
}

Prevention

When it happens

Trigger: Calling `mise dot save <trigger>` with any string other than save, agent, or update, e.g. `mise dot save manual`.

Common situations: Typos in scripted invocations; older scripts using a trigger name that was removed or renamed; users guessing at valid trigger names.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9f204b04438334e3. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/dotfiles/save.rs:70

        tracked: &crate::system::history::tracked::TrackedSet,
        draft: Draft,
    ) -> Result<()> {
        match self.capture(store, tracked, draft) {
            Ok(()) => Ok(()),
            Err(err) if self.best_effort => {
                warn!("history save: {err:#}");
                Ok(())
            }
            Err(err) => Err(err),
        }
    }

    async fn save(self) -> Result<()> {
        let trigger = match self.trigger.as_str() {
            "save" => Trigger::Save,
            "agent" => Trigger::Agent,
            "update" => Trigger::Update,
            other => bail!("unknown trigger {other:?}; use save, agent, or update"),
        };
        if !crate::config::Settings::get().history.enabled {
            bail!("history is disabled (history.enabled = false)");
        }
        let (store, tracked, entries) = super::history::open().await?;
        if !self.paths.is_empty() {
            let walk = tracked.walk()?;
            for path in &self.paths {
                let path = normalize_target(path);
                let captured = walk.files.keys().any(|file| file.starts_with(&path));
                if !captured {
                    // saving a deleted manual-save path saves the deletion,
                    // provided the path was captured before (a path that
                    // never existed is not a deletion)
                    let deletion = tracked
                        .entry_for(&path)
                        .is_some_and(|entry| !entry.policy.autosave)
                        && std::fs::symlink_metadata(&path)

View on GitHub (pinned to 533346cc37)