How callstackincubator/cali works
Project type and purpose
• This is a TypeScript-based monorepo (managed via root package.json & tsconfig.json) containing three cooperating packages:
• packages/cali – a CLI-based AI agent for building React Native apps
• packages/tools – a library of “tool” functions (wrappers around RN-CLI, npm, pods, device management, etc.)
• packages/mcp-server – an HTTP server implementing the Model Context Protocol (MCP) so that LLMs like Claude or Zed can drive the same tools remotely
• Its purpose is to let a large language model orchestrate React Native app workflows (build, install deps, manage devices) via either a terminal CLI, Vercel AI SDK, or any MCP-compatible client.
File structure
• Top-level config files (.eslintrc, tsconfig.json, LICENSE, README.md, docs/) govern linting, build, contribution guidelines, and overall monorepo docs.
• packages/cali
– cli.ts: entry point that loads the toolset and orchestrates LLM prompts
– prompt.ts/utils.ts: logic for building prompts and parsing LLM responses
• packages/tools
– android.ts, apple.ts, fs.ts, git.ts, npm.ts, react-native.ts: wrappers around native CLIs
– vendor/: any third-party or custom adapters
• packages/mcp-server
– index.ts: HTTP server exposing tool methods according to the MCP JSON-RPC protocol
• Shared rslib.config.ts files & individual tsconfig.json files show that each package compiles to JS modules for Node.
Key insights from the README
• Three delivery modes: standalone CLI, Vercel AI SDK integration, MCP server
• Core features: build automation, device management, dependency management, library search
• External dependencies include React Native CLI, CocoaPods, npm, git, plus LLM endpoints (OpenAI, Anthropic, etc.)
a. Main components
• CLI Client (packages/cali)
• Tools Library (packages/tools)
• MCP Server (packages/mcp-server)
• Underlying native CLIs & local OS services (React Native CLI, CocoaPods, npm, git, filesystem, simulators)
• External LLM Providers (OpenAI, Claude, Zed, etc.)
• Optional Integration: Vercel AI SDK
b. Relationships & data flows
1. CLI Client or MCP Server invokes Tools Library methods.
2. Tools call underlying CLIs (e.g., npx react-native run-ios, pod install, npm install).
3. CLI assembles prompts via prompt.ts, sends them to LLM Provider over HTTP/SDK, receives JSON responses.
4. MCP Server exposes the same Tools methods over a JSON-RPC interface to any MCP-capable LLM client.
5. (Optional) Vercel AI SDK wraps the Tools Library for web-based LLM UIs.
c. Architectural patterns
– Monorepo with isolated packages and shared build configs
– Plugin-style “tools” abstraction around native CLIs
– Thin application layers (CLI & server) that orchestrate LLM calls + tool invocation
d. Technologies & frameworks
– Node.js + TypeScript
– rslib for build/packaging
– React Native CLI, CocoaPods, npm, git
– Vercel AI SDK (integration)
– MCP (Model Context Protocol) over HTTP