Skip to content

Replace Gemini assistant with local AI CLIs - #64

Merged
jappa merged 1 commit into
mainfrom
feat/local-ai-cli
Nov 4, 2026
Merged

jappa merged 1 commit into
mainfrom
feat/local-ai-cli

Conversation

@jappa

@jappa jappa commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The hook editor's AI Assistant button now opens a terminal next to the editor, running claude, gemini or codex from the user's PATH in the project folder. The tool uses the user's own login, so zX no longer asks for or stores a Gemini API key in project state.

  • The editor reloads the open hook from disk every 2s while the panel is open and the buffer has no unsaved edits, so a stale buffer can't overwrite the AI's changes.
  • Terminals (including the Terminal tab) now start as login shells in the active project directory. A login shell loads the user's profile, which the packaged app needs to find CLIs when launched from Finder.
  • /ws/terminal takes an optional cmd limited to claude|gemini|codex. The backend shell runs it on start because zsh drops input typed before it's ready.
  • Opening a project writes AGENTS.md (hook contract) and a CLAUDE.md that imports it, if they don't exist.
  • Removed: /api/hooks/ai/generate, the Gemini key setup, and the Generate and Autocomplete modes.

Testing

  • tsc --noEmit passes, and the test_apps slurm, camel and zdt1 scripts pass.
  • A one-off smoke test against the backend confirmed:
    • the guide files are written,
    • the old endpoint returns 404,
    • an unlisted cmd is refused,
    • the startup command runs in the project folder.
  • Not tested: the panel inside the running Electron app.

Projects that already stored a GEMINI_API_KEY in their shared state keep it until someone deletes it.

🤖 Generated with Claude Code

The hook editor's AI Assistant now opens a terminal in the project folder
running claude, gemini or codex from the user's PATH, so zX no longer stores
API keys in project state. The editor reloads the open hook from disk while it
has no unsaved edits.

- Terminals start as login shells in the active project directory
- /ws/terminal accepts an allowlisted cmd that the shell runs on start
- Opening a project writes AGENTS.md (hook contract) and CLAUDE.md if missing
- Remove /api/hooks/ai/generate and the Gemini drawer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jappa
jappa merged commit ae8c035 into main Nov 4, 2026
1 check passed
@jappa
jappa deleted the feat/local-ai-cli branch November 4, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant