@crewai-ts/cli
v0.2.1
Published
CLI to run a user's crewai-ts project (TypeScript/JavaScript) via tsx.
Readme
@crewai-ts/cli
The crewai-ts command-line tool for running a user's CrewAI-style
TypeScript or JavaScript project.
crewai-ts validates a project directory, resolves the entry file, and
executes it through tsx. It is the default driver for
the @crewai-ts/cli template and any project scaffolded with the
TypeScript CrewAI patterns.
Unofficial project. This is a community port of CrewAI and is not affiliated with, endorsed by, or maintained by crewAI, Inc. See License for the upstream MIT notice.
Install
# Global install — exposes the `crewai-ts` binary
npm install -g @crewai-ts/cli
# or
pnpm add -g @crewai-ts/cli
# Local install — invoke via `pnpm exec` / `npx`
npm install --save-dev @crewai-ts/cli
pnpm add -D @crewai-ts/cliRequirements:
- Node.js 22 or later
@crewai-ts/coreinstalled in the target projecttsxis bundled — no extra setup required for.tsentry files
Usage
# Run a project directory
crewai-ts ./my-crew-project
# Pass inputs as JSON
crewai-ts ./my-crew-project --inputs '{"topic":"CrewAI"}'
# Show help
crewai-ts --help
# Show version
crewai-ts --versionProject Entry Resolution
The CLI resolves the project entry file in this order:
index.tsat the project rootsrc/index.tsmain.tsat the project rootpackage.json"main"field (with.tsappended if needed)- Default:
index.ts
The returned path is always relative to the project directory.
Programmatic API
The package exposes a small programmatic surface for embedding the CLI runner inside another Node.js tool or a test harness.
import { CLI_VERSION, findProjectEntry, main } from "@crewai-ts/cli";
// Run the CLI programmatically with an argv-style string array.
// `main` returns the process exit code (0 on success).
const exitCode = await main(["./my-project", "--inputs", '{"topic":"AI"}']);
// Resolve the entry file for a project without executing it.
const entry = findProjectEntry("./my-project");main is the only async entry point that performs I/O; the rest of the
helpers are pure functions and are safe to call in tests.
Exports
main(args)— CLI entry point, returns the process exit codefindProjectEntry(projectPath)— resolve the entry file for a projectCLI_VERSION— current CLI version constant
The argument-parsing and project-validation helpers are intentionally internal — the public surface above is the supported contract.
Related Packages
@crewai-ts/core— agents, tasks, crews, tools, hooks, security, checkpoints@crewai-ts/rag— memory, knowledge, vector stores, PDF parsing@crewai-ts/flow— stateful Flow orchestration@crewai-ts/nestjs— NestJS DI integration
License
MIT
This project is an unofficial TypeScript port of CrewAI (Copyright © crewAI, Inc.), which is distributed under the MIT License. It is not affiliated with or endorsed by crewAI, Inc. As required by the MIT License, the original copyright and permission notice are retained in LICENSE.
