In short.
Agent CLI is a development skill for adding AI control to Swift Mac apps, but its templates need app-specific code and verification. It provides a shared command registry, local socket transport, CLI, optional MCP server, and integration and checking scripts. The design keeps commands inside the running app rather than opening its database from another process. Destructive safeguards remain each command's responsibility, and the examples do not establish reuse of existing UI validation or Undo behavior. The supplied code was not run; build success, live window updates and client interoperability remain unverified.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete skills/code/agent-cli folder at revision 22dc792ea040a35270c219c669f626594267aa1f: SKILL.md, agents/openai.yaml, rules.md, teach-agents.md, scripts/add-agent-cli.sh, scripts/check-agent-cli.sh, template/Main.swift, and template/Agent/AgentCLI.swift, AgentCommands.swift, AgentCore.swift, AgentMCP.swift and AgentSocket.swift. Includes the repository-root LICENSE as the related notice. Excludes the rest of bama, including the parent app template, host model and view implementations, build configuration and user stories. All findings derive from supplied source text. Compilation, installation, database isolation, runtime safety, window updates, Undo, performance and end-to-end assistant or MCP journeys were not tested.
The overview
Identity
Agent CLI is the skills/code/agent-cli skill in the daveebbelaar/bama repository. It combines assistant instructions, Swift implementation templates, shell scripts and guidance for teaching agents to use the resulting app interface. Its interface metadata describes support for Claude Code, Codex and scripts.
The original resource address is [https://github.com/daveebbelaar/bama/tree/main/skills/code/agent-cli]. The source described here is pinned to revision 22dc792ea040a35270c219c669f626594267aa1f at [https://github.com/daveebbelaar/bama/tree/22dc792ea040a35270c219c669f626594267aa1f/skills/code/agent-cli].
Assessment
This is useful scaffolding for a developer who owns a Mac app and wants agents to inspect and change its data through explicit commands. One registry supplies CLI commands, help schemas and MCP tools, reducing the number of interfaces that must be maintained separately.
It is not a ready-made interface for arbitrary installed apps. The examples depend on bama-specific models and navigation types. Although the guidance requires commands to reuse the functions behind UI buttons, the sample commands directly edit and save a SwiftData context. Whether they preserve an application's validation, side effects and Undo behavior depends on the integration.
Users
The main audience is developers building or maintaining Swift Mac apps, especially apps based on the bama template. Beginners get a staged integration guide and concrete commands, but still need to understand their app's models, persistence and startup code.
After integration, terminal users, scripts and coding assistants can use the CLI. Clients without shell access can use the optional MCP interface. End users cannot apply this skill to an unrelated app without developer work.
Capabilities
The sample registry includes status, listing, showing, adding, updating and deleting items, plus opening a sidebar page. Listing supports starred-item filtering, title or notes search, limits and offsets. Results include compact item fields, a total count and a nextOffset when another page exists.
The CLI provides human-readable output, JSON output, command help, machine-readable schemas and distinct exit codes for usage errors, missing items and unavailable apps. Items expose eight-character UUID prefixes, and lookup accepts an unambiguous prefix.
The optional MCP server converts commands such as items add into tools named items_add. Tool descriptions and schemas come from the same registry, with readOnlyHint and destructiveHint annotations.
Using it
Requirements
The implementation targets macOS and uses Swift, Foundation, AppKit and SwiftData. It expects host-app types including AppModel, Item and SidebarItem, along with a compatible app entry point and view startup hook. Minimum macOS and Swift versions are not established by the supplied files.
The integration script runs under zsh and expects Sources/<App>/App.swift, ContentView.swift and build.sh in the template's layout. The checking script also uses Python 3 and lsof. The complete host app, package configuration and parent app template are outside the supplied scope.
Using a coding assistant requires that assistant separately. MCP is optional for shell-based use and requires a compatible client when enabled; supported client versions are unknown.
Mechanism
The app binary doubles as its command-line program. Main.swift dispatches command invocations to AgentCLI and otherwise starts the app. The CLI sends a JSON request over a Unix domain socket, and the running app dispatches it to a registered command on the main actor. This keeps the CLI from becoming a second database writer.
The normal socket lives under the app's Application Support directory and is assigned mode 0600. If the initial connection fails, the CLI attempts to launch the app in the background and retries for roughly ten seconds. The --no-launch option instead returns an unavailable-app error.
MCP runs as a separate invocation of the same binary, exchanging line-delimited JSON-RPC messages over standard input and output and forwarding tool calls through the socket. APP_AGENT_SOCKET changes the socket location; APP_STORE also selects a corresponding socket path for test use.
Setup
The documented process begins by mapping user actions to commands and distinguishing reads, ordinary writes and destructive actions. The integration script takes an app folder and a lowercase CLI name, copies the Swift templates, moves the app entry point to Main.swift, and attempts to add socket startup and a build-time CLI link.
The developer must replace the example registry with app-specific commands and provide UUIDs for exposed models. The installer relies on the template's file layout and text patterns; its output may request manual socket startup or link changes. Apps built from another structure require manual integration.
The build instructions install the app and link its binary under ~/.local/bin. Separate guidance describes an app-specific agent skill and optional MCP registration using the full binary path. The scripts and registration examples were not executed, so successful installation is unknown.
Example
For an adapted app whose CLI is named tasks, tasks items list --starred --limit 10 --json requests up to ten starred items. An agent can then use an ID from that response with tasks items show <id> --json. These are illustrative commands, not observed results.
The sample tasks items add --title "Buy milk" --starred --json creates and selects an item. For deletion, tasks items delete <id> --json returns a preview without changing data; adding --yes enables deletion. That preview behavior is explicitly implemented in the example delete handler and must also be implemented for new destructive commands.
Assessment & evidence
Limitations
Destructive flags describe commands and expose confirmation options, but the router does not centrally block destructive execution. The sample delete handler checks confirmation itself. New destructive handlers need equivalent checks; an annotation alone does not provide a preview or require human approval.
Socket permissions restrict access to the same Mac user, rather than distinguishing trusted agents from other processes running as that user. The implementation does not establish per-client authentication or authorization. Assistant-service handling of app data returned through the interface is also unknown.
The sample list command fetches all items before filtering and pagination, so its performance on large stores is unmeasured. Integer pagination values have no non-negative bounds checks before dropFirst and prefix, creating an input-validation concern.
Build compatibility, window refresh, Undo, database isolation and actual MCP client behavior are unverified. The automatic checker does not exercise write commands, read commands with required parameters, or MCP tool execution.
Design rationale
The strongest architectural benefit is routing automation through the running app. If commands call the same model operations as UI buttons, validation and side effects can remain in one place while the window observes those changes. The source supports that design, but does not demonstrate that every sample operation shares a UI handler.
A shared registry also gives developers one place to maintain command descriptions, parameter schemas and MCP tools. The tradeoff is that useful coverage, correct safety classifications and application-specific behavior still depend on the commands the developer writes.
Alternatives
Within this resource, CLI-only integration is the simpler documented route for terminal users, scripts and assistants with shell access. The optional MCP layer serves clients without a shell and exposes the same command set. Neither route was compared through execution.
The documentation identifies App Intents as separate work for Siri, Spotlight and Shortcuts. It argues against direct database access, AppleScript, URL schemes and an embedded XPC service as the main agent channel, citing consistency, response handling and integration concerns. These are the author's design arguments; no independent comparison or third-party alternative assessment is supplied.
Evidence
The available source includes all twelve files in the selected skill folder and the repository's root MIT notice. It supports examination of the instructions, installation edits, command parsing, sample model operations, socket transport and MCP implementation. It does not include the complete host app or execution receipts.
The checking script inspects help and schemas, unknown-command errors, JSON responses from read-only commands without required parameters, and MCP initialization and tool listing. It sets temporary store and socket paths and attempts to stop the test process and remove its store files. Actual database isolation depends on the host app honoring APP_STORE.
The documented manual write checks, visual window checks and fresh-agent task are additional requirements, not supplied results. Nothing was executed, so the script's success message is not evidence that these checks passed.
Access & freshness
Costs
The MIT licence grants permission to use and redistribute the software without a licence fee. That does not establish the total cost of adopting it.
The supplied implementation contains no model inference or paid model API integration. Any charges for a chosen assistant service, development effort, maintenance or app distribution are unknown from the evidence. No usage-cost estimates or performance measurements are supplied.
Rights
The supplied repository LICENSE is MIT, with copyright attributed to Dave Ebbelaar in 2026. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.
The licence disclaims warranty and liability. Its notice is available at [https://raw.githubusercontent.com/daveebbelaar/bama/22dc792ea040a35270c219c669f626594267aa1f/LICENSE]. Separate terms for an assistant service or a developer's host app are not established here.
Freshness
The supplied source snapshot is revision 22dc792ea040a35270c219c669f626594267aa1f, captured on 15 November 2026 at 19:09:28 UTC. The main-branch address may subsequently contain different files; these findings apply to the pinned revision.
No release history or supported-platform matrix is supplied. The MCP server's literal serverInfo version of 1.0 and its protocol fallback of 2025-06-18 do not establish a published skill release or verified client compatibility. Subsequent changes and maintenance activity are unknown.
Adoption steps
Before integration, map the intended app journeys to commands and identify existing model functions that preserve validation, side effects and Undo. Review the installer's expected file patterns against the app's structure and inspect its resulting entry-point, socket-startup and build-link changes.
Validate pagination bounds and every write parameter. Implement confirmation checks inside each destructive handler, and verify that an unconfirmed call changes nothing. Treat socket access as access by the current Mac user, rather than proof of individual agent approval.
Confirm that the host app honors a temporary APP_STORE before trial writes. Then use the supplied checker and supplement it with required-parameter reads, write and destructive-preview checks, actual MCP tool calls, visual window checks and a fresh-agent task. These are recommended verification steps; no outcomes are established.
