[BUG] crewai tool create/install/login exit 0 when they fail
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
The six failing paths are listed by line number in lib/cli/src/crewai_cli/tools/main.py: create (lines 77 and 310), install (219, 224, 297) and login (255). Each bare raise SystemExit should become raise SystemExit(1), matching the existing publish failures in the same file. Reproduce by running crewai tool create demo twice and checking echo $?; done means every listed failure path returns a non-zero status.
Written by the indexing model from the issue text.
Description
Description
Several failure paths in lib/cli/src/crewai_cli/tools/main.py end with a bare raise SystemExit. SystemExit() carries code None, which the interpreter reports as exit status 0, so the commands print their error and report success to scripts and CI:
| Line | Command | Failure |
|---|---|---|
| 77 | crewai tool create |
target folder already exists |
| 219 | crewai tool install |
API returned 404 (no such tool) |
| 224 | crewai tool install |
API returned any non-200 status |
| 255 | crewai tool login |
login endpoint returned non-200 |
| 297 | crewai tool install |
uv add wrote to stderr |
| 310 | crewai tool create |
run from inside an existing project |
The same file already uses raise SystemExit(1) for the failures in publish (and for _require_project_utils / _require_get_user_id), so these are omissions rather than a deliberate choice.
Steps to Reproduce
$ crewai tool create demo
Creating custom tool demo...
...
$ crewai tool create demo
Folder demo already exists.
$ echo $?
0
$ cd /path/to/any/crewai/project # a directory with pyproject.toml
$ crewai tool create demo
Oops! It looks like you're inside a project.
You can't create a new tool while inside an existing project.
Tip: Navigate to a different directory and try again.
$ echo $?
0
crewai tool install <tool-that-does-not-exist> and a failed crewai tool login behave the same: message on stdout, exit status 0.
Expected Behavior
Every failure above should exit with a non-zero status (for example raise SystemExit(1)), so a script or CI job can tell a failed crewai tool command from a successful one.
AI assistance
I used an AI coding agent to investigate, reproduce, and prepare this report, and reviewed its results. Per CONTRIBUTING.md, please apply the llm-generated label; external contributors cannot add it with my current permissions.
- Dominant language
- Python
- Stars
- 61.2k
- Forks
- 9.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 228
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from crewAIInc/crewAI
-
[BUG] BraveSearchTool ignores the documented api_key argumentPossibly taken @Kiko0301 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
APIKeyAuth cookie mode overwrites existing Cookie headersPossibly taken @Kiko0301 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
crewAIInc/crewAI#9706 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG] Agent.copy() shares the LLM's additional_params and token usagePossibly taken @HanYuanLu claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
crewAIInc/crewAI#9587 · 1 comment ·
Maintainers usually reply within 1 day
-
[FEATURE] Document a single-agent workflow with skillsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
All issues in crewAIInc/crewAI
Similar issues
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
docling-project/docling-core#1067 ·
Maintainers usually reply within 3 days
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 85/100
acl-org/acl-anthology#11101 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vllm-project/compressed-tensors#1033 ·
Maintainers usually reply within 3 days
-
chore kaizen ui-rewrite
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
IBM/mcp-context-forge#7681 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
awesomedata/apd-core#1216 ·
Maintainers usually reply within 4 days