Commit Graph

23 Commits

Author SHA1 Message Date
Greyson Lalonde
fb045534aa refactor(core): lift Settings, TokenManager, and tool-credentials into crewai-core
- New crewai_core.{settings,token_manager,tool_credentials} absorb the previously
  duplicated Settings class (~200 LOC), TokenManager (~185 LOC), and
  build_env_with_*_credentials helpers from both crewai and crewai-cli.
- crewai_core.constants gains the OAuth2/enterprise URL constants.
- crewai.settings, crewai.auth.token_manager, crewai_cli.config, and
  crewai_cli.shared.token_manager are now thin re-export shims (deprecation
  warnings on the crewai.* paths; crewai_cli.* paths kept silent re-exports).
- Internal callers (plus_api, auth.token, auth.oauth2, agent_utils,
  trace_batch_manager) migrated to crewai_core.* imports.
- Tests updated to patch crewai_core.{settings,token_manager}.* paths.
- crewai-core gains pydantic, cryptography, tomli deps; crewai-cli's redundant
  cryptography dep can stay (still imported by crewai_cli.shared.token_manager
  shim users) — no behavior change.
- Standalone CLI smoke still passes; crewai's full mypy (471 files) clean.
2026-05-05 14:20:41 +08:00
Greyson Lalonde
8b641014aa refactor(core): consolidate TOML/project helpers into crewai_core.project 2026-05-05 13:02:46 +08:00
Greyson Lalonde
60f3df793f refactor(core): extract crewai-core for shared utilities and standalone CLI
- New lib/crewai-core/ package: version, paths, constants, lock_store, user_data,
  printer, telemetry. Pure leaf — depends only on appdirs/portalocker/rich/otel.
- crewai now depends on crewai-core; old crewai.utilities.{version,paths,printer,
  lock_store} and the user-data block of events/listeners/tracing/utils.py become
  one-shot DeprecationWarning shims that re-export from crewai_core.
- crewai-cli drops its hard dep on crewai and depends only on crewai-core. CLI
  imports for telemetry/version/printer/constants now point at crewai_core.
- tools/main.py lazy-imports project_utils + get_user_id; the publish/login
  subcommands print a friendly "requires crewai" error if it's missing.
- crewai-cli is now genuinely standalone: 'crewai --help', 'version', 'login',
  'config', 'traces', 'create', 'template' all work without crewai installed.
- 351 CLI tests + 9 crewai-core smoke tests + crewai's full mypy (471 files) clean.
2026-05-05 12:41:28 +08:00
Greyson Lalonde
d1934dabc0 fix(cli): declare crewai dependency and drop standalone claim from docs 2026-05-05 09:21:52 +08:00
Greyson Lalonde
a136d63dde chore(cli): align version with crewai 1.14.5a2 via hatch dynamic source 2026-05-05 09:05:24 +08:00
Greyson Lalonde
a8a6a888e4 fix(task_outputs): explicit columns and tolerate corrupt JSON rows 2026-05-05 08:42:15 +08:00
Greyson Lalonde
4cef5de586 fix(cli): declare cryptography dependency for Fernet and RS256 JWT 2026-05-05 08:37:23 +08:00
Greyson Lalonde
b8c671042c fix(traces): align consent semantics with framework, clarify enable message 2026-05-05 05:18:25 +08:00
Greyson Lalonde
dc9e033571 refactor(deploy): drop redundant _validate_project_structure 2026-05-05 05:10:00 +08:00
Greyson Lalonde
94bd89f4e2 fix(deploy): honor --skip-validate for preflight project-structure check 2026-05-05 05:01:50 +08:00
Greyson Lalonde
97b7cede2c fix(cli): scope deploy preflight to push paths and skip flow telemetry on early exit 2026-05-05 04:50:59 +08:00
Greyson Lalonde
0edf2bcc75 fix(cli): honor positive trace consent and drop dead tool-export helpers 2026-05-05 04:45:15 +08:00
Greyson Lalonde
48fa7dcc9b fix(cli): restore parity with main 2026-05-05 04:35:26 +08:00
Greyson Lalonde
778130cfc7 fix: resolve mypy errors after merge
- Re-export get_crewai_version explicitly so consumers stop getting
  attr-defined.
- Drop the telemetry call in TemplateCommand.add_template; the
  standalone CLI's BaseCommand intentionally has no _telemetry, matching
  the choice already made for DeployCommand.
- Add the user_identifier kwarg to crewai_cli's
  PlusAPI.login_to_tool_repository so tools.main.login keeps working
  and the surface matches crewai.plus_api.
- Update the lib/cli login tests for the new json={} payload.
2026-05-05 03:50:09 +08:00
Greyson Lalonde
bed0246438 chore: address github-code-quality findings 2026-05-05 03:01:04 +08:00
Greyson Lalonde
bada7fd909 chore: merge main into gl/chore/refactor-cli
Resolve conflicts from origin/main: relocate new CLI additions
(checkpoint_tui, deploy/validate, remote_template, content_crew
templates) into lib/cli, rewrite imports for the standalone
crewai-cli package, port main's trained_agents_file param and
predeploy validation, and bump python-dotenv/pydantic in
crewai-cli to match crewai's constraints. Add the new
mark_ephemeral_trace_batch_as_failed method to the relocated
crewai.plus_api. Update tests for the new payload field, deploy
--skip-validate kwarg, and crewai_cli import paths.
2026-05-05 02:00:39 +08:00
Greyson Lalonde
7afca5daab refactor: remove cli/ from crewai package and relocate to proper modules
Move framework infrastructure out of crewai/cli/ to dedicated modules:
- cli/authentication/ → crewai/auth/
- cli/config.py → crewai/settings.py
- cli/constants.py → crewai/constants.py
- cli/plus_api.py → crewai/plus_api.py
- cli/version.py → crewai/version.py
- cli/crew_chat.py → crewai/utilities/crew_chat.py
- cli/reset_memories_command.py → crewai/utilities/reset_memories.py
- cli/utils.py (framework parts) → crewai/utilities/project_utils.py

Delete CLI-only duplicates (command.py, git.py, provider.py) already
present in crewai_cli. Replace _login_to_tool_repository with a
_post_login() hook in AuthenticationCommand. Update all imports and
mock.patch paths across both packages and tests.
2026-03-15 19:39:55 -04:00
Greyson LaLonde
8fd7a73423 fix(deploy): add pre-flight validation before deployment
Validate that pyproject.toml, a lockfile (uv.lock or poetry.lock),
and the expected src/<project>/crew.py or config directory exist
locally before making any API calls. This surfaces clear, actionable
errors on the CLI instead of cryptic server-side deployment failures.
2026-03-14 22:21:02 -04:00
Greyson LaLonde
b7bd7aea50 Merge branch 'main' into gl/chore/refactor-cli
# Conflicts:
#	lib/crewai/src/crewai/cli/cli.py
2026-03-14 22:17:02 -04:00
Greyson LaLonde
96fc584ab8 refactor: remove CLI from crewai package and add backward-compat shim
Remove all CLI modules and tests that have been moved to the
crewai-cli package. Replace cli.py with a thin shim that re-exports
from crewai_cli when available, or shows an install hint otherwise.

Update crewai pyproject.toml to add a [cli] extra pointing to
crewai-cli and comment out the old entry point. Add py.typed marker
to crewai_cli for mypy compatibility.
2026-03-14 22:12:38 -04:00
Greyson LaLonde
3732de7b88 test: add CLI tests to crewai-cli package
Move and adapt all CLI tests from lib/crewai/tests/cli/ to
lib/cli/tests/, updating import paths from crewai.cli.* to
crewai_cli.* and adjusting mock targets accordingly.
2026-03-14 22:09:38 -04:00
Greyson LaLonde
4f9a8f4112 refactor: move CLI source modules to crewai-cli package
Copy all CLI source modules from lib/crewai/src/crewai/cli/ to the
new lib/cli/src/crewai_cli/ package, updating internal imports from
crewai.cli.* to crewai_cli.* throughout.

Includes: authentication, deploy, enterprise, organization, settings,
tools, triggers, templates, and all top-level CLI command modules.

Also excludes lib/cli/ from pre-commit mypy checks to match existing
behavior (original CLI code has the same type gaps).
2026-03-14 22:08:48 -04:00
Greyson LaLonde
c0689aa6dc chore: scaffold crewai-cli package and update workspace config
Add the new lib/cli package skeleton with pyproject.toml, README,
and __init__.py. Register it as a uv workspace member and update
root linting, mypy, bandit, and pytest config to include the new
package paths.
2026-03-14 22:04:37 -04:00