chenhg5/cc-connect · error

--audio requires a path

Error message

--audio requires a path

What it means

The --audio flag of `cc-connect send` requires a path argument for the audio attachment. parseSendArgs returns "--audio requires a path" when the flag has no following argument. Like the other attachment flags, this is caught during argument parsing before any I/O.

Source

Thrown at cmd/cc-connect/send.go:127

				return req, "", fmt.Errorf("%s requires a value", args[i])
			}
			i++
			req.TTSText = args[i]
		case "--image":
			if i+1 >= len(args) {
				return req, "", fmt.Errorf("--image requires a path")
			}
			i++
			imagePaths = append(imagePaths, args[i])
		case "--file":
			if i+1 >= len(args) {
				return req, "", fmt.Errorf("--file requires a path")
			}
			i++
			filePaths = append(filePaths, args[i])
		case "--audio":
			if i+1 >= len(args) {
				return req, "", fmt.Errorf("--audio requires a path")
			}
			i++
			audioPaths = append(audioPaths, args[i])
		case "--video":
			if i+1 >= len(args) {
				return req, "", fmt.Errorf("--video requires a path")
			}
			i++
			videoPaths = append(videoPaths, args[i])
		case "--stdin":
			useStdin = true
		case "--at-users":
			if i+1 >= len(args) {
				return req, "", fmt.Errorf("--at-users requires a value")
			}
			i++
			for _, uid := range strings.Split(args[i], ",") {
				uid = strings.TrimSpace(uid)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Append the audio path: `--audio ./voice.ogg`.
  2. Quote paths containing spaces.
  3. Ensure the producing step (recorder/TTS) actually wrote the file and the variable is non-empty.
  4. Repeat --audio for multiple files instead of comma-separating.

Example fix

// before
cc-connect send --audio
// after
cc-connect send --audio ./recordings/note.ogg
Defensive patterns

Strategy: validation

Validate before calling

A=./note.ogg
[ -n "$A" ] || { echo "audio path empty"; exit 1; }
cc-connect send --audio "$A"

Prevention

When it happens

Trigger: `cc-connect send --audio` with no path; `cc-connect send --audio --video v.mp4`; empty variable expansion for the audio path.

Common situations: Recording pipeline failed so the file variable is empty; piping through a script that drops the argument; misunderstanding that --audio takes one path per occurrence.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/046422ac30eff946. Report an issue: GitHub.