KosmoKrator

marketing

Bitly CLI for AI Agents

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

8 functions 5 read 3 write Bearer token auth

Bitly CLI Setup

Bitly can be configured headlessly with `kosmokrator integrations:configure bitly`.

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

Credentials

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

KeyEnv varTypeRequiredLabel
access_token BITLY_ACCESS_TOKEN Secret secret yes Access Token

Call Bitly Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call bitly.bitly_shorten_link '{
  "long_url": "example_long_url",
  "domain": "example_domain",
  "group_guid": "example_group_guid"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:bitly bitly_shorten_link '{
  "long_url": "example_long_url",
  "domain": "example_domain",
  "group_guid": "example_group_guid"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs bitly --json
kosmo integrations:docs bitly.bitly_shorten_link --json
kosmo integrations:schema bitly.bitly_shorten_link --json
kosmo integrations:search "Bitly" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Bitly.

bitly.bitly_get_clicks

Read read

Get click metrics for a Bitlink. Returns click counts by time unit (minute, hour, day, week, month).

Parameters
bitlink, unit, units, unit_reference

Generic CLI call

kosmo integrations:call bitly.bitly_get_clicks '{"bitlink":"example_bitlink","unit":"example_unit","units":1,"unit_reference":"example_unit_reference"}' --json

Provider shortcut

kosmo integrations:bitly bitly_get_clicks '{"bitlink":"example_bitlink","unit":"example_unit","units":1,"unit_reference":"example_unit_reference"}' --json

bitly.bitly_list_groups

Read read

List all groups in the Bitly account. Groups organize links and are used when creating new Bitlinks.

Parameters
none

Generic CLI call

kosmo integrations:call bitly.bitly_list_groups '{}' --json

Provider shortcut

kosmo integrations:bitly bitly_list_groups '{}' --json

bitly.bitly_get_group

Read read

Retrieve details for a specific Bitly group by its GUID.

Parameters
group_guid

Generic CLI call

kosmo integrations:call bitly.bitly_get_group '{"group_guid":"example_group_guid"}' --json

Provider shortcut

kosmo integrations:bitly bitly_get_group '{"group_guid":"example_group_guid"}' --json

bitly.bitly_get_current_user

Read read

Get the authenticated Bitly user's profile. Use this to verify the connection and see account info.

Parameters
none

Generic CLI call

kosmo integrations:call bitly.bitly_get_current_user '{}' --json

Provider shortcut

kosmo integrations:bitly bitly_get_current_user '{}' --json

Function Schemas

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

bitly.bitly_get_clicks

Get click metrics for a Bitlink. Returns click counts by time unit (minute, hour, day, week, month).

Operation
Read read
Schema command
kosmo integrations:schema bitly.bitly_get_clicks --json
ParameterTypeRequiredDescription
bitlink string yes The Bitlink identifier (e.g., "bit.ly/abc123").
unit string no Time unit for click aggregation: "minute", "hour", "day", "week", or "month". Defaults to "day".
units integer no Number of time units to return. Use -1 for all available data. Defaults to -1.
unit_reference string no ISO 8601 timestamp for the reference point (e.g., "2026-01-01T00:00:00+0000").

bitly.bitly_list_groups

List all groups in the Bitly account. Groups organize links and are used when creating new Bitlinks.

Operation
Read read
Schema command
kosmo integrations:schema bitly.bitly_list_groups --json
ParameterTypeRequiredDescription
No parameters.

bitly.bitly_get_group

Retrieve details for a specific Bitly group by its GUID.

Operation
Read read
Schema command
kosmo integrations:schema bitly.bitly_get_group --json
ParameterTypeRequiredDescription
group_guid string yes The GUID of the group to retrieve.

bitly.bitly_get_current_user

Get the authenticated Bitly user's profile. Use this to verify the connection and see account info.

Operation
Read read
Schema command
kosmo integrations:schema bitly.bitly_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.