Work In Menu
A small button that says where work runs, opening a menu of places: local, a new local copy, a worktree or the cloud, with an optional row to connect an account.
Installation
npx shadcn@latest add "@aiellie/work-in-menu"shadcn needs the @aiellie registry in components.json first. npx aiellie add work-in-menu adds it on its first run, then installs the same way.
Work in menu chooses where an agent runs a task: on this machine, in a fresh local copy, in a git worktree or in the cloud. The trigger shows the choice with its icon. It starts from those four, and takes a list of your own to rename, reorder or replace them.
Getting started
Hold the choice
valueis theidof the option chosen.components/task-composer.tsx"use client" import * as React from "react" import { WorkInMenu } from "@/components/aiellie/work-in-menu" export function TaskWorkIn() { const [workIn, setWorkIn] = React.useState("local") return <WorkInMenu value={workIn} onValueChange={setWorkIn} /> }Offer to connect an account
onConnectadds a row under the options, for linking an account that a cloud option needs. Without it the row is left out.<WorkInMenu value={workIn} onValueChange={setWorkIn} onConnect={() => router.push("/settings/connections")} connectLabel="Connect a cloud account" />
Anatomy
<button data-slot="work-in-menu"> {/* render, a small ghost Button by default */}
<svg /> {/* the chosen option's icon */}
<span class="sr-only">{label}: </span>
{selected.name}
</button>
<div data-slot="menu-content">
<div data-slot="menu-radio-group">
<div data-slot="menu-radio-item" /> {/* one per option */}
</div>
<div data-slot="menu-separator" /> {/* only with onConnect */}
<div data-slot="menu-item" /> {/* the connect row */}
</div>Choosing an option closes the menu. While value matches no option the trigger shows a laptop and the label. WORK_IN_OPTIONS is exported, so a list of your own can start from it.
Examples
Your own options
Pass options with an icon each, and a label that fits them.
Extend the defaults
import { WORK_IN_OPTIONS } from "@/components/aiellie/work-in-menu"
const options = [...WORK_IN_OPTIONS, { id: "ssh", name: "Remote", icon: ServerStack01Icon }]API reference
WorkInMenu
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | required | The id of the option chosen. |
onValueChange | (value: string) => void | required | Called with the id chosen. |
options | WorkInOption[] | WORK_IN_OPTIONS | The places to choose from, each { id, name, icon }. |
onConnect | () => void | Shows a row under the options that links an account. Left out, the row is too. | |
connectLabel | string | "Connect Claude Code on the web" | What the connect row says. |
label | string | "Work in" | What is being chosen, read out ahead of the option's name. |
render | ReactElement | <Button variant="ghost" size="sm" /> | The trigger's element. |
side / align | MenuContent placement | Where the menu opens. |
WORK_IN_OPTIONS
| id | name |
|---|---|
local | Local |
new-local | New local |
worktree | Worktree |
cloud | Cloud |