ClaudeModsClaude Code mod 디렉터리
☰
● 0 명 접속 중 · 조회 0 회
+ 프로젝트 제출
← 프로젝트 목록으로
GitHub 저장소 · Git 및 코드 리뷰

terminal-browser — Claude Code 플러그인 · ClaudeMods

이 작품 신고본인의 작품인가요? 소유권 확인

ClaudeMods에서 이 Claude Code 플러그인의 원본 소스와 필요한 권한을 확인하세요. terminal-browser: Claude Code 내에서 직접 실행되는 브라우저입니다. 웹사이트를 미리 보고 HTML 문서를 볼 수 있습니다.

zzenbu-labs@zenbu-labs
번역 완료

이 mod 소개

terminal-browser: Claude Code 내에서 직접 실행되는 브라우저입니다. 웹사이트를 미리 보고 HTML 문서를 볼 수 있습니다.

설치

terminal-browser 설치

curl -fsSL https://terminal-browser.sh/install | bash # 또는 brew install terminal-browser

최신 버전의 Claude Code를 사용 중인지 확인

claude update

~/.claude/settings.json에 다음을 추가하여 Claude Code UI 플러그인을 활성화하세요:

{
  "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" }
}

terminal-browser 플러그인 설치

# 마켓플레이스 설정
claude plugin marketplace add zenbu-labs/terminal-browser

# 플러그인 설치
claude plugin install terminal-browser@terminal-browser

이제 Claude Code 내에서 "/browser"를 실행하여 브라우저를 열 수 있습니다

업데이트

Claude Code 플러그인 업데이트

claude plugin update terminal-browser@terminal-browser

terminal-browser 업데이트

terminal-browser upgrade

구성

terminal-browser 플러그인을 구성하여 Claude가 브라우저를 열 때 사용할 수 있는 도구를 포함할 수 있습니다. Claude는 이미 terminal-browser CLI를 사용하여 분할 창을 통해 터미널 내에서 브라우저를 열 수 있으므로 기본적으로 꺼져 있습니다. ~/.claude/settings.json에 다음을 추가하여 도구를 활성화할 수 있습니다:

{
  "pluginConfigs": {
    "terminal-browser@terminal-browser": {
      "options": {
        "agentTool": true
      }
    }
  }
}

terminal-browser 플러그인 API

terminal-browser 플러그인에는 다른 Claude Code 플러그인 내에서 프로그래밍 방식으로 브라우저를 열고 URL을 로드하는 데 사용할 수 있는 API가 포함되어 있습니다. 이를 사용하여 만들 수 있는 유용한 플러그인 예:

  • /tldraw 슬래시 명령: Claude Code 분할 창에서 tldraw를 엽니다
  • /open-pr 슬래시 명령: 작업 중인 브랜치와 관련된 PR을 엽니다
export type BrowserOpenInput = { url?: string }

export type BrowserOpenResult =
  | { ok: true; url: string }
  | { ok: false; error: string }

export type Browser = {
  open: (input: BrowserOpenInput) => Promise<BrowserOpenResult>
  close: (input?: Record<string, never>) => Promise<boolean>
}

// 사용법: 플러그인의 hooks 모듈에서
on('command.run', { command: 'tldraw' }, async ($) => {
  const result = await $.browser.open({ url: 'https://www.tldraw.com/' })
  return { text: result.ok ? 'tldraw를 열었습니다' : result.error }
})

어떻게 작동하나요?

terminal-browser는 t를 사용합니다

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add zenbu-labs/terminal-browser
claude plugin install terminal-browser
원문 / README

terminal-browser claude code plugin

This plugin is experimental and does have some known limitations

https://github.com/user-attachments/assets/a79e7667-6fcb-49a4-9967-44d0f942102c

Installation

Install terminal-browser

curl -fsSL https://terminal-browser.sh/install | bash # or brew install terminal-browser

Ensure you are on the latest version of claude code

claude update

Enable claude code UI plugins by adding this to ~/.claude/settings.json:

{
  "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" }
}

Install the terminal-browser plugin

# set the marketplace
claude plugin marketplace add zenbu-labs/terminal-browser

# install the plugin
claude plugin install terminal-browser@terminal-browser

Now you can run "/browser" inside claude code to open the browser

Updating

Update the claude code plugin

claude plugin update terminal-browser@terminal-browser

Update terminal-browser

terminal-browser upgrade

Configuration

You can configure the terminal-browser plugin to include a tool that claude can use to open the browser. This is by default off, since claude can already use the terminal-browser CLI to open the browser inside the terminal through a split pane. You can enable the tool by adding the following to your ~/.claude/settings.json:

{
  "pluginConfigs": {
    "terminal-browser@terminal-browser": {
      "options": {
        "agentTool": true
      }
    }
  }
}

terminal-browser plugin API

The terminal-browser plugin comes with an API you can use within another claude code plugin to programatically open the browser and load a URL. Some examples of useful plugins you can build with this are:

  • /tldraw slash command that opens tldraw in the claude code split pane
  • /open-pr slash command that opens the PR associated with the branch you are working on
export type BrowserOpenInput = { url?: string }

export type BrowserOpenResult =
  | { ok: true; url: string }
  | { ok: false; error: string }

export type Browser = {
  open: (input: BrowserOpenInput) => Promise<BrowserOpenResult>
  close: (input?: Record<string, never>) => Promise<boolean>
}

// usage: in your plugin's hooks module
on('command.run', { command: 'tldraw' }, async ($) => {
  const result = await $.browser.open({ url: 'https://www.tldraw.com/' })
  return { text: result.ok ? 'Opened tldraw' : result.error }
})

How does it work?

terminal-browser uses the kitty graphics protocol to display pixels generated by a real browser inside the terminal. To display the browser inside claude code, we use claude codes new function hooks API.

terminal-browser's internals have been extracted to a javascript library - https://github.com/zenbu-labs/terminal-browser/tree/main/pixel - if you would like to build your own graphical application inside claude code/the terminal

Supported terminals

The terminal-browser claude code plugin will only work in terminals that support the kitty graphics protocol, and implement kitty unicode placeholders. The most popular terminals that support this feature are:

If your terminal does not support the required features, trying to open the browser inside claude code may garble the TUI

In addition any terminals that are built on libghostty will support this feature, some examples are:

You can find more libghostty based terminals here: awesome-libghostty

Even if your terminal supports the required graphics feature, if you are running a multiplexer, the plugin may not work. This is because multiplexers rewrite the output of terminal programs and breaks terminal graphics commands. tmux support will be arriving soon (terminal-browser currently works in tmux, just not through the claude code plugin yet), and within herdr performance is very bad when running through the claude code plugin, but will likely improve soon. Other multiplexers I have not tested, so if it does not work please file an issue and I will see if we can support this.

Caveats:

  • depends on your terminal supporting the kitty graphics protocol
  • the mouse position will sometimes be slightly off, since claude code does not enable pixel coordinate mouse reporting
  • the plugin needs to make fetch requests to a local http server to communicate with the terminal-browser CLI, which may cause a prompt to show in your OS that your terminal wants to access the local network
  • claude code sets a very high min width for the chat area, so its sometimes not possible to resize the browser to the size you want
  • the plugin depends on the experimental function hooks claude code API, which is unstable, so the plugin may break between releases
원본 출처 보기 ↗

비슷한 프로젝트