/ clis / antigravity / new.js
new.js
 1  import { cli, Strategy } from '@jackwener/opencli/registry';
 2  export const newCommand = cli({
 3      site: 'antigravity',
 4      name: 'new',
 5      description: 'Start a new conversation / clear context in Antigravity',
 6      domain: 'localhost',
 7      strategy: Strategy.UI,
 8      browser: true,
 9      args: [],
10      columns: ['status'],
11      func: async (page) => {
12          await page.evaluate(`
13        async () => {
14          const btn = document.querySelector('[data-tooltip-id="new-conversation-tooltip"]');
15          if (!btn) throw new Error('Could not find New Conversation button');
16          
17          // In case it's disabled, we must check, but we'll try to click it anyway
18          btn.click();
19        }
20      `);
21          // Give it a moment to reset the UI
22          await page.wait(0.5);
23          return [{ status: 'Successfully started a new conversation' }];
24      },
25  });