git clone https://github.com/dannote/figma-use
cd figma-use
bun install
bun run buildbun run dev # Run proxy in dev mode
bun test # Run tests (requires Figma with plugin)Tests require Figma desktop app with the plugin installed:
-
Start Figma with debug port (required for profiling/coverage):
/Applications/Figma.app/Contents/MacOS/Figma --remote-debugging-port=9222
-
Install the plugin:
./bin/figma-use.js plugin --install
-
Open any Figma file and run the plugin (Plugins → Development → figma-use)
-
Start the proxy in another terminal:
./bin/figma-use.js proxy
-
Run tests:
cd packages/cli && bun test
Each test file creates its own page, so tests can run in parallel without conflicts.
With debug port enabled, you can profile any command:
./bin/figma-use.js profile "get components --limit 20"- Create handler in
packages/plugin/src/main.ts - Create CLI command in
packages/cli/src/commands/ - Export from
packages/cli/src/commands/index.ts - Add test in
packages/cli/tests/commands/
See AGENTS.md for code examples.
- One feature per PR
- Add tests for new commands
- Run
bun testbefore submitting