grok-cli is an open-source terminal coding agent that uses the Grok API to work on software projects. Developers use it for interactive or headless coding tasks, with features including web and X search, sub-agents, a terminal interface, and remote control through Telegram.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/superagent-ai/grok-cliWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions)<a href="https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions"><img src="https://agentmods.dev/badge/rules/superagent-ai/grok-cli/typescript-conventions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions"><img src="https://agentmods.dev/badge/rules/superagent-ai/grok-cli/typescript-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00517 |
| Opus 5.5 | $0.00000 | $0.00207 |
| Sonnet 5.5 | $0.00000 | $0.00103 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
typescript-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
TypeScript Conventions
Module System
- This is an ESM project (
"type": "module"in package.json). - Always use ES module
import/exportsyntax — neverrequire(). - When importing local modules, include the
.jsextension (TypeScript compiles.ts→.js):import { GrokAgent } from "./agent/grok-agent.js";
TypeScript Configuration
- Target: ES2022, Module: ESNext, JSX: react
strict: falseandnoImplicitAny: false— the codebase does not enforce strict mode.moduleResolution: "Bundler"is used.- Source files live in
src/, compiled output goes todist/.
Type Practices
- Prefer explicit interfaces for public API boundaries (e.g.
ChatEntry,ToolResult,GrokToolCall). - Use
typeimports when importing only types:import type { ChatCompletionMessageParam } from "openai/resources/chat"; anyis acceptable where strict typing would add friction, but prefer narrower types when practical.- Shared types belong in
src/types/index.ts.
Naming Conventions
- Files: kebab-case (
grok-agent.ts,chat-interface.tsx,settings-manager.ts). - Classes: PascalCase (
GrokAgent,TextEditorTool,BashTool). - Interfaces/Types: PascalCase (
ChatEntry,ToolResult,StreamingChunk). - Functions/variables: camelCase (
processUserMessage,loadApiKey). - Constants: camelCase or UPPER_SNAKE_CASE for true constants (
GROK_TOOLS).
Error Handling
- Catch errors as
error: anyand access.messagefor display. - Tool execution methods return
ToolResultobjects ({ success, output?, error? }) rather than throwing. - Use
process.exit(1)for fatal CLI errors.
ESLint Rules
@typescript-eslint/no-unused-vars: error@typescript-eslint/no-explicit-any: warn
Run bun run lint to check and bun run typecheck to verify types.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 55 lines · 0 tokens per session scan A 534ba35cddb4
typescript-conventions is a cursor rule published in the GitHub repository superagent-ai/grok-cli (3,496 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 517 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
bundling
The project uses a custom type bundling system to provide full TypeScript IntelliSense support in the Monaco editor for @bubblelab/bubble-core and its dependencies. This is necessary because Monaco cannot directly resolve workspace packages or external dependencies.
hatch3r-typescript-patterns
TypeScript and JavaScript typing mechanics — satisfies over as, discriminated unions, branded types, strict utility types, barrel exports, and import ordering.
typescript
TypeScript style rules, scoped to .ts files.
caliber-conventions
Caliber project conventions for TypeScript CLI development.
typescript-strict-typing
Enforce strict TypeScript typing without any types.
hatch3r-rust-patterns
Rust conventions covering 2024 edition idioms, error handling with thiserror/anyhow, ownership patterns, async with Tokio, testing, and Cargo workspaces.