productivity
Salesforce CLI for Headless Automation
Use the Salesforce CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
18 functions 10 read 8 write Manual OAuth token auth
Salesforce CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Salesforce CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Salesforce CLI for Headless Automation
kosmokrator integrations:configure salesforce --set access_token="$SALESFORCE_ACCESS_TOKEN" --set instance_url="$SALESFORCE_INSTANCE_URL" --enable --read allow --write ask --json
kosmo integrations:call salesforce.salesforce_create_lead '{"first_name":"example_first_name","last_name":"example_last_name","company":"example_company","email":"example_email","phone":"example_phone","title":"example_title","website":"example_website","other_fields":"example_other_fields"}' --json Discovery Before Execution
Agents and scripts can inspect Salesforce docs and schemas before choosing a function.
kosmo integrations:docs salesforce --json
kosmo integrations:docs salesforce.salesforce_create_lead --json
kosmo integrations:schema salesforce.salesforce_create_lead --json
kosmo integrations:search "Salesforce" --json
kosmo integrations:list --json Useful Salesforce CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
salesforce.salesforce_create_lead | Write | first_name, last_name, company, email, phone, title, website, other_fields | Create a new lead in Salesforce. Supports FirstName, LastName, Company, Email, Phone, Title, Website, and additional custom fields via other_fields. Returns the created lead ID and success status. |
salesforce.salesforce_get_lead | Read | id | Retrieve a Salesforce lead by its ID. Returns the lead's fields, attributes, and associated data. |
salesforce.salesforce_update_lead | Write | id, first_name, last_name, company, email, phone, other_fields | Update an existing Salesforce lead by ID. Supports FirstName, LastName, Company, Email, Phone, and additional custom fields via other_fields. Returns success confirmation on completion. |
salesforce.salesforce_create_contact | Write | first_name, last_name, email, phone, account_id, title, other_fields | Create a new contact in Salesforce. Supports FirstName, LastName, Email, Phone, AccountId, Title, and additional custom fields via other_fields. Returns the created contact ID and success status. |
salesforce.salesforce_get_contact | Read | id | Retrieve a Salesforce contact by its ID. Returns the contact's fields, attributes, and associated data. |
salesforce.salesforce_create_account | Write | name, website, phone, industry, billing_city, billing_country, other_fields | Create a new account in Salesforce. Supports Name, Website, Phone, Industry, BillingCity, BillingCountry, and additional custom fields via other_fields. Returns the created account ID and success status. |
salesforce.salesforce_get_account | Read | id | Retrieve a Salesforce account by its ID. Returns the account's fields, attributes, and associated data. |
salesforce.salesforce_update_account | Write | id, name, website, phone, other_fields | Update an existing Salesforce account by ID. Supports Name, Website, Phone, and additional custom fields via other_fields. Returns success confirmation on completion. |
salesforce.salesforce_create_opportunity | Write | name, amount, stage_name, close_date, account_id, probability | Create a new opportunity in Salesforce. Supports Name, Amount, StageName, CloseDate, AccountId, and Probability. Returns the created opportunity ID and success status. |
salesforce.salesforce_get_opportunity | Read | id | Retrieve a Salesforce opportunity by its ID. Returns the opportunity's fields, attributes, and associated data. |
salesforce.salesforce_query | Read | soql | Execute a SOQL (Salesforce Object Query Language) query. Use SOQL to search records in Salesforce. Example: SELECT Id, Name FROM Account LIMIT 10 Returns query results with total size and records. |
salesforce.salesforce_search | Read | sosl | Execute a SOSL (Salesforce Object Search Language) search. Use SOSL for text-based searches across multiple object types. Example: FIND {test} IN ALL FIELDS RETURNING Account(Id, Name) Returns search results grouped by object type. |
salesforce.salesforce_describe_object | Read | object_type | Get metadata for a Salesforce object type. Returns field definitions, relationships, record types, and other metadata. Example object types: Account, Contact, Lead, Opportunity, Case, Task, User. |
salesforce.salesforce_list_objects | Read | none | List all available Salesforce objects (standard and custom). Returns object names, labels, and key prefixes. |
salesforce.salesforce_create_task | Write | subject, description, status, priority, who_id, what_id, activity_date | Create a new task in Salesforce. Supports Subject, Description, Status, Priority, WhoId (contact/lead), WhatId (account/opportunity), and ActivityDate. Returns the created task ID and success status. |
salesforce.salesforce_create_case | Write | subject, description, status, priority, origin, contact_id, account_id | Create a new case in Salesforce. Supports Subject, Description, Status, Priority, Origin, ContactId, and AccountId. Returns the created case ID and success status. |
salesforce.salesforce_list_recent | Read | limit | List recently accessed items in Salesforce. Returns recently viewed or modified records across all object types. Optionally specify a limit to control the number of items returned. |
salesforce.salesforce_get_user | Read | id | Retrieve a Salesforce user by their ID. Returns the user's name, email, profile, role, and other fields. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.