const path = require('path'); require('dotenv').config({ path: path.join(__dirname, '../../../../.env') }); const API_KEY = process.env.TRELLO_API_KEY; const TOKEN = process.env.TRELLO_TOKEN; if (!API_KEY || !TOKEN) { console.error("Error: TRELLO_API_KEY or TRELLO_TOKEN is missing from the .env file."); process.exit(1); } async function listBoards() { const url = `https://api.trello.com/1/members/me/boards?key=${API_KEY}&token=${TOKEN}&fields=name,url`; try { const response = await fetch(url); if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`); const boards = await response.json(); console.log("--- Your Trello Boards ---"); boards.forEach(b => console.log(`Name: ${b.name}\nID: ${b.id}\nURL: ${b.url}\n`)); } catch (error) { console.error("Failed to fetch boards:", error.message); } } listBoards();