chenhg5/cc-connect · error

tuitui platform not found in project %q

Error message

tuitui platform not found in project %q

What it means

loadTuiTuiPlatform looks up the tuitui platform section in the config. When --project is explicitly given but that project either doesn't exist or has no tuitui platform entry, findTuiTuiOptions returns found=false and this error names the project string. Distinguishes an explicit-but-wrong project selection from the ambiguous case (error 448).

Source

Thrown at cmd/cc-connect/tuitui.go:389

var errTuiTuiUsage = errors.New("show tuitui usage")

func loadTuiTuiPlatform(opts tuituiCLIOptions) (*tuitui.Platform, error) {
	platformOpts := map[string]any{}
	if opts.configPath != "" {
		cfg, err := config.Load(opts.configPath)
		if err != nil {
			if opts.configSet {
				return nil, err
			}
		} else {
			var found bool
			platformOpts, found, err = findTuiTuiOptions(cfg, opts)
			if err != nil {
				return nil, err
			}
			if opts.project != "" && !found {
				return nil, fmt.Errorf("tuitui platform not found in project %q", opts.project)
			}
		}
	}
	if opts.appID != "" {
		platformOpts["app_id"] = opts.appID
	}
	if opts.appSecret != "" {
		platformOpts["app_secret"] = opts.appSecret
	}
	if opts.apiBase != "" {
		platformOpts["api_base"] = opts.apiBase
	}
	if platformOpts["app_id"] == nil || platformOpts["app_id"] == "" {
		platformOpts["app_id"] = os.Getenv("TUITUI_APP_ID")
	}
	if platformOpts["app_secret"] == nil || platformOpts["app_secret"] == "" {
		platformOpts["app_secret"] = os.Getenv("TUITUI_APP_SECRET")
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. List projects in your config.toml and verify the tuitui platform block exists under the named project
  2. Fix the --project spelling to match the config key exactly
  3. Verify --config points at the intended config file
  4. Add a tuitui platform section to the project if it is missing

Example fix

// before (config lacks tuitui under myproj)
[projects.myproj]
# only feishu configured
// after
[projects.myproj.platforms.tuitui]
app_id = "cli_xxx"
app_secret = "..."
Defensive patterns

Strategy: validation

Validate before calling

cfg, _ := config.Load(path)
proj, ok := cfg.Projects[projectName]
if !ok || !hasPlatform(proj, "tuitui") {
	return fmt.Errorf("project %q has no tuitui platform", projectName)
}

Try / catch

cli, err := loadTuiTuiPlatform(opts)
if err != nil {
	if strings.Contains(err.Error(), "not found in project") {
		slog.Warn("check --project name and config.toml", "err", err)
	}
	return err
}

Prevention

When it happens

Trigger: `--project myproj` where config.toml has no [projects.myproj.platforms.tuitui] (or equivalent tuitui platform block), in runTuiTuiMessages/runTuiTuiPost via loadTuiTuiPlatform.

Common situations: Typo in project name; project renamed/removed in config; expecting tuitui to be configured in a project that only has feishu/telegram platforms; wrong --config path pointing at a different file.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — 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/6180ca9f1f6bf04e. Report an issue: GitHub.