Noureddine RAMDI / Grok-CLI: a terminal coding agent with Telegram remote control and sub-agent delegation

Created Tue, 05 May 2026 22:24:55 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

superagent-ai/grok-cli

Grok-CLI offers a fresh take on terminal-based AI coding assistants by bridging the gap between your phone and your CLI. Its Telegram remote control feature lets you operate the coding agent from anywhere, while the CLI continues running on your machine. This integration creates a unique user experience that extends the reach of traditional terminal coding agents beyond your desktop.

What grok-cli does and how it’s built

Grok-CLI is an open-source terminal coding agent written in TypeScript. It leverages Bun, a fast JavaScript runtime, and OpenTUI, a terminal user interface framework, to provide an interactive terminal experience. The core AI functionality is powered by xAI’s Grok API, which the CLI connects to for generating coding assistance and other AI-driven tasks.

Under the hood, Grok-CLI supports multiple operational modes. It can run interactively with a rich OpenTUI interface, providing real-time interaction directly in the terminal. Alternatively, it supports a headless mode where prompts can be sent and responses received without the UI, making it suitable for scripting and continuous integration workflows.

A key architectural feature is sub-agent delegation. The CLI spins up multiple sub-agents to parallelize tasks such as code exploration, general research, and computer automation. This allows efficient handling of complex workflows by distributing responsibilities among specialized sub-agents.

Beyond coding assistance, Grok-CLI integrates web and X (formerly Twitter) search tools to fetch real-time information. It also includes built-in media generation capabilities, supporting image and video creation directly from the terminal.

On macOS, Grok-CLI adds a computer sub-agent that leverages accessibility snapshots for desktop automation. This enables automating tasks on the host machine, a rare feature in terminal coding agents.

The scheduling system with a background daemon facilitates recurring tasks, allowing the agent to perform actions on a schedule without user intervention.

What sets grok-cli apart technically

The standout technical strength of Grok-CLI lies in its Telegram remote control feature. By pairing your phone with the CLI via Telegram, you can send commands to the agent remotely through direct messages. This novel UX pattern effectively extends the CLI’s reach beyond the terminal window, enabling mobile-driven workflows for coding assistance and automation.

The codebase is built with TypeScript using Bun, benefiting from fast runtime performance and modern JavaScript features. OpenTUI provides a smooth, interactive terminal UI, enhancing the developer experience compared to plain text-based CLIs.

Sub-agent delegation is another differentiator. Instead of a monolithic agent handling all tasks, Grok-CLI distributes work across multiple sub-agents. This design supports parallelism and specialization, improving throughput and responsiveness, especially for complex or multi-step workflows.

The dual-mode operation—interactive OpenTUI and headless prompt mode—makes the CLI versatile. Interactive mode caters to developers who want a rich terminal interface, while headless mode is suitable for automation scripts and CI environments where no terminal UI is available.

The macOS-specific computer sub-agent for desktop automation is an advanced feature that taps into accessibility APIs. It enables the agent to interact with desktop applications and automate tasks, a feature seldom found in terminal coding agents.

The tradeoffs are clear: you need a Grok API key from x.ai to use the service, which makes it dependent on an external API. The macOS desktop automation capabilities are limited to that platform due to accessibility API constraints. Also, to fully enjoy the OpenTUI experience, a modern terminal emulator is required.

Overall, the code is surprisingly clean and modular for a TypeScript CLI project of this scope, considering the integration of multiple subsystems like the UI, sub-agents, scheduling daemon, and Telegram bot.

Quick start

curl -fsSL https://raw.githubusercontent.com/superagent-ai/grok-cli/main/install.sh | bash

Alternative installs (requires Bun on PATH):

bun add -g grok-dev

Self-management (script-installed only):

grok update
grok uninstall
grok uninstall --dry-run
grok uninstall --keep-config

Prerequisites: a Grok API key from x.ai and a modern terminal emulator for the interactive OpenTUI experience. Headless --prompt mode does not depend on terminal UI support. If you want host desktop automation via the built-in computer sub-agent, also enable Accessibility permission for your terminal app on macOS.

verdict

Grok-CLI is well-suited for developers who want a terminal-based AI assistant with the flexibility to operate both interactively and headlessly. Its Telegram remote control feature stands out as a genuinely novel way to bridge mobile and terminal workflows, allowing you to drive your coding agent remotely.

The sub-agent delegation model and built-in scheduling demonstrate thoughtful engineering to handle complex tasks efficiently. macOS users gain additional value through desktop automation, though this limits cross-platform use.

The main limitations are the dependency on an external Grok API key and the requirement for a modern terminal for full UI experience. If you want a CLI AI assistant that can also be remotely controlled from your phone and you work primarily on macOS or support headless scripting, Grok-CLI is worth exploring. For those who prefer fully local solutions or broader OS support for automation, it may fall short.

In terms of code quality and architecture, it is a solid example of a modern TypeScript CLI application integrating multiple advanced features with a clean design. It shows how terminal tools can expand beyond traditional boundaries by integrating with messaging platforms and desktop automation.

If you’re interested in AI coding agents and novel CLI UX patterns, Grok-CLI offers a practical, production-ready codebase with a unique feature set.


→ GitHub Repo: superagent-ai/grok-cli ⭐ 3,005 · TypeScript