Major rewrite of the Grok CLI agent: - Runtime: Bun-first (removed Node.js/tsx fallbacks) - UI: Replaced Ink with OpenTUI (@opentui/react) terminal framework - Tools: Simplified to bash-only (removed text-editor, search, morph, todo, confirmation tools) - Search: Integrated X Search API and Web Search via xAI Responses API - Models: Updated to all latest Grok models (grok-4, grok-4.20-beta, grok-4-1-fast, grok-4-fast, grok-3-mini) - Agent: Streamlined agent loop with async generator streaming - Client: Dual API support (Chat Completions for tool calling, Responses API for search) - Removed MCP integration, confirmation service, token counter, Morph editor - Updated tsconfig for OpenTUI React JSX - Clean 10-file architecture in src/ Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
---
|
|
description: Development workflow and common commands
|
|
globs: "**/*"
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Development Workflow
|
|
|
|
## Prerequisites
|
|
|
|
- Bun 1.0+ (required)
|
|
|
|
## Common Commands
|
|
|
|
```bash
|
|
# Install dependencies
|
|
bun install
|
|
|
|
# Development (runs from source with Bun)
|
|
bun run dev
|
|
|
|
# Build (compile TypeScript to dist/)
|
|
bun run build
|
|
|
|
# Type checking (no emit)
|
|
bun run typecheck
|
|
|
|
# Linting
|
|
bun run lint
|
|
|
|
# Run the built CLI
|
|
bun run start
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Required | Description |
|
|
|----|----|----|
|
|
| `GROK_API_KEY` | Yes | API key for xAI Grok |
|
|
| `GROK_BASE_URL` | No | Custom API endpoint (default: `https://api.x.ai/v1`) |
|
|
| `GROK_MODEL` | No | Model override (default: `grok-4-1-fast`) |
|
|
| `GROK_MAX_TOKENS` | No | Max tokens per response (default: 16384) |
|
|
|
|
Copy `.env.example` to `.env` and fill in your values.
|
|
|
|
## Before Submitting Changes
|
|
|
|
1. Run `bun run typecheck` — CI enforces this on every PR.
|
|
2. Run `bun run lint` — fix any ESLint errors.
|
|
3. Ensure no secrets or `.env` files are committed.
|
|
4. Follow the PR template in `.github/pull_request_template.md`.
|
|
|
|
## Project Structure Conventions
|
|
|
|
- Source code lives in `src/`, compiled output in `dist/` (gitignored).
|
|
- The CLI entry point is `src/index.ts` which uses Commander.js for argument parsing.
|
|
- UI is built with OpenTUI React (`@opentui/react`).
|
|
- Only tool is bash — all file operations happen through shell commands.
|