Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 3.37 KB

commands.md

File metadata and controls

60 lines (42 loc) · 3.37 KB

Command guide

Agent plugins

After installing the CLI, add the plugin to your agent. Claude Code and Codex share one skill, apple-apps, which uses the same shell commands and macOS permissions.

Claude Code

claude plugin marketplace add rishirsv/apple-cli
claude plugin install apple-cli@apple-cli-tools

Codex

codex plugin marketplace add rishirsv/apple-cli
codex plugin add apple-cli@apple-cli-tools

In a new session, try “Find the notes that mention renewal date.”

Reads

apple-cli contacts find "Alex Chen" --fields name,emails
apple-cli notes find "renewal date"
apple-cli notes count "renewal date" --folder-id "$folder_id"
apple-cli notes get "$note_id" --fields text
apple-cli reminders lists
apple-cli reminders find "invoice" --list-id "$list_id"
apple-cli reminders get "$reminder_id" --fields title,tags,section
apple-cli reminders subtasks "$reminder_id"
apple-cli photos count --type video --favorite
apple-cli photos find --from 2026-01-01 --before 2026-02-01 --limit 5
apple-cli photos thumbnail "$asset_id" --out preview.jpg

Use apple-cli PROVIDER --help to discover commands. Dates without times use the local time zone. A thumbnail request can use --download to allow PhotoKit to obtain the selected rendition from iCloud. Notes searches all accessible accounts and folders by default. Its results report how many notes were scanned and how many bodies were unreadable. Search matches note titles and plaintext. Note attachments are outside the search scope.

List responses contain items and optionally nextCursor. Repeat the original query and add --cursor TOKEN to continue. Default pages contain up to 20 rows and 4 KiB of JSON. A truncated row retains its ID for detail. For an oversized detail record, concatenate successive fragment strings and parse the resulting JSON. For a note requested with --fields text, concatenate successive text strings. A stale detail cursor requires a fresh lookup. IDs refer to this Mac’s provider. Results reflect the account data currently available on the Mac. Errors go to stderr with a nonzero exit status.

Verification and Notes benchmark

swift test
scripts/bench-notes --self-test
scripts/bench-cli-tokens
scripts/bench-notes --cli ~/.local/bin/apple-cli --out /tmp/apple-cli-notes-benchmark.json

The live benchmark scans the readable library. It measures common, rare, missing, and folder-filtered phrases, with first-page, complete traversal, and count times. It records aggregate coverage and timings. Query strings, note IDs, and note contents stay out of the report. The default targets are 2 seconds to a first page and 10 seconds for a full scan. Pass --first-page-target and --full-scan-target to change them before measuring. A library too small to exercise the cases cannot settle the indexing decision.

The optional fixture token check uses uv to run tiktoken. The CLI itself has no Python or tokenizer dependency.

Notes currently uses direct reads. Use the benchmark on the target library to decide whether an index is warranted.

Updating the installation

Run ./scripts/install again after updating the source. Add ~/.local/bin to PATH to use the shorter apple-cli command. Keep the local signing identity in ~/Library/Application Support/AppleCLI Signing for future updates. To use an existing signing certificate from the first installation, pass --identity NAME.