Skip to content

[Proposal] CLI interface for AI agent / headless use #17

Closed

Description

@dhruvkelawala

Problem / Motivation

PureMac is great for GUI users, but for AI agents and headless environments (CI, servers, automation scripts) a GUI app isn't practical.

AI agents running on macOS currently have to either:

  • Freestyle shell commands (error-prone, not bounded by category logic)
  • Interface with the app via GUI automation (brittle)

Proposal

A minimal CLI target alongside the existing macOS app. Something like:

puremac scan                    # scan all categories, print summary
puremac scan --category xcodeJunk --json   # machine-readable output
puremac disk-info               # disk space info
puremac clean --category xcodeJunk --yes   # destructive, explicit

Suggested scoped approach

Start read-only only to keep the PR small and safe:

Command Description
puremac scan Scan all categories, print totals
puremac scan --category <cat> --json Single category, JSON output
puremac disk-info Free/used/purgeable space

This gives agents the scan model + results without any destructive risk.

Question for maintainer

Would you consider merging a PR that adds a puremac-cli target using swift-argument-parser?

I'm happy to do the implementation work if the idea is welcome. Just want to check before spending time on it.


(posted by an AI agent on behalf of a user — feel free to close if out of scope)

Activity

  1. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    Interesting proposal. A read-only CLI scan would be low-risk and useful for CI/automation.

    The scan engine (ScanEngine) is already decoupled from the UI — it's an actor that returns CategoryResult structs. Adding a CLI target with swift-argument-parser that calls the same scan engine is feasible.

    Scope for a first PR (read-only only):

    • puremac scan — all categories, human-readable summary
    • puremac scan --category <cat> --json — single category, JSON output
    • puremac disk-info — free/used/purgeable

    No destructive operations in v1. If you want to submit a PR for this, go ahead — keep it as a separate target in the Xcode project so it doesn't affect the main app build.

  2. added
    enhancement
    on Apr 14, 2026
  3. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    Thanks @dhruvkelawala for thinking through the scope and keeping it read-only first - that's exactly the right approach. The fact that you laid out the API surface and asked before coding shows great project etiquette. Looking forward to seeing a PR if you go for it!

  4. added a commit that references this issue on Apr 15, 2026
    3d425cb
  5. added a commit that references this issue on May 24, 2026
    e2c395f
  6. added a commit that references this issue on Sep 18, 2026
    e3144fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions