wavetermdev/waveterm · error

unknown --view %q; try one of: term, web, preview, edit, sys

Error message

unknown --view %q; try one of: term, web, preview, edit, sysinfo, waveai

What it means

Validation error from `wsh blocks list --view`. The command accepts only a fixed set of view filter values (term, web, preview, edit, sysinfo, waveai); any other value passed to --view is rejected before any RPC is made. It is a pure input-validation failure controlled entirely by the user's flag value.

Source

Thrown at cmd/wsh/cmd/wshcmd-blocks.go:103

		}
	}

	blocksCmd := &cobra.Command{
		Use:     "blocks",
		Short:   "Manage blocks",
		Long:    "Commands for working with blocks",
	}

	blocksCmd.AddCommand(blocksListCmd)
	rootCmd.AddCommand(blocksCmd)
}

// blocksListRun implements the 'blocks list' command
// It retrieves and displays blocks with optional filtering by workspace, window, tab, or view type
func blocksListRun(cmd *cobra.Command, args []string) error {
	if v := strings.TrimSpace(blocksView); v != "" {
		if !isKnownViewFilter(v) {
			return fmt.Errorf("unknown --view %q; try one of: term, web, preview, edit, sysinfo, waveai", v)
		}
	}

	var allBlocks []BlockDetails

	workspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})
	if err != nil {
		return fmt.Errorf("failed to list workspaces: %v", err)
	}

	if len(workspaces) == 0 {
		return fmt.Errorf("no workspaces found")
	}

	var workspaceIdsToQuery []string

	// Determine which workspaces to query
	if blocksWorkspaceId != "" && blocksWindowId != "" {

View on GitHub (pinned to a4447c1563)

Solutions

  1. Use one of the exact accepted values: term, web, preview, edit, sysinfo, waveai
  2. Run `wsh blocks list --help` to see the currently supported --view values for your build
  3. Trim/lowercase the input in scripts before passing it to --view

Example fix

// before
wsh blocks list --view terminal
// after
wsh blocks list --view term
Defensive patterns

Strategy: validation

Validate before calling

var validViews = map[string]bool{"term":true,"web":true,"preview":true,"edit":true,"sysinfo":true,"waveai":true}
if !validViews[strings.TrimSpace(view)] {
    return fmt.Errorf("--view must be one of term, web, preview, edit, sysinfo, waveai")
}

Try / catch

if err := runBlocksList(); err != nil && strings.Contains(err.Error(), "unknown --view") {
    // correct the flag value and retry
}

Prevention

When it happens

Trigger: Calling `wsh blocks list --view <value>` where <value> is not exactly one of term, web, preview, edit, sysinfo, waveai — including typos (e.g. 'terminal' instead of 'term'), wrong casing if the check is case-sensitive, or empty/whitespace-padded strings that survive TrimSpace.

Common situations: Typing the long view name instead of the short one; guessing view names from the UI instead of the documented set; scripting with a variable that contains an unexpected value; older/newer builds where the allowed list differs.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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