siyuan-note/siyuan · error

--name is required

Error message

--name is required

What it means

Returned by the `repo untag` subcommand when --name is empty. Removing a tag is keyed by the tag label, so a name is mandatory (there is no --id for untag).

Source

Thrown at kernel/cli/cmd/repo.go:131

			fmt.Printf("[dry-run] Would tag snapshot %s with \"%s\"\n", id, name)
			return nil
		}

		if err := model.TagSnapshot(id, name); err != nil {
			return err
		}
		fmt.Println("ok")
		return nil
	},
}

var repoUntagCmd = &cobra.Command{
	Use:   "untag --name <name>",
	Short: "Remove a tag",
	RunE: func(cmd *cobra.Command, args []string) error {
		name, _ := cmd.Flags().GetString("name")
		if name == "" {
			return fmt.Errorf("--name is required")
		}

		if dryRun {
			fmt.Printf("[dry-run] Would remove snapshot tag \"%s\"\n", name)
			return nil
		}

		if err := model.RemoveTagSnapshot(name); err != nil {
			return err
		}
		fmt.Println("ok")
		return nil
	},
}

var repoCheckoutCmd = &cobra.Command{
	Use:   "checkout --id <id>",
	Short: "Checkout (rollback to) a snapshot",

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Pass the tag label: `repo untag --name <tag>`.
  2. List tags/snapshots first to confirm the exact tag string.

Example fix

# before
siyuan repo untag
# after
siyuan repo untag --name release-1.0
Defensive patterns

Strategy: validation

Validate before calling

[ -n "$TAG" ] || { echo 'repo untag requires --name'; exit 1; }
siyuan repo untag --name "$TAG"

Type guard

n/a (CLI flag validation)

Try / catch

n/a

Prevention

When it happens

Trigger: Running `repo untag` with no --name flag or `--name ""`, before model.RemoveTagSnapshot is called.

Common situations: Forgetting the flag, or assuming untag takes a snapshot ID instead of a tag name.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/a27745ae6c3f4c37. Report an issue: GitHub.