Desktop app that records your on-screen work session and uses the GitHub Copilot SDK to reconstruct it as an intent + ordered steps, then builds a reusable Skill or Automation for Microsoft Autopilots like Scout, Microsoft Copilot Cowork, or Copilot Studio.
TypeScript agent-skillsai-agentsautomationcopilotcopilot-clicopilot-coworkcopilot-studioelectronmicrosoft-scoutscreen-recording
Release 0.2.1: sign in to Copilot from the app (#54)
Giorgio Ughini790da396d881
diff --git a/README.md b/README.mdindex e927ac5..6e25155 100644--- a/README.md+++ b/README.md@@ -63,7 +63,10 @@ system-wide.Both paths install dependencies from their publishers and build Skill Recorder locally.The platform-specific Copilot CLI is installed with the application dependencies; a global-CLI installation is not required. On first launch, macOS asks for **Screen Recording**+CLI installation is not required. The first time you choose *Analyze* without stored+Copilot credentials, Skill Recorder says so and offers **Sign in to Copilot**, which opens+a terminal running the bundled CLI's `login` command (the same command is shown so you can+run it yourself). On first launch, macOS asks for **Screen Recording**permission — grant it and you're ready to record.> ⚠️ **Keep secrets out of your recordings.** Don't record, type, paste, or narratediff --git a/common/ipc.ts b/common/ipc.tsindex 67c7ec6..3716243 100644--- a/common/ipc.ts+++ b/common/ipc.ts@@ -290,6 +290,28 @@ export interface CopilotInfo {path: string | null;}+/** Result of asking the app to open a terminal on the bundled CLI's sign-in command. */+export interface CopilotSignInResult {+ ok: boolean;+ /** The exact command the terminal was asked to run, so the user can run it themselves. */+ command?: string;+ error?: string;+}++/**+ * Message every Copilot-backed feature throws when the CLI has no stored credentials.+ * Skill Recorder ships its own Copilot CLI in `node_modules`, so there is usually no+ * global `copilot` command to run — the renderer matches this message to offer the+ * in-app sign-in affordance instead.+ */+export const COPILOT_SIGNED_OUT_ERROR =+ "GitHub Copilot isn't signed in on this computer yet. Sign in below, then try again.";++/** Whether an error from a Copilot-backed feature means "no credentials yet". */+export function isCopilotSignedOutError(error?: string | null): boolean {+ return typeof error === "string" && error.includes("isn't signed in on this computer");+}+/** Which foreground-window provider is available on this platform. */export interface ActiveWindowInfo {ok: boolean;@@ -340,6 +362,7 @@ export const IPC = {status: "recorder:status",marker: "recorder:marker",doctor: "doctor:check",+ copilotSignIn: "copilot:sign-in",statusChanged: "recorder:status-changed",recordingPrivacyReviewed: "recorder:privacy-reviewed",recordingPrivacyWarningRequested: "recorder:privacy-warning-requested",@@ -394,6 +417,11 @@ export interface SkillRecorderApi {status(): Promise<RecorderStatus>;marker(note: string): Promise<MarkerResult>;doctor(): Promise<DoctorReport>;+ /**+ * Open a terminal window running the bundled Copilot CLI's `login` command, so the+ * user can sign in without a globally installed `copilot`.+ */+ copilotSignIn(): Promise<CopilotSignInResult>;onStatusChanged(cb: (status: RecorderStatus) => void): () => void;narrationStatus(): Promise<NarrationStatus>;downloadNarrationModel(): Promise<NarrationActionResult>;diff --git a/electron/builders/agent-builder.ts b/electron/builders/agent-builder.tsindex 1613886..5377841 100644--- a/electron/builders/agent-builder.ts+++ b/electron/builders/agent-builder.ts@@ -1,5 +1,6 @@import { CopilotClient, type CopilotSession } from "@github/copilot-sdk";+import { COPILOT_SIGNED_OUT_ERROR } from "../../common/ipc";import { copilotConnectionOption, withStartupTimeout } from "../copilot-cli-path";import { createLogger } from "../logger";@@ -70,9 +71,7 @@ export abstract class AgentBuilder<TLive extends BaseLive> {const auth = await client.getAuthStatus();if (!auth.isAuthenticated) {await client.stop().catch(() => undefined);- throw new Error(- "GitHub Copilot CLI is not signed in. Open a terminal, run `copilot`, sign in, then try again.",- );+ throw new Error(COPILOT_SIGNED_OUT_ERROR);}this.model = process.env.SKILL_RECORDER_MODEL || undefined;this.log.info("Copilot ready", auth.login ? `as ${auth.login}` : "");diff --git a/electron/copilot-signin.ts b/electron/copilot-signin.tsnew file mode 100644index 0000000..9fdc13f--- /dev/null+++ b/electron/copilot-signin.ts@@ -0,0 +1,88 @@+import { execFileSync, spawn } from "node:child_process";++import type { CopilotSignInResult } from "../common/ipc";+import { resolveCopilotCliPath } from "./copilot-cli-path";+import { createLogger } from "./logger";++const log = createLogger("CopilotSignIn");++/** POSIX single-quoting so a path with spaces survives the shell the terminal opens. */+function shellQuote(value: string): string {+ return `'${value.replace(/'/g, `'\\''`)}'`;+}++/** The command that signs the user in — also shown in the UI as a manual fallback. */+export function copilotSignInCommand(cliPath: string): string {+ return process.platform === "win32" ? `"${cliPath}" login` : `${shellQuote(cliPath)} login`;+}++const LINUX_TERMINALS = [+ "x-terminal-emulator",+ "gnome-terminal",+ "konsole",+ "xfce4-terminal",+ "xterm",+];++function onPath(command: string): boolean {+ try {+ execFileSync("which", [command], { stdio: "ignore" });+ return true;+ } catch {+ return false;+ }+}++/** Spawn a terminal and let it outlive the app; ENOENT arrives as an event, not a throw. */+function launch(file: string, args: string[], verbatim = false): void {+ const child = spawn(file, args, {+ detached: true,+ stdio: "ignore",+ windowsHide: false,+ windowsVerbatimArguments: verbatim,+ });+ child.on("error", (err) => log.warn("terminal failed to start:", err.message));+ child.unref();+}++/**+ * Open a terminal window running `login` on the Copilot CLI that ships with the app.+ * Skill Recorder installs the CLI as a dependency, so telling users to run a global+ * `copilot` doesn't work — we hand them the bundled binary's full path instead.+ */+export function openCopilotSignIn(): CopilotSignInResult {+ const cliPath = resolveCopilotCliPath();+ if (!cliPath) {+ return {+ ok: false,+ error: "Skill Recorder couldn't find its bundled GitHub Copilot CLI. Reinstall the app.",+ };+ }+ const command = copilotSignInCommand(cliPath);+ try {+ if (process.platform === "win32") {+ // `start` gives the CLI its own console. The doubled quotes are cmd's required+ // form when the window title and the command are both quoted.+ launch("cmd.exe", ["/c", `start "Sign in to GitHub Copilot" cmd.exe /k "${command}"`], true);+ } else if (process.platform === "darwin") {+ const script = `tell application "Terminal"\nactivate\ndo script ${JSON.stringify(command)}\nend tell`;+ launch("osascript", ["-e", script]);+ } else {+ const terminal = LINUX_TERMINALS.find(onPath);+ if (!terminal) {+ return {+ ok: false,+ command,+ error: "No terminal emulator was found. Run the command below yourself, then try again.",+ };+ }+ launch(terminal, ["-e", "sh", "-c", `${command}; exec sh`]);+ }+ log.info("opened a terminal for the bundled CLI's login command");+ return { ok: true, command };+ } catch (err) {+ const error = err instanceof Error ? err.message : String(err);+ log.warn("could not open a terminal:", error);+ return { ok: false, command, error };+ }+}diff --git a/electron/describer/describer.ts b/electron/describer/describer.tsindex eec0774..aa4164e 100644--- a/electron/describer/describer.ts+++ b/electron/describer/describer.ts@@ -11,7 +11,7 @@ import {type AnalysisFeedback,type AnalysisSubmission,} from "../../common/analysis";-import type { AnalyzeProgress } from "../../common/ipc";+import { COPILOT_SIGNED_OUT_ERROR, type AnalyzeProgress } from "../../common/ipc";import type { SessionMeta } from "../../common/types";import { FrameExtractor } from "../frames/extractor";import { createLogger } from "../logger";@@ -201,9 +201,7 @@ export class Describer {const auth = await client.getAuthStatus();if (!auth.isAuthenticated) {await client.stop().catch(() => undefined);- throw new Error(- "GitHub Copilot CLI is not signed in. Open a terminal, run `copilot`, sign in, then try again.",- );+ throw new Error(COPILOT_SIGNED_OUT_ERROR);}this.model = await this.pickVisionModel(client);log.info("Copilot ready", auth.login ? `as ${auth.login}` : "", this.model ? `· model ${this.model}` : "");diff --git a/electron/doctor.ts b/electron/doctor.tsindex cc8231d..a129d58 100644--- a/electron/doctor.ts+++ b/electron/doctor.ts@@ -11,6 +11,7 @@ import type {DoctorSource,} from "../common/ipc";import { browserUrlProviderKind } from "./collectors/url-provider";+import { resolveCopilotCliPath } from "./copilot-cli-path";import { sessionsRoot } from "./recorder/session-store";const require = createRequire(import.meta.url);@@ -28,8 +29,10 @@ function which(cmd: string): string | null {}function checkCopilot(): CopilotInfo {- const p = which("copilot");- return { ok: Boolean(p), path: p };+ // The app ships its own Copilot CLI in node_modules, so a global `copilot` on PATH is+ // optional — check the bundled binary first or one-liner installs look broken here.+ const p = resolveCopilotCliPath() ?? which("copilot");+ return { ok: Boolean(p), path: p ?? null };}function checkActiveWindow(): ActiveWindowInfo {diff --git a/electron/ipc.ts b/electron/ipc.tsindex 4599352..f42a00e 100644--- a/electron/ipc.ts+++ b/electron/ipc.ts@@ -29,6 +29,7 @@ import type { AutomationPlan } from "../common/automation";import type { NarrationLanguage } from "../common/narration";import type { SkillPlan } from "../common/skill";import { AutomationBuilder, loadPersistedAutomation } from "./automationbuilder/builder";+import { openCopilotSignIn } from "./copilot-signin";import { buildDebugInfo, writeDebugBundle } from "./debug-bundle";import { Describer, loadPersistedAnalysis } from "./describer/describer";import { runDoctor } from "./doctor";@@ -115,6 +116,7 @@ export function registerIpc(ipcMain.handle(IPC.status, () => recorder.status());ipcMain.handle(IPC.marker, (_event, note: string) => recorder.marker(note));ipcMain.handle(IPC.doctor, () => runDoctor());+ ipcMain.handle(IPC.copilotSignIn, () => openCopilotSignIn());ipcMain.handle(IPC.narrationStatus, () => narration.status());ipcMain.handle(IPC.narrationDownload, () => narration.downloadModel());ipcMain.handle(IPC.narrationTranscribe, (_event, sessionId: string) =>diff --git a/electron/preload.cjs b/electron/preload.cjsindex 167734f..e59c8a2 100644--- a/electron/preload.cjs+++ b/electron/preload.cjs@@ -16,6 +16,7 @@ const IPC = {status: "recorder:status",marker: "recorder:marker",doctor: "doctor:check",+ copilotSignIn: "copilot:sign-in",statusChanged: "recorder:status-changed",recordingPrivacyReviewed: "recorder:privacy-reviewed",recordingPrivacyWarningRequested: "recorder:privacy-warning-requested",@@ -88,6 +89,7 @@ contextBridge.exposeInMainWorld("skillRecorder", {status: () => ipcRenderer.invoke(IPC.status),marker: (note) => ipcRenderer.invoke(IPC.marker, note),doctor: () => ipcRenderer.invoke(IPC.doctor),+ copilotSignIn: () => ipcRenderer.invoke(IPC.copilotSignIn),onStatusChanged: (cb) => {const listener = (_event, status) => cb(status);ipcRenderer.on(IPC.statusChanged, listener);diff --git a/package-lock.json b/package-lock.jsonindex ebd4d25..f797ffe 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "skill-recorder",- "version": "0.2.0",+ "version": "0.2.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "skill-recorder",- "version": "0.2.0",+ "version": "0.2.1","license": "MIT","dependencies": {"@github/copilot-sdk": "^1.0.6",diff --git a/package.json b/package.jsonindex 1a7279a..49cc408 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "skill-recorder",- "version": "0.2.0",+ "version": "0.2.1","description": "Records a user's on-screen work session and derives a structured description for building AI-agent skills.","author": "Skill Recorder contributors","repository": "github:adilei/skill-recorder",diff --git a/src/App.css b/src/App.cssindex 7bdb027..9b64366 100644--- a/src/App.css+++ b/src/App.css@@ -1929,6 +1929,32 @@ button:focus-visible,font-size: 12px;}+.analysis-error p {+ margin: 0;+}++.analysis-error .signin-row {+ display: flex;+ align-items: center;+ flex-wrap: wrap;+ gap: 8px;+ margin-top: 8px;+}++.analysis-error .signin-manual {+ margin-top: 8px;+ color: var(--faint);+}++.analysis-error .signin-command {+ display: block;+ margin-top: 4px;+ font-family: var(--mono);+ font-size: 11px;+ overflow-wrap: anywhere;+ user-select: text;+}+.ws-read {width: 100%;max-width: 640px;diff --git a/src/Library.tsx b/src/Library.tsxindex edf03a9..b9ca537 100644--- a/src/Library.tsx+++ b/src/Library.tsx@@ -4,11 +4,13 @@ import type { Analysis, AnalysisStep } from "../common/analysis";import type {AnalyzeProgress,AutomationBuildProgress,+ CopilotSignInResult,NarrationStatus,SessionSummary,SkillBuildProgress,SkillPlacement,} from "../common/ipc";+import { isCopilotSignedOutError } from "../common/ipc";import type {BuildTarget,BuiltSkill,@@ -400,6 +402,45 @@ function DebugDownload({ sessionId }: { sessionId: string }) {);}+/**+ * Error banner for the Copilot-backed panels. When the CLI has no credentials the app+ * offers to open a terminal on its *bundled* Copilot binary — there's no global+ * `copilot` command to send people to.+ */+function AnalysisError({ error }: { error: string }) {+ const [signIn, setSignIn] = useState<CopilotSignInResult | null>(null);+ const [opening, setOpening] = useState(false);++ const openSignIn = async () => {+ setOpening(true);+ setSignIn(await window.skillRecorder.copilotSignIn());+ setOpening(false);+ };++ if (!isCopilotSignedOutError(error)) return <div className="analysis-error">{error}</div>;++ return (+ <div className="analysis-error">+ <p>{error}</p>+ <div className="signin-row">+ <button className="row-action" onClick={() => void openSignIn()} disabled={opening}>+ {opening ? "Opening…" : "Sign in to Copilot"}+ </button>+ {signIn?.ok && (+ <span>A terminal opened — finish signing in there, then try again.</span>+ )}+ {signIn && !signIn.ok && <span>{signIn.error ?? "Couldn't open a terminal."}</span>}+ </div>+ {signIn?.command && (+ <>+ <p className="signin-manual">Or run this command yourself:</p>+ <code className="signin-command">{signIn.command}</code>+ </>+ )}+ </div>+ );+}+function AnalysisWorkspace({summary,narrationStatus,@@ -695,7 +736,7 @@ function AnalysisWorkspace({</p>)}- {error && <div className="analysis-error">{error}</div>}+ {error && <AnalysisError error={error} />}{analysis && !analyzing && (<div className="ws-read">@@ -1012,7 +1053,7 @@ function SkillBuilderView({</div><div className="ws-body">- {error && <div className="analysis-error">{error}</div>}+ {error && <AnalysisError error={error} />}{phase === "loading" && (<div className="status-line">@@ -1268,7 +1309,7 @@ function AutomationBuilderView({</div><div className="ws-body">- {error && <div className="analysis-error">{error}</div>}+ {error && <AnalysisError error={error} />}{phase === "loading" && (<div className="status-line">