Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.
Sessions, Tabs & Frames
Sessions
BAP browser pages persist across CLI invocations. When a client disconnects, the server parks the browser context. On reconnect with the same session ID, state is restored.
Named Sessions
Use the -s flag to create and reuse named sessions:
All three commands operate on the same browser session. Without -s, the default session ID is cli-<port> (e.g., cli-9222).
List Sessions
bap sessions
Shows all active sessions with page counts.
string
Named session identifier. Commands with the same -s value share a browser context.
Dormant sessions expire after 5 minutes (300 seconds) by default. After expiry, a new browser
context is created on next use.
Tabs
List Open Tabs
bap tabs
Open a New Tab
bap tab-newbap tab-new https://example.com
Switch to a Tab
bap tab-select 2
number
required
Tab index (1-based) from the bap tabs output.
Close a Tab
bap tab-close
Closes the currently active tab.
Frames
For pages with iframes, use frame commands to switch context.
List Frames
bap frames
Shows all frames in the current page with their IDs.
Switch to a Frame
bap frame-switch <id>
string
required
Frame ID from the bap frames output.
After switching, all subsequent commands (click, fill, observe, etc.) operate within the selected frame.
After switching to a frame, remember to switch back to the main frame when done. Use bap frames
to see available frames and their IDs.
Multi-Session Workflows
Run parallel workflows in separate sessions:
# Terminal 1: Shopping flowbap -s=shop goto https://shop.example.com# Terminal 2: Admin panelbap -s=admin goto https://admin.example.com# Each session has its own browser context, cookies, and state
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"BAP Docs","colors":{"primary":"#1a1a1a","light":"#f5f5f5","dark":"#1a1a1a"},"logo":{"light":"https://mintcdn.com/piyushvyas/SAjWCSGGjcR0-kMU/logo/light.svg?fit=max\u0026auto=format\u0026n=SAjWCSGGjcR0-kMU\u0026q=85\u0026s=b3a82ba997e99c772bcd297add5a163d","dark":"https://mintcdn.com/piyushvyas/SAjWCSGGjcR0-kMU/logo/dark.svg?fit=max\u0026auto=format\u0026n=SAjWCSGGjcR0-kMU\u0026q=85\u0026s=f4969f383b5e6fdef8314cb987808b2e"},"favicon":"/favicon.svg","navbar":{"links":[{"href":"https://github.com/browseragentprotocol/bap","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"/getting-started/overview"}},"footer":{"socials":{"github":"https://github.com/browseragentprotocol/bap"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/browseragentprotocol/bap"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"piyushvyas","hasAudioNarration":false,"actualSubdomain":"piyushvyas","customDomains":[],"gitSource":{"type":"github","owner":"browseragentprotocol","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae94a93b9c52538cea1a305:success","clientVersion":"0.0.4286","searchFilterCounts":[{"language":"default","tag":"Documentation","count":25},{"language":"default","tag":"Protocol","count":15},{"language":"default","tag":"CLI Reference","count":13},{"language":"default","tag":"Core Concepts","count":8},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Features","count":6},{"language":"default","tag":"Getting Started","count":5},{"language":"default","tag":"MCP Reference","count":5},{"language":"default","tag":"MCP","count":5},{"language":"default","tag":"Commands","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"cli/sessions-tabs","slug":"/cli/sessions-tabs","pageMetadata":{"title":"Sessions, Tabs \u0026 Frames","description":"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.","href":"/cli/sessions-tabs"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`sessions-tabs-\u0026-frames`,children:`Sessions, Tabs \u0026 Frames`}),`\n`,_jsx(Heading,{level:`2`,id:`sessions`,children:`Sessions`}),`\n`,_jsx(_components.p,{children:`BAP browser pages persist across CLI invocations. When a client disconnects, the server parks the browser context. On reconnect with the same session ID, state is restored.`}),`\n`,_jsx(Heading,{level:`3`,id:`named-sessions`,children:`Named Sessions`}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`-s`}),` flag to create and reuse named sessions:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s=checkout`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` goto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://shop.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s=checkout`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` act`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fill:label:\"Search\"=\"headphones\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` press:Enter`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s=checkout`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` screenshot`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`All three commands operate on the same browser session. Without `,_jsx(_components.code,{children:`-s`}),`, the default session ID is `,_jsx(_components.code,{children:`cli-\u003cport>`}),` (e.g., `,_jsx(_components.code,{children:`cli-9222`}),`).`]}),`\n`,_jsx(Heading,{level:`3`,id:`list-sessions`,children:`List Sessions`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sessions`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Shows all active sessions with page counts.`}),`\n`,_jsx(ParamField,{path:`-s`,type:`string`,id:`params`,children:_jsxs(_components.p,{children:[`Named session identifier. Commands with the same `,_jsx(_components.code,{children:`-s`}),` value share a browser context.`]})}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Dormant sessions expire after 5 minutes (300 seconds) by default. After expiry, a new browser\ncontext is created on next use.`})}),`\n`,_jsx(Heading,{level:`2`,id:`tabs`,children:`Tabs`}),`\n`,_jsx(Heading,{level:`3`,id:`list-open-tabs`,children:`List Open Tabs`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tabs`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`open-a-new-tab`,children:`Open a New Tab`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tab-new`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tab-new`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://example.com`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`switch-to-a-tab`,children:`Switch to a Tab`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tab-select`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 2`})]}),`\n`]})})}),`\n`,_jsx(ParamField,{path:`index`,type:`number`,required:true,id:`param-index`,children:_jsxs(_components.p,{children:[`Tab index (1-based) from the `,_jsx(_components.code,{children:`bap tabs`}),` output.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`close-a-tab`,children:`Close a Tab`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tab-close`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Closes the currently active tab.`}),`\n`,_jsx(Heading,{level:`2`,id:`frames`,children:`Frames`}),`\n`,_jsx(_components.p,{children:`For pages with iframes, use frame commands to switch context.`}),`\n`,_jsx(Heading,{level:`3`,id:`list-frames`,children:`List Frames`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` frames`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Shows all frames in the current page with their IDs.`}),`\n`,_jsx(Heading,{level:`3`,id:`switch-to-a-frame`,children:`Switch to a Frame`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` frame-switch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id`,children:_jsxs(_components.p,{children:[`Frame ID from the `,_jsx(_components.code,{children:`bap frames`}),` output.`]})}),`\n`,_jsx(_components.p,{children:`After switching, all subsequent commands (click, fill, observe, etc.) operate within the selected frame.`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`After switching to a frame, remember to switch back to the main frame when done. Use `,_jsx(_components.code,{children:`bap frames`}),`\nto see available frames and their IDs.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`multi-session-workflows`,children:`Multi-Session Workflows`}),`\n`,_jsx(_components.p,{children:`Run parallel workflows in separate sessions:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Terminal 1: Shopping flow`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s=shop`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` goto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://shop.example.com`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Terminal 2: Admin panel`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bap`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s=admin`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` goto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://admin.example.com`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Each session has its own browser context, cookies, and state`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Sessions, Tabs \u0026 Frames","description":"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.","href":"/cli/sessions-tabs"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sessions, Tabs \u0026 Frames","slug":"sessions-tabs-\u0026-frames","depth":1,"children":[]},{"title":"Sessions","slug":"sessions","depth":2,"children":[{"title":"Named Sessions","slug":"named-sessions","depth":3,"children":[]},{"title":"List Sessions","slug":"list-sessions","depth":3,"children":[]}]},{"title":"Tabs","slug":"tabs","depth":2,"children":[{"title":"List Open Tabs","slug":"list-open-tabs","depth":3,"children":[]},{"title":"Open a New Tab","slug":"open-a-new-tab","depth":3,"children":[]},{"title":"Switch to a Tab","slug":"switch-to-a-tab","depth":3,"children":[]},{"title":"Close a Tab","slug":"close-a-tab","depth":3,"children":[]}]},{"title":"Frames","slug":"frames","depth":2,"children":[{"title":"List Frames","slug":"list-frames","depth":3,"children":[]},{"title":"Switch to a Frame","slug":"switch-to-a-frame","depth":3,"children":[]}]},{"title":"Multi-Session Workflows","slug":"multi-session-workflows","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"piyushvyas","siteName":"BAP Docs","title":"Sessions, Tabs \u0026 Frames - BAP Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-21T20:10:23.931Z","originalFileLocation":"cli/sessions-tabs.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\">\u003cmeta data-mint-head name=\"application-name\" content=\"BAP Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Sessions, Tabs \u0026amp; Frames - BAP Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"BAP Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://piyushvyas.mintlify.app/cli/sessions-tabs\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://piyushvyas.mintlify.site/_mintlify/api/og/v2?division=More\u0026amp;title=Sessions%2C+Tabs+%26+Frames\u0026amp;description=Manage+browser+sessions%2C+tabs%2C+and+frames.+Named+sessions+persist+across+CLI+invocations.\u0026amp;theme=7d79b32ea2fda985fedb2d65\u0026amp;signature=0a9976137ed66039aab025f6f0a96c6e4f117f3ff5457df888919e89921ce0fe\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Sessions, Tabs \u0026amp; Frames - BAP Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://piyushvyas.mintlify.site/_mintlify/api/og/v2?division=More\u0026amp;title=Sessions%2C+Tabs+%26+Frames\u0026amp;description=Manage+browser+sessions%2C+tabs%2C+and+frames.+Named+sessions+persist+across+CLI+invocations.\u0026amp;theme=7d79b32ea2fda985fedb2d65\u0026amp;signature=0a9976137ed66039aab025f6f0a96c6e4f117f3ff5457df888919e89921ce0fe\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/piyushvyas/-s_jUytUdpdIo1Bp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"BAP Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1a1a1a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://piyushvyas.mintlify.app/cli/sessions-tabs\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cli/sessions-tabs.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://piyushvyas.mintlify.app/#organization\",\"name\":\"BAP Docs\",\"url\":\"https://piyushvyas.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/piyushvyas/SAjWCSGGjcR0-kMU/logo/light.svg?fit=max\u0026auto=format\u0026n=SAjWCSGGjcR0-kMU\u0026q=85\u0026s=b3a82ba997e99c772bcd297add5a163d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://piyushvyas.mintlify.app#website\",\"name\":\"BAP Docs\",\"url\":\"https://piyushvyas.mintlify.app\",\"publisher\":{\"@id\":\"https://piyushvyas.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs#webpage\",\"url\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs\",\"name\":\"Sessions, Tabs \u0026 Frames\",\"description\":\"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\",\"dateModified\":\"2026-03-21T20:10:23.931Z\",\"isPartOf\":{\"@id\":\"https://piyushvyas.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"BAP Docs\",\"item\":\"https://piyushvyas.mintlify.app\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sessions, Tabs \u0026 Frames\",\"item\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs#article\",\"headline\":\"Sessions, Tabs \u0026 Frames\",\"name\":\"Sessions, Tabs \u0026 Frames\",\"description\":\"Manage browser sessions, tabs, and frames. Named sessions persist across CLI invocations.\",\"url\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs\",\"mainEntityOfPage\":{\"@id\":\"https://piyushvyas.mintlify.app/cli/sessions-tabs#webpage\"},\"dateModified\":\"2026-03-21T20:10:23.931Z\",\"publisher\":{\"@id\":\"https://piyushvyas.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://piyushvyas.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"BAP Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"BAP Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/cli/sessions-tabs.md","siteName":"BAP Docs","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/browseragentprotocol/bap"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"CLI Reference","groups":[{"group":"CLI","pages":[{"title":"CLI Overview","href":"/cli/overview"}]},{"group":"Commands","pages":[{"title":"Essentials","href":"/cli/essentials"},{"title":"Action Commands","href":"/cli/actions"},{"title":"Navigation","href":"/cli/navigation"},{"title":"Observation","href":"/cli/observation"},{"title":"Composite Actions","href":"/cli/composite-actions"}]},{"group":"Features","pages":[{"title":"Workflows","href":"/cli/workflows"},{"title":"bap run","href":"/cli/run"},{"title":"Recipes","href":"/cli/recipes"},{"title":"Tracing","href":"/cli/tracing"},{"title":"bap plan","href":"/cli/plan"},{"title":"bap watch","href":"/cli/watch"},{"title":"Eval","href":"/cli/eval"}]},{"group":"More","pages":[{"title":"Sessions, Tabs \u0026 Frames","href":"/cli/sessions-tabs"},{"title":"Configuration","description":"Configure BAP CLI defaults, install skills to AI agents, and set global options.","href":"/cli/configuration"}]}]},{"tab":"MCP Reference","pages":[{"title":"MCP Reference","href":"/mcp/overview"}]},{"tab":"Protocol","pages":[{"title":"Protocol","href":"/protocol/overview"}]}]},"basePath":"","title":"Sessions, Tabs \u0026 Frames - BAP Docs","deploymentId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","buildId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","dynamics":[],"chunks":[]}