How to use the /share command in GitHub Copilot CLI | Demo
Quick Overview
The GitHub Copilot CLI's /share command allows users to export the entire recorded session, including user prompts, Copilot reasoning, and generated content, to a secret GitHub Gist for later review or sharing, as demonstrated by sharing an entire session that produced an ASCII architecture diagram for a Next.js codebase.
Key Points: The demonstration focuses on using the GitHub Copilot CLI, specifically showing version 0.0.382 and utilizing the Claude Opus 4.5 model. The user initially asks Copilot to generate an ASCII architecture diagram for the Hanselminutes Admin codebase to understand its structure, which Copilot successfully produces. The session context reveals that the codebase uses Next.js, TypeScript, and involves features like API routes, middleware for auth checks, and external services like Azure Blob Storage and RSS Feed. After generating the diagram and providing key concepts, the user requests to share the entire session using the command, opting for a secret Gist. The session sharing confirms success, providing a GitHub Gist URL, and then displays usage statistics like total duration (2m 46.333s wall time) and model usage (Claude-opus-4.5). The video concludes by showing the user installing the GitHub Copilot CLI tool itself using Winget on Windows: .
Context: Scott Hanselman demonstrates the GitHub Copilot Command Line Interface (CLI), focusing on its ability to interpret and visualize codebases, specifically in the context of a Next.js application called 'Hanselminutes Admin'. The demonstration involves using Copilot to explore the project structure and generate an architectural overview, setting the stage for showcasing the utility of sharing the entire interactive session history.
Detailed Analysis
The video demonstrates the GitHub Copilot CLI, version 0.0.382, running on a system configured with Claude Opus 4.5 as the AI agent. The host starts by asking Copilot to create an ASCII architecture diagram for the 'Hanselminutes Admin' codebase, which is a Next.js/TypeScript backend application. Copilot first explores the directory structure, listing files found in key directories like 'src', 'src/app', 'src/services', and 'src/components'. It then generates a detailed, multi-layered ASCII diagram illustrating the structure, data flow (Browser -> Middleware -> Page/API Route -> Service -> External Services), and key concepts like Mini-Apps Pattern, API Routes, and Layouts. Following this, the user requests an expansion on routing, which leads Copilot to generate a detailed diagram focusing specifically on Next.js App Router conventions (page.tsx for UI, route.ts for API endpoints, layout.tsx for shared UI). Finally, the host executes the command, choosing to share the session as a secret Gist, which is confirmed with a URL and usage statistics (Total duration: 2m 46.333s wall time). The session concludes with the host showing how to install the Copilot CLI itself using on Windows.