Docs/Workflows

Artifacts browser

The shared browser page, agent operations, restrictions and the app preview.

Artifacts is the browser panel of a thread. In the desktop app it is a real browser page that you and the agent share: the agent drives it with the pi_browser tool while you watch, click and inspect. Each thread has its own page and in-memory session.

Open a page#

  1. Start your project's dev server. For a worktree thread, start it from the worktree, on a free port.
  2. Open Artifacts from the side-panel buttons. Narrow windows show a Preview button instead.
  3. Enter the address, for example http://localhost:3000, and choose Go.
Artifacts beside a thread, showing a local demo app.
Artifacts beside a thread, showing a local demo app.
Drag the separator to resize the page. Expand fills the window; Shrink docks it again. The page and its session survive both.
Artifacts expanded to the full window.
Artifacts expanded to the full window.

Video walkthrough · English captions

Inspect a web project

Inspect a web project

Fictional demo data · Qwen3-TTS · Aiden (English)

Open the fictional Orbit Board in Artifacts, inspect its Science filter, attach a screenshot to an unsent draft, and test the filter in the same browser.

Let the agent use it#

pi_browser can:
  • navigate, go back and forward, reload and close the page;
  • take an accessibility snapshot with references to elements;
  • click, fill inputs, press keys and scroll;
  • inspect an element, including its computed styles;
  • take viewport, full-page and element screenshots;
  • read and clear console messages and runtime errors;
  • run JavaScript in the page.
Open localhost:3000 in Artifacts. Go to Settings and submit the empty form. Check the validation messages, take a screenshot and report console errors.
Element references belong to the latest snapshot; after navigation the agent takes a new one. Screenshots need a model that accepts images. Agent calls do not open the panel by themselves.

Page lifetime#

  • Closing the panel keeps the page. Close page releases it.
  • Sessions live in memory for as long as the window is open. They are not saved browser profiles.
  • Up to eight pages stay open. When the limit is reached, an idle hidden page can be closed, and its unsaved state is lost.

Restrictions#

  • Only http: and https: pages. pi-kit's own origins and schemes such as file: are blocked, including through redirects.
  • Pages have no Node.js and no access to pi-kit. Permission requests and downloads are denied; pop-ups open in the same page.
  • Self-signed certificates on a local server need Options → Allow invalid HTTPS certificates on localhost. It covers localhost, 127.0.0.0/8 and ::1 only, and changing it closes all pages.
Page text, DOM and console output are untrusted input for the agent. The browser's isolation does not limit the agent's other tools.

In a browser or on a phone#

When you use pi-kit in a browser (pi-kit open --browser) or on a paired phone, Artifacts shows an app preview in an iframe instead. It is your own session on that device; the agent cannot drive it.
ControlDoes
Address, ReloadLoad and reload the preview.
Open externallyOpen the address in a new tab. Use it when the app forbids framing or its sign-in fails in a frame.
Unload previewRelease the frame and its state.
Upload screenshotAdd an image you captured to the unsent draft.
Only exact origins listed in PI_KIT_PREVIEW_ORIGINS can be framed. Set it in the service host's environment and restart the host; the default is none.
PI_KIT_PREVIEW_ORIGINS=https://preview.example.com pi-kit serve
pi-kit does not proxy dev servers: localhost on a phone is the phone. Use an HTTPS deployment or a tunnel. The agent can publish a preview link with the pi_preview tool; the first time, pi-kit asks whether previews should open automatically (Always open, Not now, Never). Change it later with Open previews automatically at the bottom of the panel.

Attach page context#

Inspect, Screenshot and Console add context to your draft without sending it. See Screenshots, inspection and logs.