kovidgoyal/kitty · error

No command line arguments are allowed

Error message

No command line arguments are allowed

What it means

The update-self kitten command refuses any positional command line arguments; it only accepts options. The Run function checks len(args) != 0 and fails immediately with exit code 1.

Source

Thrown at tools/cmd/update_self/main.go:79

	} else {
		err = tui.DownloadFileWithProgress(exe, url, true)
		if err != nil {
			return err
		}
	}
	fmt.Print("Updated to: ")
	return unix.Exec(exe, []string{"kitten", "--version"}, os.Environ())
}

func EntryPoint(root *cli.Command) *cli.Command {
	sc := root.AddSubCommand(&cli.Command{
		Name:             "update-self",
		Usage:            "[options]",
		ShortDescription: "Update this kitten binary",
		HelpText:         "Update this kitten binary in place to the latest available version.",
		Run: func(cmd *cli.Command, args []string) (ret int, err error) {
			if len(args) != 0 {
				return 1, fmt.Errorf("No command line arguments are allowed")
			}
			opts := &Options{}
			err = cmd.GetOptionValues(opts)
			if err != nil {
				return 1, err
			}
			return 0, update_self(opts.FetchVersion)
		},
	})
	sc.Add(cli.OptionSpec{
		Name:    "--fetch-version",
		Default: "latest",
		Help:    fmt.Sprintf("The version to fetch. The special words :code:`latest` and :code:`nightly` fetch the latest stable and nightly release respectively. Other values can be, for example: :code:`%s`.", kitty.VersionString),
	})
	return sc
}

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Remove all positional arguments from the update-self command line
  2. If you meant to pass a version or channel, check `kitten update-self --help` for the supported options and use flag syntax
  3. Quote shell variables used in the command to prevent word-splitting into extra args

Example fix

# before
kitten update-self v0.35.0
# after
kitten update-self
Defensive patterns

Strategy: validation

Validate before calling

args := cmd.Args().Slice()
if len(args) != 0 {
    fmt.Fprintf(os.Stderr, "update-self takes no positional arguments\n")
    return 1
}

Prevention

When it happens

Trigger: Running kitten's update-self subcommand with any trailing argument, e.g. `kitten update-self foo` or passing a version string positionally instead of via an option flag.

Common situations: Users assuming the command takes a target version argument, or shell scripts appending stray arguments/flags after an unquoted variable that expands to multiple words.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/d516c674a9ada844. Report an issue: GitHub.