KosmoKrator

productivity

Affinity CLI for AI Agents

Use the Affinity CLI from KosmoKrator to call Affinity tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Affinity CLI Setup

Affinity can be configured headlessly with `kosmokrator integrations:configure affinity`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure affinity --set api_key="$AFFINITY_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor affinity --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_key AFFINITY_API_KEY Secret secret yes API Key
url AFFINITY_URL URL url no API Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call affinity.affinity_get_current_user '{}' --json
Provider shortcut
kosmo integrations:affinity affinity_get_current_user '{}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs affinity --json
kosmo integrations:docs affinity.affinity_get_current_user --json
kosmo integrations:schema affinity.affinity_get_current_user --json
kosmo integrations:search "Affinity" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

affinity.affinity_get_current_user

Get the authenticated Affinity user and API permissions.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_current_user '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_current_user '{}' --json

affinity.affinity_list_contacts

List persons in Affinity.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contacts '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contacts '{}' --json

affinity.affinity_get_contact

Get a person by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_contact '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_contact '{}' --json

affinity.affinity_create_contact

Create a person using Affinity API.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_create_contact '{}' --json
Shortcut
kosmo integrations:affinity affinity_create_contact '{}' --json

affinity.affinity_list_contact_fields

List person field metadata.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contact_fields '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contact_fields '{}' --json

affinity.affinity_list_contact_field_values

List field values on a person.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contact_field_values '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contact_field_values '{}' --json

affinity.affinity_get_contact_field_value

Get a single field value on a person.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_contact_field_value '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_contact_field_value '{}' --json

affinity.affinity_list_contact_lists

List lists where a person appears.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contact_lists '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contact_lists '{}' --json

affinity.affinity_list_contact_list_entries

List list entries for a person.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contact_list_entries '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contact_list_entries '{}' --json

affinity.affinity_list_contact_notes

List notes related to a person.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_contact_notes '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_contact_notes '{}' --json

affinity.affinity_list_organizations

List companies in Affinity.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organizations '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organizations '{}' --json

affinity.affinity_get_organization

Get a company by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_organization '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_organization '{}' --json

affinity.affinity_create_organization

Create a company using Affinity API.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_create_organization '{}' --json
Shortcut
kosmo integrations:affinity affinity_create_organization '{}' --json

affinity.affinity_list_organization_fields

List company field metadata.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organization_fields '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organization_fields '{}' --json

affinity.affinity_list_organization_field_values

List field values on a company.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organization_field_values '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organization_field_values '{}' --json

affinity.affinity_get_organization_field_value

Get a single field value on a company.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_organization_field_value '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_organization_field_value '{}' --json

affinity.affinity_list_organization_lists

List lists where a company appears.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organization_lists '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organization_lists '{}' --json

affinity.affinity_list_organization_list_entries

List list entries for a company.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organization_list_entries '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organization_list_entries '{}' --json

affinity.affinity_list_organization_notes

List notes related to a company.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_organization_notes '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_organization_notes '{}' --json

affinity.affinity_list_opportunities

List opportunities in Affinity.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_opportunities '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_opportunities '{}' --json

affinity.affinity_get_opportunity

Get an opportunity by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_opportunity '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_opportunity '{}' --json

affinity.affinity_list_opportunity_notes

List notes related to an opportunity.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_opportunity_notes '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_opportunity_notes '{}' --json

affinity.affinity_list_lists

List Affinity lists.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_lists '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_lists '{}' --json

affinity.affinity_get_list

Get metadata for a list.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_list '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_list '{}' --json

affinity.affinity_list_list_fields

List field metadata for a list.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_list_fields '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_list_fields '{}' --json

affinity.affinity_list_list_entries

List entries on a list.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_list_entries '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_list_entries '{}' --json

affinity.affinity_get_list_entry

Get one list entry.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_list_entry '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_list_entry '{}' --json

affinity.affinity_list_list_entry_fields

List field values on a list entry.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_list_entry_fields '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_list_entry_fields '{}' --json

affinity.affinity_get_list_entry_field

Get one field value on a list entry.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_list_entry_field '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_list_entry_field '{}' --json

affinity.affinity_update_list_entry_field

Update one field value on a list entry.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_update_list_entry_field '{}' --json
Shortcut
kosmo integrations:affinity affinity_update_list_entry_field '{}' --json

affinity.affinity_batch_update_list_entry_fields

Batch update field values on a list entry.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_batch_update_list_entry_fields '{}' --json
Shortcut
kosmo integrations:affinity affinity_batch_update_list_entry_fields '{}' --json

affinity.affinity_list_saved_views

List saved views for a list.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_saved_views '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_saved_views '{}' --json

affinity.affinity_get_saved_view

Get saved view metadata.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_saved_view '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_saved_view '{}' --json

affinity.affinity_list_saved_view_entries

List entries on a saved view.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_saved_view_entries '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_saved_view_entries '{}' --json

affinity.affinity_list_notes

List notes.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_notes '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_notes '{}' --json

affinity.affinity_get_note

Get a note by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_note '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_note '{}' --json

affinity.affinity_list_note_replies

List replies for a note.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_note_replies '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_note_replies '{}' --json

affinity.affinity_list_note_persons

List persons attached to a note.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_note_persons '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_note_persons '{}' --json

affinity.affinity_list_note_companies

List companies attached to a note.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_note_companies '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_note_companies '{}' --json

affinity.affinity_list_note_opportunities

List opportunities attached to a note.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_note_opportunities '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_note_opportunities '{}' --json

affinity.affinity_list_calls

List call interactions.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_calls '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_calls '{}' --json

affinity.affinity_list_emails

List email interactions.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_emails '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_emails '{}' --json

affinity.affinity_list_meetings

List meeting interactions.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_meetings '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_meetings '{}' --json

affinity.affinity_list_chat_messages

List chat message interactions.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_chat_messages '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_chat_messages '{}' --json

affinity.affinity_list_transcripts

List transcripts.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_transcripts '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_transcripts '{}' --json

affinity.affinity_get_transcript

Get a transcript by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_get_transcript '{}' --json
Shortcut
kosmo integrations:affinity affinity_get_transcript '{}' --json

affinity.affinity_list_transcript_fragments

List fragments for a transcript.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_list_transcript_fragments '{}' --json
Shortcut
kosmo integrations:affinity affinity_list_transcript_fragments '{}' --json

affinity.affinity_semantic_search

Perform semantic search.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_semantic_search '{}' --json
Shortcut
kosmo integrations:affinity affinity_semantic_search '{}' --json

affinity.affinity_api_get

Call a safe relative Affinity API path with GET.

Read read
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_api_get '{}' --json
Shortcut
kosmo integrations:affinity affinity_api_get '{}' --json

affinity.affinity_api_post

Call a safe relative Affinity API path with POST.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_api_post '{}' --json
Shortcut
kosmo integrations:affinity affinity_api_post '{}' --json

affinity.affinity_api_put

Call a safe relative Affinity API path with PUT.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_api_put '{}' --json
Shortcut
kosmo integrations:affinity affinity_api_put '{}' --json

affinity.affinity_api_delete

Call a safe relative Affinity API path with DELETE.

Write write
Parameters
none
Generic call
kosmo integrations:call affinity.affinity_api_delete '{}' --json
Shortcut
kosmo integrations:affinity affinity_api_delete '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

affinity.affinity_get_current_user 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contacts 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contacts --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_contact 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_contact --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_create_contact 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_create_contact --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contact_fields 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contact_fields --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contact_field_values 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contact_field_values --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_contact_field_value 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_contact_field_value --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contact_lists 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contact_lists --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contact_list_entries 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contact_list_entries --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_contact_notes 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_contact_notes --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organizations 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organizations --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_organization 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_organization --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_create_organization 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_create_organization --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organization_fields 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organization_fields --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organization_field_values 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organization_field_values --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_organization_field_value 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_organization_field_value --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organization_lists 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organization_lists --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organization_list_entries 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organization_list_entries --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_organization_notes 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_organization_notes --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_opportunities 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_opportunities --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_opportunity 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_opportunity --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_opportunity_notes 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_opportunity_notes --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_lists 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_lists --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_list 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_list --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_list_fields 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_list_fields --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_list_entries 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_list_entries --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_list_entry 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_list_entry --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_list_entry_fields 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_list_entry_fields --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_list_entry_field 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_list_entry_field --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_update_list_entry_field 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_update_list_entry_field --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_batch_update_list_entry_fields 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_batch_update_list_entry_fields --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_saved_views 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_saved_views --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_saved_view 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_saved_view --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_saved_view_entries 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_saved_view_entries --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_notes 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_notes --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_note 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_note --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_note_replies 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_note_replies --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_note_persons 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_note_persons --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_note_companies 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_note_companies --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_note_opportunities 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_note_opportunities --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_calls 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_calls --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_emails 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_emails --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_meetings 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_meetings --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_chat_messages 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_chat_messages --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_transcripts 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_transcripts --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_get_transcript 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_get_transcript --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_list_transcript_fragments 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_list_transcript_fragments --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_api_get 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_api_get --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_api_post 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_api_post --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_api_put 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_api_put --json
ParameterTypeRequiredDescription
No parameters.
affinity.affinity_api_delete 0 parameters
Schema command
kosmo integrations:schema affinity.affinity_api_delete --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.