{"record":{"id":"d883b268264bc91d","repo":"clockworklabs/SpacetimeDB","slug":"invalid-repository-format-use-owner-repo-or-ful","errorCode":null,"errorMessage":"Invalid repository format. Use 'owner/repo' or full git clone URL","messagePattern":"Invalid repository format\\. Use 'owner/repo' or full git clone URL","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":1003,"sourceCode":"        Some(value) if value.eq_ignore_ascii_case(\"csharp\") || value.eq_ignore_ascii_case(\"c#\") => \"C#\".to_string(),\n        Some(value) if value.eq_ignore_ascii_case(\"typescript\") => \"TypeScript\".to_string(),\n        Some(value) if value.eq_ignore_ascii_case(\"cpp\") || value.eq_ignore_ascii_case(\"c++\") => \"C++\".to_string(),\n        Some(value) if !value.trim().is_empty() => value.to_string(),\n        _ => \"None\".to_string(),\n    }\n}\n\nfn clone_github_template(repo_input: &str, target: &Path, is_server_only: bool) -> anyhow::Result<()> {\n    let is_git_url = |s: &str| {\n        s.starts_with(\"git@\") || s.starts_with(\"ssh://\") || s.starts_with(\"http://\") || s.starts_with(\"https://\")\n    };\n\n    let repo_url = if is_git_url(repo_input) {\n        repo_input.to_string()\n    } else if repo_input.contains('/') {\n        format!(\"https://github.com/{}\", repo_input)\n    } else {\n        anyhow::bail!(\"Invalid repository format. Use 'owner/repo' or full git clone URL\");\n    };\n\n    println!(\"  Cloning from {}...\", repo_url);\n\n    let temp_dir = tempfile::tempdir()?;\n\n    let mut builder = git2::build::RepoBuilder::new();\n\n    let mut fetch_options = git2::FetchOptions::new();\n    let mut callbacks = git2::RemoteCallbacks::new();\n\n    callbacks.credentials(|_url, username_from_url, allowed_types| {\n        if allowed_types.contains(git2::CredentialType::SSH_KEY)\n            && let Some(username) = username_from_url\n        {\n            return git2::Cred::ssh_key_from_agent(username);\n        }\n        if allowed_types.contains(git2::CredentialType::USER_PASS_PLAINTEXT) {","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/fdd647dfac506d0967cc4492e9fce380706c94cb/crates/cli/src/subcommands/init.rs#L985-L1021","documentation":"When a `--template` value is treated as a GitHub repository to clone, it must either be a full git URL (git@…, ssh://, http://, https://) or a short `owner/repo` form containing a slash. A bare word with no slash and no URL scheme is rejected before any network call happens.","triggerScenarios":"Passing `--template quickstart` (single word, no owner) where the CLI expects `--template someuser/quickstart`; passing an SCP-style shorthand that does not start with git@; a typo that drops the slash.","commonSituations":"Copying a template name from a README that lists only the repo name; mixing up built-in template names with GitHub repo refs; assuming `git@` is optional.","solutions":["Use the `owner/repo` form: `spacetime init myapp --template clockworklabs/quickstart-chat`","Or paste the full HTTPS clone URL: `--template https://github.com/owner/repo`","If you meant a built-in template, use its documented name or run with `--template ''` to list templates"],"exampleFix":"# before\nspacetime init myapp --template quickstart\n# after\nspacetime init myapp --template clockworklabs/quickstart","handlingStrategy":"validation","validationCode":"# accept owner/repo or a full URL before calling init\ncase \"$TPL\" in */*|git@*|ssh://*|http://*|https://*) spacetime init app --template \"$TPL\";; *) echo 'use owner/repo or full URL';; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize template references on the owner/repo form in docs and scripts"],"tags":["spacetime-init","template","git","cli","argument-validation"],"backgroundTag":"invalid-git-repository-url","analyzedSha":"fdd647dfac506d0967cc4492e9fce380706c94cb","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}