data
OpenAlex CLI for AI Agents
Use the OpenAlex CLI from KosmoKrator to call OpenAlex tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.OpenAlex CLI Setup
OpenAlex can be configured headlessly with `kosmokrator integrations:configure openalex`.
# 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 openalex --set api_key="$OPENALEX_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor openalex --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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | OPENALEX_API_KEY | Secret secret | yes | API Key |
url | OPENALEX_URL | URL url | no | Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call openalex.openalex_list_works '{}' --json kosmo integrations:openalex openalex_list_works '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs openalex --json
kosmo integrations:docs openalex.openalex_list_works --json
kosmo integrations:schema openalex.openalex_list_works --json
kosmo integrations:search "OpenAlex" --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.
openalex.openalex_list_works
List, search, filter, sort, sample, or group works.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_works '{}' --json kosmo integrations:openalex openalex_list_works '{}' --json openalex.openalex_get_work
Get one work by OpenAlex ID, DOI, PMID, or supported external ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_work '{}' --json kosmo integrations:openalex openalex_get_work '{}' --json openalex.openalex_list_authors
List, search, filter, sort, sample, or group authors.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_authors '{}' --json kosmo integrations:openalex openalex_list_authors '{}' --json openalex.openalex_get_author
Get one author by OpenAlex ID, ORCID, or supported external ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_author '{}' --json kosmo integrations:openalex openalex_get_author '{}' --json openalex.openalex_list_sources
List, search, filter, sort, sample, or group sources.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_sources '{}' --json kosmo integrations:openalex openalex_list_sources '{}' --json openalex.openalex_get_source
Get one source by OpenAlex ID, ISSN, or supported external ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_source '{}' --json kosmo integrations:openalex openalex_get_source '{}' --json openalex.openalex_list_institutions
List, search, filter, sort, sample, or group institutions.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_institutions '{}' --json kosmo integrations:openalex openalex_list_institutions '{}' --json openalex.openalex_get_institution
Get one institution by OpenAlex ID, ROR, or supported external ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_institution '{}' --json kosmo integrations:openalex openalex_get_institution '{}' --json openalex.openalex_list_topics
List, search, filter, sort, sample, or group topics.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_topics '{}' --json kosmo integrations:openalex openalex_list_topics '{}' --json openalex.openalex_get_topic
Get one topic by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_topic '{}' --json kosmo integrations:openalex openalex_get_topic '{}' --json openalex.openalex_list_domains
List, search, filter, sort, sample, or group domains.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_domains '{}' --json kosmo integrations:openalex openalex_list_domains '{}' --json openalex.openalex_get_domain
Get one domain by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_domain '{}' --json kosmo integrations:openalex openalex_get_domain '{}' --json openalex.openalex_list_fields
List, search, filter, sort, sample, or group fields.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_fields '{}' --json kosmo integrations:openalex openalex_list_fields '{}' --json openalex.openalex_get_field
Get one field by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_field '{}' --json kosmo integrations:openalex openalex_get_field '{}' --json openalex.openalex_list_subfields
List, search, filter, sort, sample, or group subfields.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_subfields '{}' --json kosmo integrations:openalex openalex_list_subfields '{}' --json openalex.openalex_get_subfield
Get one subfield by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_subfield '{}' --json kosmo integrations:openalex openalex_get_subfield '{}' --json openalex.openalex_list_sdgs
List, search, filter, sort, sample, or group Sustainable Development Goals.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_sdgs '{}' --json kosmo integrations:openalex openalex_list_sdgs '{}' --json openalex.openalex_get_sdg
Get one Sustainable Development Goal by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_sdg '{}' --json kosmo integrations:openalex openalex_get_sdg '{}' --json openalex.openalex_list_countries
List, search, filter, sort, sample, or group countries.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_countries '{}' --json kosmo integrations:openalex openalex_list_countries '{}' --json openalex.openalex_get_country
Get one country by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_country '{}' --json kosmo integrations:openalex openalex_get_country '{}' --json openalex.openalex_list_continents
List, search, filter, sort, sample, or group continents.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_continents '{}' --json kosmo integrations:openalex openalex_list_continents '{}' --json openalex.openalex_get_continent
Get one continent by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_continent '{}' --json kosmo integrations:openalex openalex_get_continent '{}' --json openalex.openalex_list_languages
List, search, filter, sort, sample, or group languages.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_languages '{}' --json kosmo integrations:openalex openalex_list_languages '{}' --json openalex.openalex_get_language
Get one language by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_language '{}' --json kosmo integrations:openalex openalex_get_language '{}' --json openalex.openalex_list_keywords
List, search, filter, sort, sample, or group keywords.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_keywords '{}' --json kosmo integrations:openalex openalex_list_keywords '{}' --json openalex.openalex_get_keyword
Get one keyword by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_keyword '{}' --json kosmo integrations:openalex openalex_get_keyword '{}' --json openalex.openalex_list_publishers
List, search, filter, sort, sample, or group publishers.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_publishers '{}' --json kosmo integrations:openalex openalex_list_publishers '{}' --json openalex.openalex_get_publisher
Get one publisher by OpenAlex ID, Wikidata ID, or supported external ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_publisher '{}' --json kosmo integrations:openalex openalex_get_publisher '{}' --json openalex.openalex_list_funders
List, search, filter, sort, sample, or group funders.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_funders '{}' --json kosmo integrations:openalex openalex_list_funders '{}' --json openalex.openalex_get_funder
Get one funder by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_funder '{}' --json kosmo integrations:openalex openalex_get_funder '{}' --json openalex.openalex_list_awards
List, search, filter, sort, sample, or group awards.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_awards '{}' --json kosmo integrations:openalex openalex_list_awards '{}' --json openalex.openalex_get_award
Get one award by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_award '{}' --json kosmo integrations:openalex openalex_get_award '{}' --json openalex.openalex_list_work_types
List OpenAlex work type enumerations.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_work_types '{}' --json kosmo integrations:openalex openalex_list_work_types '{}' --json openalex.openalex_get_work_type
Get one work type by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_work_type '{}' --json kosmo integrations:openalex openalex_get_work_type '{}' --json openalex.openalex_list_source_types
List OpenAlex source type enumerations.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_source_types '{}' --json kosmo integrations:openalex openalex_list_source_types '{}' --json openalex.openalex_get_source_type
Get one source type by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_source_type '{}' --json kosmo integrations:openalex openalex_get_source_type '{}' --json openalex.openalex_list_institution_types
List OpenAlex institution type enumerations.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_institution_types '{}' --json kosmo integrations:openalex openalex_list_institution_types '{}' --json openalex.openalex_get_institution_type
Get one institution type by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_institution_type '{}' --json kosmo integrations:openalex openalex_get_institution_type '{}' --json openalex.openalex_list_licenses
List OpenAlex license enumerations.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_licenses '{}' --json kosmo integrations:openalex openalex_list_licenses '{}' --json openalex.openalex_get_license
Get one license by OpenAlex ID.
read - Parameters
- none
kosmo integrations:call openalex.openalex_get_license '{}' --json kosmo integrations:openalex openalex_get_license '{}' --json openalex.openalex_autocomplete
Search OpenAlex autocomplete suggestions for works, authors, sources, institutions, topics, keywords, publishers, or funders.
read - Parameters
- none
kosmo integrations:call openalex.openalex_autocomplete '{}' --json kosmo integrations:openalex openalex_autocomplete '{}' --json openalex.openalex_rate_limit
Check the current OpenAlex API key rate-limit status and remaining allowance.
read - Parameters
- none
kosmo integrations:call openalex.openalex_rate_limit '{}' --json kosmo integrations:openalex openalex_rate_limit '{}' --json openalex.openalex_list_changefiles
List available OpenAlex changefile dates. Changefile access may require a paid OpenAlex plan.
read - Parameters
- none
kosmo integrations:call openalex.openalex_list_changefiles '{}' --json kosmo integrations:openalex openalex_list_changefiles '{}' --json openalex.openalex_get_changefile
Get OpenAlex changefile details and download links for a specific date. Changefile access may require a paid OpenAlex plan.
read - Parameters
- date
kosmo integrations:call openalex.openalex_get_changefile '{"date":"example_date"}' --json kosmo integrations:openalex openalex_get_changefile '{"date":"example_date"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
openalex.openalex_list_works 0 parameters
kosmo integrations:schema openalex.openalex_list_works --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_work 0 parameters
kosmo integrations:schema openalex.openalex_get_work --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_authors 0 parameters
kosmo integrations:schema openalex.openalex_list_authors --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_author 0 parameters
kosmo integrations:schema openalex.openalex_get_author --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_sources 0 parameters
kosmo integrations:schema openalex.openalex_list_sources --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_source 0 parameters
kosmo integrations:schema openalex.openalex_get_source --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_institutions 0 parameters
kosmo integrations:schema openalex.openalex_list_institutions --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_institution 0 parameters
kosmo integrations:schema openalex.openalex_get_institution --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_topics 0 parameters
kosmo integrations:schema openalex.openalex_list_topics --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_topic 0 parameters
kosmo integrations:schema openalex.openalex_get_topic --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_domains 0 parameters
kosmo integrations:schema openalex.openalex_list_domains --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_domain 0 parameters
kosmo integrations:schema openalex.openalex_get_domain --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_fields 0 parameters
kosmo integrations:schema openalex.openalex_list_fields --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_field 0 parameters
kosmo integrations:schema openalex.openalex_get_field --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_subfields 0 parameters
kosmo integrations:schema openalex.openalex_list_subfields --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_subfield 0 parameters
kosmo integrations:schema openalex.openalex_get_subfield --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_sdgs 0 parameters
kosmo integrations:schema openalex.openalex_list_sdgs --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_sdg 0 parameters
kosmo integrations:schema openalex.openalex_get_sdg --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_countries 0 parameters
kosmo integrations:schema openalex.openalex_list_countries --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_country 0 parameters
kosmo integrations:schema openalex.openalex_get_country --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_continents 0 parameters
kosmo integrations:schema openalex.openalex_list_continents --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_continent 0 parameters
kosmo integrations:schema openalex.openalex_get_continent --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_languages 0 parameters
kosmo integrations:schema openalex.openalex_list_languages --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_language 0 parameters
kosmo integrations:schema openalex.openalex_get_language --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_keywords 0 parameters
kosmo integrations:schema openalex.openalex_list_keywords --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_keyword 0 parameters
kosmo integrations:schema openalex.openalex_get_keyword --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_publishers 0 parameters
kosmo integrations:schema openalex.openalex_list_publishers --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_publisher 0 parameters
kosmo integrations:schema openalex.openalex_get_publisher --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_funders 0 parameters
kosmo integrations:schema openalex.openalex_list_funders --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_funder 0 parameters
kosmo integrations:schema openalex.openalex_get_funder --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_awards 0 parameters
kosmo integrations:schema openalex.openalex_list_awards --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_award 0 parameters
kosmo integrations:schema openalex.openalex_get_award --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_work_types 0 parameters
kosmo integrations:schema openalex.openalex_list_work_types --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_work_type 0 parameters
kosmo integrations:schema openalex.openalex_get_work_type --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_source_types 0 parameters
kosmo integrations:schema openalex.openalex_list_source_types --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_source_type 0 parameters
kosmo integrations:schema openalex.openalex_get_source_type --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_institution_types 0 parameters
kosmo integrations:schema openalex.openalex_list_institution_types --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_institution_type 0 parameters
kosmo integrations:schema openalex.openalex_get_institution_type --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_licenses 0 parameters
kosmo integrations:schema openalex.openalex_list_licenses --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_license 0 parameters
kosmo integrations:schema openalex.openalex_get_license --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_autocomplete 0 parameters
kosmo integrations:schema openalex.openalex_autocomplete --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_rate_limit 0 parameters
kosmo integrations:schema openalex.openalex_rate_limit --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_list_changefiles 0 parameters
kosmo integrations:schema openalex.openalex_list_changefiles --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
openalex.openalex_get_changefile 1 parameters
kosmo integrations:schema openalex.openalex_get_changefile --json | Parameter | Type | Required | Description |
|---|---|---|---|
date | string | yes | Changefile date in YYYY-MM-DD format. |
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.