wavetermdev/waveterm · error
--tail can only be used with the log path type
Error message
--tail can only be used with the log path type
What it means
The --tail flag streams the log file, so it is only meaningful with the 'log' path type. wavepathRun rejects any combination of --tail with 'config' or 'data'. This is pure client-side flag validation.
Source
Thrown at cmd/wsh/cmd/wshcmd-wavepath.go:53
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,
OpenExternal: openExternal,
TabId: tabId,
}, nil)
if err != nil {
return fmt.Errorf("getting path: %w", err)View on GitHub (pinned to a4447c1563)
Solutions
- Use --tail only with `wsh wavepath log`.
- Remove --tail when requesting the config or data path.
- Split the script: print the path without --tail, tail separately with `wsh wavepath log --tail`.
Example fix
// before wsh wavepath config --tail // after wsh wavepath config wsh wavepath log --tail
Defensive patterns
Strategy: validation
Validate before calling
[ "$pathType" = "log" ] || unset tailFlag # only pass --tail for log
Type guard
func tailAllowed(pathType string) bool { return pathType == "log" } Prevention
- Only combine --tail with `wsh wavepath log`.
- In scripts, gate the flag on the path type.
- Read --help output for flag constraints.
When it happens
Trigger: Running `wsh wavepath config --tail` or `wsh wavepath data --tail`.
Common situations: Users copying a `wsh wavepath log --tail` invocation and swapping the path type while keeping --tail, or scripts that always append --tail.
Related errors
- no files or message provided
- too many files (maximum %d files allowed)
- stdin (-) can only be used once
- WAVETERM_TABID environment variable not set
- resolving block: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/48328d7bff5834b0.
Report an issue: GitHub.