Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The AI Browser Automation Framework

License

NotificationsYou must be signed in to change notification settings

browserbase/stagehand

Repository files navigation

    Stagehand

The AI Browser Automation Framework
Read the Docs

MIT LicenseSlack Community

browserbase%2Fstagehand | Trendshift

Ask DeepWiki

If you're looking for the Python implementation, you can find it here

Vibe code Stagehand withDirectorDirector

What is Stagehand?

Stagehand is a browser automation framework used to control web browsers with natural language and code. By combining the power of AI with the precision of code, Stagehand makes web automation flexible, maintainable, and actually reliable.

Why Stagehand?

Most existing browser automation tools either require you to write low-level code in a framework like Selenium, Playwright, or Puppeteer, or use high-level agents that can be unpredictable in production. By letting developers choose what to write in code vs. natural language (and bridging the gap between the two) Stagehand is the natural choice for browser automations in production.

  1. Choose when to write code vs. natural language: use AI when you want to navigate unfamiliar pages, and use code when you know exactly what you want to do.

  2. Go from AI-driven to repeatable workflows: Stagehand lets you preview AI actions before running them, and also helps you easily cache repeatable actions to save time and tokens.

  3. Write once, run forever: Stagehand's auto-caching combined with self-healing remembers previous actions, runs without LLM inference, and knows when to involve AI whenever the website changes and your automation breaks.

Getting Started

Start with Stagehand with one line of code, or check out ourQuickstart Guide for more information:

npx create-browser-app

Example

Here's how to build a sample browser automation with Stagehand:

// Stagehand's CDP engine provides an optimized, low level interface to the browser built for automationconstpage=stagehand.context.pages()[0];awaitpage.goto("https://github.com/browserbase");// Use act() to execute individual actionsawaitstagehand.act("click on the stagehand repo");// Use agent() for multi-step tasksconstagent=stagehand.agent();awaitagent.execute("Get to the latest PR");// Use extract() to get structured data from the pageconst{ author, title}=awaitstagehand.extract("extract the author and title of the PR",z.object({author:z.string().describe("The username of the PR author"),title:z.string().describe("The title of the PR"),}),);

Documentation

Visitdocs.stagehand.dev to view the full documentation.

Build and Run from Source

git clone https://github.com/browserbase/stagehand.gitcd stagehandpnpm installpnpm run buildpnpm run example# run the blank script at ./examples/example.ts

Stagehand is best when you have an API key for an LLM provider and Browserbase credentials. To add these to your project, run:

cp .env.example .envnano .env# Edit the .env file to add API keys

Installing from a branch

You can install and build Stagehand directly from a github branch usinggitpkg

In your project'spackage.json set:

"@browserbasehq/stagehand":"https://gitpkg.now.sh/browserbase/stagehand/packages/core?<branchName>",

Contributing

Note

We highly value contributions to Stagehand! For questions or support, please join ourSlack community.

At a high level, we're focused on improving reliability, extensibility, speed, and cost in that order of priority. If you're interested in contributing,bug fixes and small improvements are the best way to get started. For more involved features, we strongly recommend reaching out toMiguel Gonzalez orPaul Klein in ourSlack community before starting to ensure that your contribution aligns with our goals.

Acknowledgements

We'd like to thank the following people for their major contributions to Stagehand:

License

Licensed under the MIT License.

Copyright 2025 Browserbase, Inc.


[8]ページ先頭

©2009-2025 Movatter.jp