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); } const boardId = process.argv[2]; if (!boardId) { console.error("Usage: node list_lists.js "); process.exit(1); } async function listLists() { const url = `https://api.trello.com/1/boards/${boardId}/lists?key=${API_KEY}&token=${TOKEN}&fields=name`; try { const response = await fetch(url); if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`); const lists = await response.json(); console.log(`--- Lists in Board ${boardId} ---`); lists.forEach(l => console.log(`Name: "${l.name}"\nID: ${l.id}\n`)); } catch (error) { console.error("Failed to fetch lists:", error.message); } } listLists();