KosmoKrator

productivity

Immigrant CLI for AI Agents

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

Immigrant CLI Setup

Immigrant can be configured headlessly with `kosmokrator integrations:configure immigrant`.

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 immigrant --set access_token="$IMMIGRANT_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor immigrant --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
access_token IMMIGRANT_ACCESS_TOKEN Secret secret yes Access Token
url IMMIGRANT_URL URL url no Custom 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 immigrant.immigrant_list_applications '{"limit":1,"page":1,"status":"example_status"}' --json
Provider shortcut
kosmo integrations:immigrant immigrant_list_applications '{"limit":1,"page":1,"status":"example_status"}' --json

Discovery

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

Discovery commands
kosmo integrations:docs immigrant --json
kosmo integrations:docs immigrant.immigrant_list_applications --json
kosmo integrations:schema immigrant.immigrant_list_applications --json
kosmo integrations:search "Immigrant" --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.

immigrant.immigrant_list_applications

List immigration applications. Returns a paginated list of applications, optionally filtered by status.

Read read
Parameters
limit, page, status
Generic call
kosmo integrations:call immigrant.immigrant_list_applications '{"limit":1,"page":1,"status":"example_status"}' --json
Shortcut
kosmo integrations:immigrant immigrant_list_applications '{"limit":1,"page":1,"status":"example_status"}' --json

immigrant.immigrant_get_application

Get details of a specific immigration application by its ID.

Read read
Parameters
id
Generic call
kosmo integrations:call immigrant.immigrant_get_application '{"id":"example_id"}' --json
Shortcut
kosmo integrations:immigrant immigrant_get_application '{"id":"example_id"}' --json

immigrant.immigrant_create_application

Create a new immigration application. Requires a type and applicant name. Optionally provide additional details.

Write write
Parameters
type, applicant_name, details
Generic call
kosmo integrations:call immigrant.immigrant_create_application '{"type":"example_type","applicant_name":"example_applicant_name","details":"example_details"}' --json
Shortcut
kosmo integrations:immigrant immigrant_create_application '{"type":"example_type","applicant_name":"example_applicant_name","details":"example_details"}' --json

immigrant.immigrant_list_documents

List documents for a specific immigration application. Returns a paginated list of documents.

Read read
Parameters
application_id, limit, page
Generic call
kosmo integrations:call immigrant.immigrant_list_documents '{"application_id":"example_application_id","limit":1,"page":1}' --json
Shortcut
kosmo integrations:immigrant immigrant_list_documents '{"application_id":"example_application_id","limit":1,"page":1}' --json

immigrant.immigrant_get_document

Get details of a specific document by its ID.

Read read
Parameters
id
Generic call
kosmo integrations:call immigrant.immigrant_get_document '{"id":"example_id"}' --json
Shortcut
kosmo integrations:immigrant immigrant_get_document '{"id":"example_id"}' --json

immigrant.immigrant_list_statuses

List all available immigration application statuses. Use this to understand valid status values for filtering.

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

immigrant.immigrant_get_current_user

Get the profile of the currently authenticated Immigrant user. Use this to verify credentials and see user details.

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

Function Schemas

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

immigrant.immigrant_list_applications 3 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_list_applications --json
ParameterTypeRequiredDescription
limit integer no Number of applications to return per page (default: 25, max: 100).
page integer no Page number for pagination (1-based).
status string no Filter applications by status (e.g. "pending", "approved", "rejected").
immigrant.immigrant_get_application 1 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_get_application --json
ParameterTypeRequiredDescription
id string yes The Immigrant application ID.
immigrant.immigrant_create_application 3 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_create_application --json
ParameterTypeRequiredDescription
type string yes Application type (e.g. "visa", "green_card", "citizenship").
applicant_name string yes Full name of the applicant.
details object no Optional additional application details (key-value pairs).
immigrant.immigrant_list_documents 3 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_list_documents --json
ParameterTypeRequiredDescription
application_id string yes The Immigrant application ID to list documents for.
limit integer no Number of documents to return per page (default: 25, max: 100).
page integer no Page number for pagination (1-based).
immigrant.immigrant_get_document 1 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_get_document --json
ParameterTypeRequiredDescription
id string yes The Immigrant document ID.
immigrant.immigrant_list_statuses 0 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_list_statuses --json
ParameterTypeRequiredDescription
No parameters.
immigrant.immigrant_get_current_user 0 parameters
Schema command
kosmo integrations:schema immigrant.immigrant_get_current_user --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.