agentleFS
daveebbelaardaveebbelaar/bama/skills/code/agent-cli/SKILL.md

agent-cli

Skill1.7k starsChanged 10 days agoMITView on GitHub

Optional command line and MCP server for a macOS app, so Claude Code, Codex, and scripts can drive it (list, add, change, search, act) through the running app. Use when the user wants agents to work with their app or its data, asks for a CLI, an MCP server, or automation for the app, or says "Claude should be able to use my app".

6 other projects use a version of this, 2 of them edited.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about daveebbelaar/bama

The biggest 5 of 42 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 42

Talked about on GitHub, YouTube and the web (42 times).

On GitHub · 20

15 more on GitHub

On YouTube · 13

8 more on YouTube

On the web · 9

4 more on the web

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 2 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the user stories (docs/stories/).

    line 34
  2. Very specific:

    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.

    line 42
  3. Distinctive:

    Check: every M1 story has its commands, and each command is marked.

    line 45
  4. Very specific:

    Check: the script printed "added the agent CLI", and swift build passes.

    line 59
  5. Very specific:

    Every model an agent touches gets var uuid: UUID = UUID().

    line 69
  6. Distinctive:

    All the rules: rules.md.

    line 77
  7. Very specific:

    Check: <cli-name> help lists every command from step 1, and <cli-name> help <command> shows its params and example.

    line 79
  8. Very specific:

    Check: <cli-name> --version prints the app's version.

    line 93
  9. Very specific:

    Check: the script prints PASS agent CLI.

    line 107
  10. Very specific:

    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 …

    line 111
  11. Very specific:

    Check: a fresh claude -p "List my starred items with <cli-name>" finds the CLI and answers from real data.

    line 118
  12. Very specific:

    Check: claude mcp list shows the server as connected.

    line 134

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent CLI

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

CLI, MCP, or App Intents

Way inWho uses itShip it
CLIClaude Code, Codex, scripts, people in TerminalAlways. Agents learn it from --help, and it costs no context until used
MCP (tasks mcp)Claude Desktop and other clients with no shellOptional. The same commands, one tool each. One line to register
App IntentsSiri, Spotlight, ShortcutsSeparate 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.

1. List the commands

Read the user stories (docs/stories/). Write each thing a person does as a command, <noun> <verb>, and mark it:

  • read: items list, items show, status. Safe to run any time.
  • write: items add, items update, open. Changes data, can be undone.
  • destructive: 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.

2. Add the files

"${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.

3. Write the commands

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.

  • Every model an agent touches gets var uuid: UUID = UUID(). Commands show the first 8 characters as id, and accept any unique start of it.
  • Results are small JSON objects: the fields an agent needs, not the whole model. Lists take --limit and --offset, and return total and nextOffset.
  • Errors throw 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.

4. Build and install

./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.

5. Test

"${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.

6. Teach agents

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.

7. MCP, when the user wants it

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.