{"record":{"id":"7fac36b0c1782ad3","repo":"crewAIInc/crewAI","slug":"no-organisation-set-run-crewai-org-switch-org-i","errorCode":null,"errorMessage":"No organisation set. Run `crewai org switch <org_id>` first, or pass --org.","messagePattern":"No organisation set\\. Run `crewai org switch <org_id>` first, or pass --org\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/skills/main.py","lineNumber":263,"sourceCode":"            console.print(\n                \"[red]SKILL.md frontmatter must include a 'name' field.[/red]\"\n            )\n            raise SystemExit(1)\n\n        if not version:\n            console.print(\n                \"[red]SKILL.md frontmatter must include a 'version' field before publishing.[/red]\"\n            )\n            raise SystemExit(1)\n\n        settings = Settings()\n        effective_org = org or settings.org_name\n        if not effective_org:\n            console.print(\n                \"[red]No organisation set. Run `crewai org switch <org_id>` first, \"\n                \"or pass --org.[/red]\"\n            )\n            raise SystemExit(1)\n\n        self._print_current_organization()\n        console.print(\n            f\"[bold blue]Publishing skill [bold]{name}[/bold] v{version} to {effective_org}...[/bold blue]\"\n        )\n\n        archive_bytes = self._build_skill_tarball()\n        encoded_file = \"data:application/x-gzip;base64,\" + base64.b64encode(\n            archive_bytes\n        ).decode(\"utf-8\")\n\n        response = self.plus_api_client.publish_skill(\n            org=effective_org,\n            name=name,\n            version=version,\n            is_public=False,\n            description=description,\n            encoded_file=encoded_file,","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/skills/main.py#L245-L281","documentation":"Publishing needs an organization to scope the skill to. The effective org is `org` (from `--org`) or, falling back, `settings.org_name` from local CLI settings. When both are unset the CLI cannot determine the target namespace and exits, pointing at `crewai org switch`.","triggerScenarios":"Running `crewai skill publish` with no `--org` flag on a machine where `Settings().org_name` is empty — typically a fresh install, after logout, or after settings were reset/deleted (`~/.crewai` config cleared).","commonSituations":"First publish on a new workstation; CI runners with no persistent settings file; a team member who has never run any org command; settings file removed by a cleanup script.","solutions":["Run `crewai org switch <org_id>` once to persist the org in settings, then retry `crewai skill publish`.","Or pass it per-invocation: `crewai skill publish --org <org_id>`.","Verify with `crewai org show` (or equivalent status command) that an org is active before publishing."],"exampleFix":"# before\ncrewai skill publish   # No organisation set.\n\n# after\ncrewai org switch acme-prod\ncrewai skill publish\n# or\ncrewai skill publish --org acme-prod","handlingStrategy":"validation","validationCode":"import subprocess, json\n\ndef org_is_set() -> bool:\n    settings = json.loads(subprocess.run(\n        [\"crewai\", \"org\", \"show\"], capture_output=True, text=True\n    ).stdout or \"{}\")\n    return bool(settings.get(\"org_name\"))\n\n# guard: crewai org switch <org_id> unless org_is_set()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `crewai org switch <org_id>` as the first step on any new machine or CI runner.","Pass `--org <org_id>` explicitly in automation to avoid dependence on local settings.","Check active org before publishing rather than debugging after the failure."],"tags":["cli","configuration","auth","publish","skill"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}