### Install and Run Go Easy CLI Tools Source: https://context7.com/marcfargas/go-easy/llms.txt Install the library as a dependency or execute CLI tools directly using npx without installation. ```bash # As a library npm install @marcfargas/go-easy # As CLI tools (no install needed) npx go-gmail you@example.com search "is:unread" npx go-drive you@example.com ls npx go-calendar you@example.com events primary npx go-tasks you@example.com lists ``` -------------------------------- ### Install go-easy library and CLI tools Source: https://github.com/marcfargas/go-easy/blob/main/README.md Use npm to install the library or npx to execute CLI tools directly without installation. ```bash # As a library npm install @marcfargas/go-easy # As CLI tools (no install needed) npx go-gmail you@example.com search "is:unread" npx go-drive you@example.com ls npx go-calendar you@example.com events primary ``` -------------------------------- ### Drive Query Syntax Examples Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/drive.md Examples of using Drive API v3 query syntax with the CLI. Queries must be wrapped in double quotes. ```bash npx go-drive ls --query="name contains 'report'" npx go-drive ls --query="mimeType = 'application/pdf' and name contains 'invoice'" ``` -------------------------------- ### Go-Easy Development Commands Source: https://github.com/marcfargas/go-easy/blob/main/README.md Common development commands for the go-easy project, including installation, building, testing, linting, and watching for changes. ```bash npm install # install deps npm run build # compile TypeScript npm test # run tests (vitest) npm run lint # type-check without emitting npm run dev # watch mode ``` -------------------------------- ### CLI: Create various event types Source: https://context7.com/marcfargas/go-easy/llms.txt Examples of creating timed, all-day, attendee-based, working location, out-of-office, and focus time events via the CLI. ```bash npx go-calendar user@example.com create primary \ --summary="Team Meeting" \ --start=2026-02-10T10:00:00+01:00 \ --end=2026-02-10T11:00:00+01:00 \ --description="Weekly sync" \ --location="Conference Room A" ``` ```bash npx go-calendar user@example.com create primary \ --summary="Company Holiday" \ --start=2026-02-14 \ --end=2026-02-15 \ --all-day ``` ```bash npx go-calendar user@example.com create primary \ --summary="Project Review" \ --start=2026-02-12T14:00:00+01:00 \ --end=2026-02-12T15:00:00+01:00 \ --attendees=alice@example.com,bob@example.com ``` ```bash npx go-calendar user@example.com create primary \ --type=workingLocation \ --summary="Home" \ --start=2026-02-10 --end=2026-02-11 --all-day \ --wl-type=homeOffice ``` ```bash npx go-calendar user@example.com create primary \ --type=outOfOffice \ --summary="Vacation" \ --start=2026-02-14T00:00:00+01:00 \ --end=2026-02-21T00:00:00+01:00 \ --auto-decline=declineAllConflictingInvitations \ --decline-message="On vacation, back Feb 21" ``` ```bash npx go-calendar user@example.com create primary \ --type=focusTime \ --summary="Deep Work" \ --start=2026-02-10T09:00:00+01:00 \ --end=2026-02-10T12:00:00+01:00 \ --auto-decline=declineOnlyNewConflictingInvitations \ --chat-status=doNotDisturb ``` -------------------------------- ### Initialize and Use Go-Easy Task API Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/tasks.md Demonstrates how to authenticate with the Go-Easy API and perform various task management operations like listing, creating, updating, completing, and deleting tasks and task lists. Requires prior authentication setup. ```typescript import { getAuth } from '@marcfargas/go-easy/auth'; import { listTaskLists, listTasks, getTask, createTask, updateTask, completeTask, moveTask, deleteTask, createTaskList, deleteTaskList, clearCompleted } from '@marcfargas/go-easy/tasks'; import { setSafetyContext } from '@marcfargas/go-easy'; const auth = await getAuth('tasks', ''); // List task lists const lists = await listTaskLists(auth); // List tasks (with pagination) const page1 = await listTasks(auth, 'listId', { maxResults: 50 }); if (page1.nextPageToken) { const page2 = await listTasks(auth, 'listId', { maxResults: 50, pageToken: page1.nextPageToken, }); } // Get a task const task = await getTask(auth, 'listId', 'taskId'); // Create a task const created = await createTask(auth, 'listId', { title: 'Buy milk', notes: 'Whole milk', due: '2026-02-14', }); // Create a subtask await createTask(auth, 'listId', { title: 'Buy oat milk', parent: 'parentTaskId', }); // Update (PATCH — only provided fields) await updateTask(auth, 'listId', 'taskId', { title: 'Updated' }); // Complete await completeTask(auth, 'listId', 'taskId'); // Move (reparent or reorder) await moveTask(auth, 'listId', 'taskId', { parent: 'newParentId' }); // Destructive — needs safety context setSafetyContext({ confirm: async (op) => { /* ... */ return true; } }); await deleteTask(auth, 'listId', 'taskId'); await deleteTaskList(auth, 'listId'); await clearCompleted(auth, 'listId'); ``` -------------------------------- ### Initiate account authorization Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/SKILL.md Start the process of adding or upgrading a Google account. This command returns an authorization URL that the user must visit to grant permissions. Polling with the same command is required to check the status. ```bash # Phase 1: Start — returns auth URL immediately npx go-easy auth add marc@blegal.eu # → { "status": "started", "authUrl": "https://accounts.google.com/...", "expiresIn": 300 } ``` ```bash # Phase 2: Poll — same command, returns current status npx go-easy auth add marc@blegal.eu # → { "status": "waiting", "authUrl": "...", "expiresIn": 245 } # → { "status": "complete", "email": "marc@blegal.eu", "scopes": ["gmail", "drive", "calendar", "tasks"] } ``` -------------------------------- ### Execute service CLI commands Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/SKILL.md Examples of using individual service CLIs to perform operations on Gmail, Drive, Calendar, and Tasks. ```bash npx go-gmail user@example.com search "is:unread" npx go-drive user@example.com ls npx go-calendar user@example.com events primary npx go-tasks user@example.com lists ``` -------------------------------- ### GET lists Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/tasks.md List all task lists associated with the account. ```APIDOC ## GET lists ### Description List all task lists for the specified account. ### Method GET ### Endpoint npx go-tasks lists ### Response #### Success Response (200) - **Array** - A list of task list objects. ``` -------------------------------- ### Gmail SDK Operations Source: https://context7.com/marcfargas/go-easy/llms.txt TypeScript examples for managing Gmail drafts, labels, and attachments. ```typescript import { getAuth } from '@marcfargas/go-easy/auth'; import { createDraft, listDrafts, sendDraft } from '@marcfargas/go-easy/gmail'; import { setSafetyContext } from '@marcfargas/go-easy'; const auth = await getAuth('gmail', 'user@example.com'); // Create a draft (WRITE - no safety gate) const draft = await createDraft(auth, { to: 'recipient@example.com', subject: 'Draft Email', body: 'This is a draft.', cc: 'team@example.com', }); console.log(draft.id); // Draft ID // Create reply draft (will be placed in original thread) const replyDraft = await createDraft(auth, { to: 'sender@example.com', subject: 'RE: Original Subject', body: 'Reply content', threadId: 'THREAD_ID', extraHeaders: { 'In-Reply-To': '', 'References': '', }, }); // List drafts with pagination const drafts = await listDrafts(auth, 10); if (drafts.nextPageToken) { const moreDrafts = await listDrafts(auth, 10, drafts.nextPageToken); } // Send draft (DESTRUCTIVE) setSafetyContext({ confirm: async () => true }); const sent = await sendDraft(auth, draft.id); ``` ```typescript import { getAuth } from '@marcfargas/go-easy/auth'; import { listLabels, batchModifyLabels } from '@marcfargas/go-easy/gmail'; const auth = await getAuth('gmail', 'user@example.com'); // List labels const labels = await listLabels(auth); // → [{ id: 'INBOX', name: 'INBOX', type: 'system' }, ...] const followUpLabel = labels.find(l => l.name === 'Follow Up'); // Batch modify labels (WRITE - no safety gate) await batchModifyLabels(auth, { messageIds: ['MSG1', 'MSG2', 'MSG3'], addLabelIds: [followUpLabel?.id || 'Label_42'], removeLabelIds: ['UNREAD'], }); ``` ```typescript import { getAuth } from '@marcfargas/go-easy/auth'; import { getMessage, getAttachmentContent } from '@marcfargas/go-easy/gmail'; import * as fs from 'fs'; const auth = await getAuth('gmail', 'user@example.com'); // Get message with attachment info const msg = await getMessage(auth, 'MSG_ID123'); const attachment = msg.attachments[0]; // Download attachment as Buffer const content = await getAttachmentContent(auth, msg.id, attachment.id); fs.writeFileSync(attachment.filename, content); console.log(`Saved ${attachment.filename} (${content.length} bytes)`); ``` -------------------------------- ### Drive Query Combination Source: https://github.com/marcfargas/go-easy/blob/main/skills/go-easy/drive.md Example of combining query conditions using logical operators. ```text name contains 'report' and mimeType = 'application/pdf' ``` -------------------------------- ### Forward Emails via CLI Source: https://context7.com/marcfargas/go-easy/llms.txt Forward emails using the CLI, with options to save as a draft, add a note, filter attachments, send immediately, or start a new thread. ```bash # CLI: Forward as draft (WRITE - no confirmation needed) npx go-gmail user@example.com forward MSG_ID123 --to=colleague@example.com # → { "ok": true, "id": "DRAFT_ID", "threadId": "..." } # CLI: Forward with note above forwarded content echo "FYI - please review this." > note.txt npx go-gmail user@example.com forward MSG_ID123 \ --to=colleague@example.com \ --body-text-file=note.txt # CLI: Forward with attachment filtering npx go-gmail user@example.com forward MSG_ID123 \ --to=colleague@example.com \ --exclude=Receipt,Invoice # Exclude attachments containing these names npx go-gmail user@example.com forward MSG_ID123 \ --to=colleague@example.com \ --include=Contract # Only include attachments containing "Contract" # CLI: Forward and send immediately (DESTRUCTIVE) npx go-gmail user@example.com forward MSG_ID123 \ --to=colleague@example.com \ --send-now \ --confirm # → { "ok": true, "id": "SENT_MSG_ID", "threadId": "..." } # CLI: Forward to new thread npx go-gmail user@example.com forward MSG_ID123 \ --to=colleague@example.com \ --no-thread ``` -------------------------------- ### Get Single Email Message (TypeScript) Source: https://context7.com/marcfargas/go-easy/llms.txt Retrieve a single email message using TypeScript. This example shows how to get structured message data, the raw RFC 2822 format, and how to sanitize HTML content. ```typescript import { getAuth } from '@marcfargas/go-easy/auth'; import { getMessage, getMessageRaw, sanitizeEmailHtml } from '@marcfargas/go-easy/gmail'; import * as fs from 'fs'; const auth = await getAuth('gmail', 'user@example.com'); // Get structured message const msg = await getMessage(auth, 'MSG_ID123'); console.log(msg.from); // "sender@example.com" console.log(msg.subject); // "Re: Project Update" console.log(msg.body.text); // Plain text body console.log(msg.body.html); // HTML body (if present) console.log(msg.attachments); // [{ id, filename, mimeType, size }] // Get raw RFC 2822 message (works for embedded message/rfc822 attachments) const raw: Buffer = await getMessageRaw(auth, 'MSG_ID123'); fs.writeFileSync('message.eml', raw); // Sanitize HTML for safe rendering const safeHtml = sanitizeEmailHtml(msg.body.html || ''); // Strips