CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-google--gemini-cli-core

Gemini CLI Core - Core functionality library for the open-source AI agent that brings the power of Gemini directly into your terminal.

Overall
score

87%

Evaluation87%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-1/

Chat Session Exporter

Build a utility that exports conversation sessions from an AI assistant to different formats for archival and analysis purposes.

Requirements

Export Single Session

Create functionality to export a specific chat session by its session ID. Support both JSON and Markdown export formats:

  • JSON format should include all message details and metadata
  • Markdown format should be human-readable with proper formatting

Export All Sessions

Create functionality to export all available sessions at once in a chosen format. The output should organize sessions clearly with appropriate separators.

List Available Sessions

Create functionality to retrieve and display all session IDs that have been recorded. This helps users identify which sessions are available for export.

Session History Retrieval

Create functionality to retrieve the full conversation history for a specific session, returning all recorded messages, tool calls, and system messages in chronological order.

Delete Session

Create functionality to remove a specific session by its ID, returning confirmation of successful deletion.

Test Cases

  • Exporting a session in JSON format returns valid JSON with all messages @test
  • Exporting a session in Markdown format returns formatted text @test
  • Exporting all sessions returns concatenated output for all available sessions @test
  • Listing all sessions returns an array of session IDs @test
  • Deleting a session removes it and returns true @test

Implementation

@generates

API

/**
 * ChatSessionExporter - Exports and manages conversation sessions
 */
class ChatSessionExporter {
  /**
   * Initialize a new ChatSessionExporter
   * @param {ChatRecordingService} chatRecordingService - Instance of ChatRecordingService
   */
  constructor(chatRecordingService);

  /**
   * Export a single session to a specified format
   * @param {string} sessionId - ID of the session to export
   * @param {string} format - Export format ('json' or 'markdown')
   * @returns {Promise<string>} Exported session content
   */
  async exportSession(sessionId, format);

  /**
   * Export all available sessions to a specified format
   * @param {string} format - Export format ('json' or 'markdown')
   * @returns {Promise<string>} Exported content for all sessions
   */
  async exportAllSessions(format);

  /**
   * Get list of all available session IDs
   * @returns {Promise<Array<string>>} Array of session IDs
   */
  async listSessions();

  /**
   * Get the conversation history for a specific session
   * @param {string} sessionId - ID of the session
   * @returns {Promise<Array<ChatRecord>>} Array of chat records
   */
  async getSessionHistory(sessionId);

  /**
   * Delete a specific session
   * @param {string} sessionId - ID of the session to delete
   * @returns {Promise<boolean>} True if deletion was successful
   */
  async deleteSession(sessionId);
}

module.exports = { ChatSessionExporter };

Dependencies { .dependencies }

@google/gemini-cli-core { .dependency }

Provides the ChatRecordingService for managing conversation sessions and history.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-google--gemini-cli-core

tile.json