wavetermdev/waveterm · error
no arguments. wsh wavepath requires a type argument (config,
Error message
no arguments. wsh wavepath requires a type argument (config, data, or log)
What it means
`wsh wavepath` prints Wave's config, data, or log directory path. wavepathRun requires exactly one positional argument naming the type; with zero arguments it prints help and returns this error naming the valid types.
Source
Thrown at cmd/wsh/cmd/wshcmd-wavepath.go:38
RunE: wavepathRun,
PreRunE: preRunSetupRpcClient,
}
func init() {
wavepathCmd.Flags().BoolP("open", "o", false, "Open the path in a new block")
wavepathCmd.Flags().BoolP("open-external", "O", false, "Open the path in the default external application")
wavepathCmd.Flags().BoolP("tail", "t", false, "Tail the last 100 lines of the log")
rootCmd.AddCommand(wavepathCmd)
}
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")View on GitHub (pinned to a4447c1563)
Solutions
- Run with a type: `wsh wavepath config`, `wsh wavepath data`, or `wsh wavepath log`
- Guard scripted usage: `[ -n "$TYPE" ] && wsh wavepath "$TYPE"`
- Use `wsh wavepath --help` for usage
Example fix
// before $ wsh wavepath // after $ wsh wavepath config
Defensive patterns
Strategy: validation
Validate before calling
if [ -z "$TYPE" ]; then echo "usage: wsh wavepath <config|data|log>" >&2; exit 2; fi wsh wavepath "$TYPE"
Prevention
- Always supply one of config|data|log
- Validate script variables before expansion
When it happens
Trigger: Running `wsh wavepath` with no argument, or via a script where the type variable is empty (`wsh wavepath $TYPE` with TYPE unset).
Common situations: Forgetting the subargument after upgrade; examples/copied commands missing the type; empty variable expansion in shell scripts.
Related errors
- stdin (-) can only be used once
- no arguments. wsh %s requires a file or URL as an argument
- too many arguments. wsh %s requires exactly one argument
- too many arguments. wsh wavepath requires exactly one argume
- invalid path type %q. must be one of: config, data, log
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/afb23960d4e6924c.
Report an issue: GitHub.