/bama:agent-cli <cli-name, like tasks or mail>from bama
Adds a CLI and optional MCP server to a macOS app so agents (Claude Code, Codex, scripts) can list, add, change, search, and act through the running app. Use when the user wants agent-driven automation for their app.
Ships in bama. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Give the app a command line, so an agent can do everything a person can
do in the window: tasks items add --title "Call the dentist". The app
binary is the CLI. Each command goes to the running app over a private
socket, runs there like a button press, and the window updates live.
Claude Code --bash--> tasks items add ... --socket--> Tasks.app (runs the command, saves, redraws)
Claude Desktop --MCP--> tasks mcp --socket--> same commands, same app
| Way in | Who uses it | Ship it |
|---|---|---|
| CLI | Claude Code, Codex, scripts, people in Terminal | Always. Agents learn it from --help, and it costs no context until used |
MCP (tasks mcp) | Claude Desktop and other clients with no shell | Optional. The same commands, one tool each. One line to register |
| App Intents | Siri, Spotlight, Shortcuts | Separate work. Agents cannot call them |
The CLI talks to the running app, never to the database file. Then there is one writer, the app's checks and side effects run, and the window shows the change at once. If the app is closed, the CLI opens it in the background. Rules and reasons: rules.md.
Read the user stories (docs/stories/). Write each thing a person does as
a command, <noun> <verb>, and mark it:
items list, items show, status. Safe to run any time.items add, items update, open. Changes data, can be undone.items delete, mail send. Only reports what it would
do until --yes is given.Add status (is it running, what is open, counts) and open <page> (show
a page in the window), so an agent can see and steer the app.
Check: every M1 story has its commands, and each command is marked.
"${CLAUDE_SKILL_DIR}/scripts/add-agent-cli.sh" <app-folder> <cli-name>
It copies Sources/<App>/Agent/ (core, socket, CLI, MCP, example
commands) and Main.swift, moves @main to Main.swift, starts the socket
in the main view's .task, and makes build.sh link
~/.local/bin/<cli-name>. Apps not made from the template: do the same
by hand, following the script.
Check: the script printed "added the agent CLI", and swift build passes.
Replace the examples in Agent/AgentCommands.swift. Each command has a
name, a one-line summary, its params, a full example, its mark
(readOnly or destructive), and a run that uses the same model code
as the window's buttons. Never copy logic: call the function the button
calls.
var uuid: UUID = UUID(). Commands
show the first 8 characters as id, and accept any unique start of it.--limit and --offset, and return total
and nextOffset.AgentError with a message that says how to fix it:
"no item with id 3f2a. Run tasks items list".All the rules: rules.md.
Check: <cli-name> help lists every command from step 1, and
<cli-name> help <command> shows its params and example.
./build.sh
<cli-name> help
build.sh installs the app and links ~/.local/bin/<cli-name> to the
binary inside it, so the CLI always matches the app. If the shell cannot
find it, add ~/.local/bin to PATH in ~/.zshrc.
Check: <cli-name> --version prints the app's version.
"${CLAUDE_SKILL_DIR}/scripts/check-agent-cli.sh" <cli-name>
It starts a test copy of the app on a temporary database, checks help,
JSON output, error codes, every read command, and the MCP tool list, then
quits the test copy. Then run each write command once by hand, with
APP_STORE=/tmp/<App>-test.store, and look at the window: the change shows
without a reload.
Check: the script prints PASS agent CLI.
Write .claude/skills/<cli-name>/SKILL.md in the app's repo from
teach-agents.md: what the app is, the safety rules,
the main commands, and "run <cli-name> help for the rest". To use the
app from any folder, also copy it to ~/.claude/skills/<cli-name>/. Add
one line to the app's CLAUDE.md: "Drive the app with <cli-name>. See
.claude/skills/<cli-name>/SKILL.md."
Check: a fresh claude -p "List my starred items with <cli-name>" finds
the CLI and answers from real data.
For Claude Desktop, or to get one approval prompt per tool:
claude mcp add --scope user <cli-name> -- ~/Applications/<App>.app/Contents/MacOS/<App> mcp
codex mcp add <cli-name> -- ~/Applications/<App>.app/Contents/MacOS/<App> mcp
Claude Desktop: add it to ~/Library/Application Support/Claude/claude_desktop_config.json
under mcpServers, with the full path and "args": ["mcp"]. More in
teach-agents.md.
Check: claude mcp list shows the server as connected.
Done when every command from step 1 runs through the CLI against the
running app, check-agent-cli.sh prints PASS agent CLI, the app's repo
has the agent skill from step 6, and a fresh Claude Code session can do a
real task with it.
agents/openai.yaml (opens in a new tab)rules.md (opens in a new tab)scripts/add-agent-cli.sh (opens in a new tab)scripts/check-agent-cli.sh (opens in a new tab)teach-agents.md (opens in a new tab)template/Agent/AgentCLI.swift (opens in a new tab)template/Agent/AgentCommands.swift (opens in a new tab)template/Agent/AgentCore.swift (opens in a new tab)template/Agent/AgentMCP.swift (opens in a new tab)template/Agent/AgentSocket.swift (opens in a new tab)template/Main.swift (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
macos-app, cli, mcp-server, app-automation, agent-integration
npx claudepluginhub daveebbelaar/bama --plugin bama21 skills in this plugin
/app-briefOne-page brief (docs/BRIEF.md) for a new macOS app, written before any code. Use when the user has an app idea, wants to replace an app they pay for, or the research and clone skills are done./app-iconLiquid Glass macOS app icon made as an Icon Composer file (Icon/AppIcon.icon, JSON plus SVG layers), compiled with actool, and reviewed in every look with ictool. Use when the user wants an app icon, a better icon, or a Dock icon./bamaBuild any Mac app. Start here to pick the next skill for a native macOS app./build-and-verifyBuild a SwiftUI macOS app from the command line, install it, and check light and dark window snapshots of every page before calling a change done. Use after any UI code change, when a build fails, or when the user asks to run, screenshot, or check the app./cloneWalk through any existing app (native Mac app with computer use, web app with a browser), screenshot every screen, menu, and dialog, write a screen index, and turn it into user stories. Use when the user wants to clone, rebuild, replace, or copy the design of an app, or says "screenshot every screen"./design-from-appRebuild the look of an app the user likes as a native SwiftUI design kit, by measuring its screenshots (sizes, spacing, type, colors, icons), building its parts, and comparing pixel by pixel until they match. Use when the user names an app whose look they want, shares screenshots of one, or says "make it look like X".Other plugins' skills for the same job