| name | xaffinity-cli-usage |
| description | Use when running xaffinity CLI commands, or when user asks to search, find, get, export, or list people, companies, opportunities, lists, or CRM data from Affinity via command line. Also use when user mentions "xaffinity", "export to CSV", or needs help with Affinity CLI commands. |
xaffinity CLI Usage
Use this skill when running xaffinity commands to interact with Affinity CRM.
REQUIRED FIRST STEP: Verify API Key
STOP. Before doing ANYTHING else, run this command:
xaffinity config check-key --json
This MUST be your first action when handling any Affinity request.
If "configured": true - Use the pattern field from the output for ALL subsequent commands:
- If
"pattern": "xaffinity --dotenv --readonly <command> --json" -> use --dotenv
- If
"pattern": "xaffinity --readonly <command> --json" -> no --dotenv needed
If "configured": false - Stop and help user set up:
- Tell them: "You need to configure an Affinity API key first."
- Direct them: Affinity -> Settings -> API -> Generate New Key
- Tell them to run:
xaffinity config setup-key (do NOT run it for them - it's interactive)
IMPORTANT: Write Operations Require Explicit User Request
Always use --readonly unless user explicitly requests writes.
Write operations include creating, updating, or deleting:
- Notes, interactions, reminders
- List entries, field values
- Persons, companies, opportunities
Destructive Commands Require Double Confirmation