{"record":{"id":"c0d79e6594b6c7f0","repo":"crewAIInc/crewAI","slug":"template-name-not-found","errorCode":null,"errorMessage":"Template '{name}' not found.","messagePattern":"Template '(.+?)' not found\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/remote_template/main.py","lineNumber":104,"sourceCode":"                fg=\"yellow\",\n            )\n\n        selected = templates[selected_index]\n        repo_name = selected[\"name\"]\n        self._install_repo(repo_name)\n\n    def add_template(self, name: str, output_dir: str | None = None) -> None:\n        \"\"\"Download a template and copy it into the current working directory.\n\n        Args:\n            name: Template name (with or without the template_ prefix).\n            output_dir: Optional directory name. Defaults to the template name.\n        \"\"\"\n        repo_name = self._resolve_repo_name(name)\n        if repo_name is None:\n            click.secho(f\"Template '{name}' not found.\", fg=\"red\")\n            click.echo(\"Run 'crewai template list' to see available templates.\")\n            raise SystemExit(1)\n\n        self._install_repo(repo_name, output_dir)\n\n    def _install_repo(self, repo_name: str, output_dir: str | None = None) -> None:\n        \"\"\"Download and extract a template repo into the current directory.\n\n        Args:\n            repo_name: Full GitHub repo name (e.g. template_deep_research).\n            output_dir: Optional directory name. Defaults to the template name.\n        \"\"\"\n        folder_name = output_dir or repo_name.removeprefix(TEMPLATE_PREFIX)\n        dest = os.path.join(os.getcwd(), folder_name)\n\n        while os.path.exists(dest):\n            click.secho(f\"Directory '{folder_name}' already exists.\", fg=\"yellow\")\n            folder_name = click.prompt(\n                \"Enter a different directory name (or 'q' to quit)\", type=str\n            )","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/remote_template/main.py#L86-L122","documentation":"Raised by `crewai template add <name>` when RemoteTemplateManager._resolve_repo_name() cannot match the given name to any public repo in the crewAIInc GitHub org whose name starts with the `template_` prefix. It is a user-input validation error: the template catalog was fetched successfully, but nothing matches. The CLI prints the message in red, suggests `crewai template list`, and exits with code 1.","triggerScenarios":"Calling `crewai template add my_template` where no repo named `template_my_template` exists in the org; typos in the template name; passing a name with the `template_` prefix that does not correspond to a real repo; the template was renamed or removed upstream after a doc/page you read.","commonSituations":"Following a tutorial that references a template that no longer exists; casing or underscore mistakes in the name; offline docs listing stale template names.","solutions":["Run `crewai template list` and copy the exact template name from the output.","Retry the add command with the exact name (with or without the `template_` prefix — _resolve_repo_name accepts both).","Check for typos, wrong hyphens/underscores, or trailing whitespace in the name.","If the template should exist, verify it on GitHub under the crewAIInc org and open/update the naming in your docs if it was renamed."],"exampleFix":"# before\n$ crewai template add deep-reserch  # typo\n# Template 'deep-reserch' not found.\n\n# after\n$ crewai template list\n$ crewai template add template_deep_research","handlingStrategy":"validation","validationCode":"from crewai_cli.remote_template.main import RemoteTemplateManager\n\nmgr = RemoteTemplateManager()\navailable = [t[\"name\"] for t in mgr.list_templates()]  # names as published\nif \"template_deep_research\" not in available:\n    raise SystemExit(\"template not in catalog; pick from: \" + \", \".join(available))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always source template names programmatically from `crewai template list`, never hardcode them from docs.","In automation, fetch the catalog first and fail early with the valid options printed.","Treat exit code 1 after this message as 'bad name', not 'network failure' — retrying won't help."],"tags":["template","validation","cli","user-input"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}