zed-industries/zed · error

usage: collab <version | migrate | seed | serve <api|collab|

Error message

usage: collab <version | migrate | seed | serve <api|collab|llm|all>>

What it means

Returned by the collab binary's main argument dispatch when the first argument matches none of version | migrate | seed | serve. This is the top-level usage string; note it advertises 'llm' as a serve mode, which can differ from the serve-level usage message in the same file — a sign that accepted subcommands vary across versions of the binary.

Source

Thrown at crates/collab/src/main.rs:178

                futures::future::select(ctrl_break, ctrl_c).await;
            };

            axum::Server::from_tcp(listener)
                .map_err(|e| anyhow!(e))?
                .serve(app.into_make_service_with_connect_info::<SocketAddr>())
                .with_graceful_shutdown(async move {
                    signal.await;
                    tracing::info!("Received interrupt signal");

                    if let Some(on_shutdown) = on_shutdown {
                        on_shutdown();
                    }
                })
                .await
                .map_err(|e| anyhow!(e))?;
        }
        _ => {
            Err(anyhow!(
                "usage: collab <version | migrate | seed | serve <api|collab|llm|all>>"
            ))?;
        }
    }
    Ok(())
}

async fn setup_app_database(config: &Config) -> Result<()> {
    let db_options = db::ConnectOptions::new(config.database_url.clone());
    let mut db = Database::new(db_options).await?;

    db.initialize_notification_kinds().await?;

    Ok(())
}

async fn handle_root(Extension(mode): Extension<ServiceMode>) -> String {
    format!("zed:{mode} v{VERSION} ({})", REVISION.unwrap_or("unknown"))

View on GitHub (pinned to bc538def45)

Solutions

  1. Run one of: collab version, collab migrate, collab seed, collab serve <api|collab|llm|all>
  2. Run 'collab version' first to confirm the binary and its expected subcommand set
  3. Inspect the wrapper script/systemd unit/Dockerfile CMD for stray or missing arguments

Example fix

# before
collab start

# after
collab serve all
Defensive patterns

Strategy: validation

Validate before calling

# Validate subcommand in wrappers before invoking the binary.
SUB="${1:?usage: collab <version|migrate|seed|serve> }"
case "$SUB" in version|migrate|seed|serve) ;; *) echo "unknown subcommand: $SUB" >&2; exit 2 ;; esac
exec collab "$SUB" "${@:2}"

Prevention

When it happens

Trigger: Running 'collab foo', 'collab run', or an older subcommand that was removed; an empty first argument from an unquoted shell variable; invoking the binary through a wrapper that prepends unexpected words.

Common situations: Upgrade/downgrade mismatches between the binary and deployment scripts; wrappers that inject flags before the subcommand; documentation drift between versions.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/ec658f4bf8ea8f56. Report an issue: GitHub.