xaffinity-cli-usage

xaffinity-cli-usage is a skill for Claude Code, Codex from yaniv-golan/affinity-sdk. It costs 30 tokens per session (5,807 once invoked), scanned B, original, MIT.

A command-line tool for working with Affinity, a customer-relationship management system used to track contacts and business relationships.

In plain words
What is it for?
Use it to look up CRM data, narrow results, export records, and manage Affinity information from a terminal.
Why use it?
It gives an agent a defined way to search, filter, export, and manage Affinity records while checking that an API key is configured first.

Skill for Claude CodeCodex

Part of the affinity-crm-cli-xaffinity-unofficial plugin — 1 skill, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/yaniv-golan/affinity-sdk/xaffinity-cli-usage
Any agent
npx skills add yaniv-golan/affinity-sdk --skill xaffinity-cli-usage
Clone the repo
git clone --depth 1 https://github.com/yaniv-golan/affinity-sdk

Made for: Claude Code, Codex.

Or install affinity-crm-cli-xaffinity-unofficial, the plugin that ships this one along with the rest of its 1 skill, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xaffinity-cli-usage

README.md
[![agentmods](https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/xaffinity-cli-usage.svg)](https://agentmods.dev/skills/yaniv-golan/affinity-sdk/xaffinity-cli-usage)
Your own site
<a href="https://agentmods.dev/skills/yaniv-golan/affinity-sdk/xaffinity-cli-usage"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/xaffinity-cli-usage.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,807 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.05807
Opus 5 $0.00015 $0.02903
Sonnet 5 $0.00006 $0.01161
Haiku 4.5 $0.00003 $0.00581

Measured 3d ago against content hash 7a53b221be0f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

xaffinity-cli-usage scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **`AFFINITY_API_KEY_FILE`** — write the key to a file in the project workdir (e.g., `.xaffinity-key`, gitignored, `chmod 600`) and `export AFFINITY_API_KEY_FILE=/path/to/.xaffinity-key`. Equivalent reach as `.env` but
plugins/xaffinity-cli/skills/xaffinity-cli-usage/SKILL.md · 498 lines

How it starts

The opening of the file, as written. The whole thing — 498 lines — stays where its author put it; the contents beside it link to each section on GitHub.

xaffinity CLI Usage

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. The xaffinity CLI resolves the API key in this order:

  1. AFFINITY_API_KEY env var
  2. AFFINITY_API_KEY_FILE env var (path to a file containing the key — Docker secrets / k8s convention)
  3. AFFINITY_API_KEY_COMMAND env var (shell command whose stdout is the key — git-credential-helper style; works with op / pass / vault / macOS security)
  4. --api-key-file <path> or --api-key-stdin CLI flags
  5. xaffinity config setup-key config file (saved to system keychain on supported platforms)

For most users:

  • 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)

For users with an existing secret manager (1Password, vault, pass, Keychain), suggest AFFINITY_API_KEY_COMMAND as a credential-helper-style integration instead.

Cowork-specific edge case: if you are running inside a Claude Cowork session and the host CLI is configured but check-key returns configured: false, the key likely lives in a host-only location (env var, ~/.config/, keychain, host-only credential helper) that the microVM does not mount. Two host-portable options:

  • Project .env + --dotenv — create a project-scope .env file with AFFINITY_API_KEY=…. The project workdir IS mounted into the VM. This is the most common Cowork path.
  • AFFINITY_API_KEY_FILE — write the key to a file in the project workdir (e.g., .xaffinity-key, gitignored, chmod 600) and export AFFINITY_API_KEY_FILE=/path/to/.xaffinity-key. Equivalent reach as .env but works without --dotenv on the command line.

Read the full file on GitHub · 498 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 498 lines · 30 tokens per session scan B 7a53b221be0f

Subscribe to this mod's changes

xaffinity-cli-usage is a skill published in the GitHub repository yaniv-golan/affinity-sdk (0 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 5,807 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

merit-lhv

How to pull an LHV bank statement straight into Merit Aktiva without touching a file export — LHV's own MCP server returns camt.053 XML, which is exactly what Merit's bank-statement import accepts. Covers connecting LHV (OAuth2 + Smart-ID, read-only), the 31-day window, the multi-currency trap, and where the statement…

Elnora-AI/elnora-merit-aktiva · 227 tokens

merit-payments-bank

How to record payments and reconcile the bank statement correctly in Merit Aktiva (maksed / pank) via the elnora-merit CLI. The core skill is choosing the right transaction type for each line — customer receipt, vendor/tax payment, other income, or other expenditure — plus bank-statement import, settlements…

Elnora-AI/elnora-merit-aktiva · 215 tokens

merit-stripe

How Stripe payments must be set up and recorded in Merit Aktiva — the canonical clearing-account method. Stripe is a payment intermediary, not your bank: never book the bank deposit as revenue (it arrives NET of fees). Each Stripe payout is booked as ONE summary GL batch — gross card sales as revenue + output VAT…

Elnora-AI/elnora-merit-aktiva · 201 tokens

merit-tsd

The Estonian TSD (tulu- ja sotsiaalmaksu deklaratsioon) annexes that are NOT payroll: lisa 5 (gifts, donations, entertainment/vastuvõtukulud) and lisa 6 (expenses unrelated to business — fines, sunniraha, tax-authority interest). Covers what makes a TSD mandatory for a month, the 22/78 gross-up, the exact e-MTA form…

Elnora-AI/elnora-merit-aktiva · 298 tokens

merit-vat-kmd

How VAT and the Estonian VAT return (käibedeklaratsioon / KMD) work in Merit Aktiva, and how to get them right from the elnora-merit CLI. Covers the tax-code model, paying the VAT, what feeds each KMD line, time-of-supply, and pulling supporting VAT figures. The KMD itself is generated and filed in the Merit UI — the…

Elnora-AI/elnora-merit-aktiva · 213 tokens

merit-palk-employees

How to onboard employees and maintain contracts, contacts, and base salary agreements in Merit Palk via elnora-merit palk. Covers the sendemployees-vs-sendpayterms distinction, required import codes, and reading the employee / agreement lists. Use when: adding a new employee, creating a first contract, setting or…

Elnora-AI/elnora-merit-aktiva · 159 tokens