Skip to content

Add Gemini CLI support#3

Open
pdecat wants to merge 1 commit into
yazcaleb:mainfrom
pdecat:gemini-support
Open

Add Gemini CLI support#3
pdecat wants to merge 1 commit into
yazcaleb:mainfrom
pdecat:gemini-support

Conversation

@pdecat
Copy link
Copy Markdown

@pdecat pdecat commented May 12, 2026

Summary

  • Adds Gemini CLI as a fourth source/target tool — rses now covers 12 handoff directions across Claude Code, Codex CLI, Gemini CLI, and OpenCode.
  • Reads sessions from ~/.gemini/tmp/<projectHash>/chats/session-*.jsonl (with legacy single-object .json fallback), honoring $set metadata patches and $rewindTo history truncations.
  • Resolves projectHashcwd via ~/.gemini/projects.json. The tmp/ dirs are named by either sha256(absPath) or the friendly name from projects.json depending on Gemini version — the
    reverse-lookup handles both.
  • New aliases: gm, gem, ggemini.

Files

  • src/parse-gemini.js — new parser (5 exports, mirrors the Claude parser contract).
  • bin/rses.jsVALID_TOOLS, aliases, RESUME_HINTS, picker branch, sync + async dispatch.
  • src/ls.js — Gemini branch in the filesystem fallback.
  • src/build-handoff.jsgemini: 'Gemini' in TOOL_NAMES.
  • src/launch.js — install hint for @google/gemini-cli.
  • README.md — tagline, examples, aliases table, sessions-read table, requirements.

Test plan

  • rses ls gemini → table with date / cwd / first task.
  • rses ls gemini --dir <path> → matches both hash-named and friendly-named tmp/ subdirs.
  • rses claude with gemini --last --dry-run → handoff prompt names "Gemini", cwd resolved, git context + last N turns included.
  • Alias chain: rses cc w gm --last --dry-run → identical output.
  • rses export gemini <id8> works with the 8-char filename-suffix id.
  • Legacy single-object .json files parse correctly (verified against session-2026-04-21T07-58-fa6c31fc.json).
  • rses ls (all tools) lists codex / claude / gemini / opencode sections in order.
  • Unknown-tool error now reads Use 'claude', 'codex', 'gemini', or 'opencode'.
  • Live launch tested with Claude.

Verified against 134 real Gemini sessions on the dev machine.

Brings rses to 4 tools / 12 handoff directions. Reads Gemini sessions
from ~/.gemini/tmp/<projectHash>/chats/session-*.jsonl (with legacy
.json fallback), resolves projectHash to cwd via ~/.gemini/projects.json.

- src/parse-gemini.js: new parser handling JSONL header, $set patches,
  $rewindTo truncations, and the legacy single-object .json format.
  Reverse-lookup map covers tmp/ dirs named by either sha256 hash or
  the projects.json friendly name.
- bin/rses.js: gemini in VALID_TOOLS, aliases gm/gem/g, picker branch,
  dispatch in resolveAndBuildAsync and resolveAndBuild, resume hint.
- src/build-handoff.js: 'Gemini' in TOOL_NAMES.
- src/launch.js: install hint for @google/gemini-cli.
- src/ls.js: gemini branch in the filesystem fallback path.
- README.md: tagline, examples, aliases table, sessions-read table,
  requirements.
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