pub struct GeminiConvo { /* private fields */ }Expand description
High-level entry point for reading Gemini CLI conversations.
GeminiConvo is chain-unaware by design — Gemini doesn’t rotate
files. Instead, a “conversation” is a session UUID directory: the
main chat file plus every sibling sub-agent chat file.
§Example
use toolpath_gemini::GeminiConvo;
let manager = GeminiConvo::new();
let projects = manager.list_projects()?;
let convo = manager.read_conversation(
"/Users/alex/project",
"session-uuid",
)?;
println!("{} messages", convo.total_message_count());Implementations§
Source§impl GeminiConvo
impl GeminiConvo
pub fn new() -> Self
pub fn with_resolver(resolver: PathResolver) -> Self
pub fn io(&self) -> &ConvoIO
pub fn resolver(&self) -> &PathResolver
pub fn exists(&self) -> bool
pub fn gemini_dir_path(&self) -> Result<PathBuf>
pub fn list_projects(&self) -> Result<Vec<String>>
pub fn project_exists(&self, project_path: &str) -> bool
Sourcepub fn list_conversations(&self, project_path: &str) -> Result<Vec<String>>
pub fn list_conversations(&self, project_path: &str) -> Result<Vec<String>>
List session UUIDs for a project (each corresponds to one
chats/<uuid>/ directory).
Sourcepub fn list_conversation_metadata(
&self,
project_path: &str,
) -> Result<Vec<ConversationMetadata>>
pub fn list_conversation_metadata( &self, project_path: &str, ) -> Result<Vec<ConversationMetadata>>
Metadata for every session in a project, sorted newest first.
Sourcepub fn list_chat_files(
&self,
project_path: &str,
session_uuid: &str,
) -> Result<Vec<String>>
pub fn list_chat_files( &self, project_path: &str, session_uuid: &str, ) -> Result<Vec<String>>
List chat-file stems for a given session UUID.
Sourcepub fn read_conversation(
&self,
project_path: &str,
session_uuid: &str,
) -> Result<Conversation>
pub fn read_conversation( &self, project_path: &str, session_uuid: &str, ) -> Result<Conversation>
Read a full conversation — the main chat plus every sibling sub-agent chat file.
Sourcepub fn read_chat_file(
&self,
project_path: &str,
session_uuid: &str,
chat_name: &str,
) -> Result<ChatFile>
pub fn read_chat_file( &self, project_path: &str, session_uuid: &str, chat_name: &str, ) -> Result<ChatFile>
Read a single chat file without pulling in siblings.
pub fn read_conversation_metadata( &self, project_path: &str, session_uuid: &str, ) -> Result<ConversationMetadata>
pub fn conversation_exists( &self, project_path: &str, session_uuid: &str, ) -> Result<bool>
Sourcepub fn read_all_conversations(
&self,
project_path: &str,
) -> Result<Vec<Conversation>>
pub fn read_all_conversations( &self, project_path: &str, ) -> Result<Vec<Conversation>>
Read every conversation in a project, sorted by last activity.
pub fn most_recent_conversation( &self, project_path: &str, ) -> Result<Option<Conversation>>
Sourcepub fn find_conversations_with_text(
&self,
project_path: &str,
search_text: &str,
) -> Result<Vec<Conversation>>
pub fn find_conversations_with_text( &self, project_path: &str, search_text: &str, ) -> Result<Vec<Conversation>>
Case-insensitive substring search across all conversations in a project. Returns conversations that contain a match.
pub fn query<'a>(&self, conversation: &'a Conversation) -> ConversationQuery<'a>
pub fn read_logs(&self, project_path: &str) -> Result<Vec<LogEntry>>
Trait Implementations§
Source§impl Clone for GeminiConvo
impl Clone for GeminiConvo
Source§fn clone(&self) -> GeminiConvo
fn clone(&self) -> GeminiConvo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConversationProvider for GeminiConvo
impl ConversationProvider for GeminiConvo
Source§fn list_conversations(&self, project: &str) -> Result<Vec<String>>
fn list_conversations(&self, project: &str) -> Result<Vec<String>>
List conversation IDs for a project/workspace.
Source§fn load_conversation(
&self,
project: &str,
conversation_id: &str,
) -> Result<ConversationView>
fn load_conversation( &self, project: &str, conversation_id: &str, ) -> Result<ConversationView>
Load a full conversation as a
ConversationView.Source§fn load_metadata(
&self,
project: &str,
conversation_id: &str,
) -> Result<ConversationMeta>
fn load_metadata( &self, project: &str, conversation_id: &str, ) -> Result<ConversationMeta>
Load metadata only (no turns).
Source§fn list_metadata(&self, project: &str) -> Result<Vec<ConversationMeta>>
fn list_metadata(&self, project: &str) -> Result<Vec<ConversationMeta>>
List metadata for all conversations in a project.
Source§impl Debug for GeminiConvo
impl Debug for GeminiConvo
Auto Trait Implementations§
impl Freeze for GeminiConvo
impl RefUnwindSafe for GeminiConvo
impl Send for GeminiConvo
impl Sync for GeminiConvo
impl Unpin for GeminiConvo
impl UnsafeUnpin for GeminiConvo
impl UnwindSafe for GeminiConvo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more