chenhg5/cc-connect · error
missing --channel
Error message
missing --channel
What it means
A sentinel validation error raised by runTuiTuiPost when the parsed tuitui options contain an empty --channel value. It fires because posting a message requires a destination channel ID that was not supplied.
Source
Thrown at cmd/cc-connect/tuitui.go:143
outPath := filepath.Join(outDir, filepath.Base(name))
if err := os.WriteFile(outPath, data, 0o644); err != nil {
fatalTuiTui(err)
}
printJSON(map[string]any{
"path": outPath,
"mime_type": mimeType,
"filename": name,
"size": len(data),
})
}
func runTuiTuiPost(args []string) {
opts, err := parseTuiTuiArgs(args)
if err != nil {
fatalTuiTui(err)
}
if opts.channelID == "" {
fatalTuiTui(errors.New("missing --channel"))
}
message := opts.message
if opts.stdin {
data, err := io.ReadAll(os.Stdin)
if err != nil {
fatalTuiTui(fmt.Errorf("read stdin: %w", err))
}
message = string(data)
}
if strings.TrimSpace(message) == "" {
fatalTuiTui(errors.New("missing --message or --stdin"))
}
p, err := loadTuiTuiPlatform(opts)
if err != nil {
fatalTuiTui(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()View on GitHub (pinned to 4000b2338a)
Solutions
- Add `--channel <channel_id>` to the post command
- Look up the channel id in the TuiTui platform settings
- If the message should go to a chat instead, use the appropriate subcommand's flag
Example fix
// before cc-connect tuitui post --message "hi" // after cc-connect tuitui post --channel C012345 --message "hi"
Defensive patterns
Strategy: validation
Validate before calling
if channelID == "" {
return errors.New("post requires --channel")
} Prevention
- Keep the channel id in a script/config variable instead of typing it each time
- Don't confuse --channel (post) with --chat (messages/search)
- Verify channel ids after platform reconfigurations
When it happens
Trigger: Running `cc-connect tuitui post` without `--channel <id>`, or with an empty value for the flag.
Common situations: Hardcoded scripts where the channel id was never filled in, team members running a shared command that assumes a default channel, or confusing --channel with --chat used by the messages subcommand.
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/afa3e4d5753c27d7.
Report an issue: GitHub.