wavetermdev/waveterm · error

invalid path type %q. must be one of: config, data, log

Error message

invalid path type %q. must be one of: config, data, log

What it means

wsh wavepath accepts exactly one argument naming which Wave Terminal path to print: 'config', 'data', or 'log'. This error is thrown by wavepathRun when the argument is any other string. It is a client-side argument validation guard before any RPC is made.

Source

Thrown at cmd/wsh/cmd/wshcmd-wavepath.go:48

func wavepathRun(cmd *cobra.Command, args []string) (rtnErr error) {
	defer func() {
		sendActivity("wavepath", rtnErr == nil)
	}()

	if len(args) == 0 {
		OutputHelpMessage(cmd)
		return fmt.Errorf("no arguments. wsh wavepath requires a type argument (config, data, or log)")
	}
	if len(args) > 1 {
		OutputHelpMessage(cmd)
		return fmt.Errorf("too many arguments. wsh wavepath requires exactly one argument")
	}

	pathType := args[0]
	if pathType != "config" && pathType != "data" && pathType != "log" {
		OutputHelpMessage(cmd)
		return fmt.Errorf("invalid path type %q. must be one of: config, data, log", pathType)
	}

	tail, _ := cmd.Flags().GetBool("tail")
	if tail && pathType != "log" {
		return fmt.Errorf("--tail can only be used with the log path type")
	}

	open, _ := cmd.Flags().GetBool("open")
	openExternal, _ := cmd.Flags().GetBool("open-external")

	tabId := getTabIdFromEnv()
	if tabId == "" {
		return fmt.Errorf("no WAVETERM_TABID env var set")
	}

	path, err := wshclient.PathCommand(RpcClient, wshrpc.PathCommandData{
		PathType:     pathType,
		Open:         open,

View on GitHub (pinned to a4447c1563)

Solutions

  1. Run the command with one of the exact keywords: `wsh wavepath config`, `wsh wavepath data`, or `wsh wavepath log`.
  2. Run `wsh wavepath --help` to see the accepted values.
  3. Check scripts for typos or stale path type names from older wsh versions.

Example fix

// before
wsh wavepath logs --tail
// after
wsh wavepath log --tail
Defensive patterns

Strategy: validation

Validate before calling

p=$(case "$1" in config|data|log) echo "$1";; *) echo "invalid: $1 (use config|data|log)" >&2; exit 2;; esac)

Type guard

func isValidPathType(s string) bool { return s == "config" || s == "data" || s == "log" }

Prevention

When it happens

Trigger: Running `wsh wavepath <arg>` where <arg> is not exactly "config", "data", or "log" (e.g. typo like `wsh wavepath logs`, `wsh wavepath --tail` alone, or an extra positional arg being interpreted as the path type).

Common situations: Users guessing path type names (e.g. 'conf', 'logs', 'home'), scripting with variable path types from old wsh versions, or accidentally passing a filename as the argument.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/0ba3594580676503. Report an issue: GitHub.