Skip to content

Quick Start

This guide walks you through writing and running a simple automation script. You’ll navigate to a page, extract some text, and store it — all in about 5 minutes.

Launch Guida and navigate to https://news.ycombinator.com using the address bar.

Press Ctrl+N to open a new script tab, or go to File > New Script.

Paste this into the editor:

async function main() {
// Get the page title
const title = await g.page.executeJS("document.title");
g.log("Page title: " + title);
// Extract the top 5 story titles
const stories = await g.page.executeJS(`
Array.from(document.querySelectorAll('.titleline > a'))
.slice(0, 5)
.map(a => a.textContent)
`);
// Log each story
for (const story of stories) {
g.log(" " + story);
}
g.log("Done! Found " + stories.length + " stories.");
}

Press F5 or click the Run button. Watch the Console pane for output — you’ll see the page title and the top 5 Hacker News stories.

Let’s save the data to a workspace store. First, open a workspace folder via File > Open Workspace (any empty folder works).

Then modify the script to store results:

async function main() {
const stories = await g.page.executeJS(`
Array.from(document.querySelectorAll('.titleline > a'))
.slice(0, 5)
.map(a => ({ title: a.textContent, url: a.href }))
`);
// Store each story
for (const story of stories) {
const key = story.title.toLowerCase().replace(/\s+/g, '-').slice(0, 50);
g.store.put("hn-stories", key, story);
}
const count = g.store.count("hn-stories");
g.log(`Stored ${count} stories in 'hn-stories' collection`);
}

Run again with F5. The stories are now persisted in your workspace’s store — they’ll survive app restarts.

  • Browse the full g.* API in the script editor — type g. and IntelliSense will show all available methods
  • Generate scripting support files from Tools > Developer > Generate Scripting Support Files… if you want local editor or LLM context files
  • Try the Recipes for real workflow examples
  • Learn how Workspaces store scripts, queues, and data
  • Try await g.dom.click(".selector") to interact with page elements
  • Connect an MCP-capable LLM for AI-driven automation