data
Upstash Redis CLI for AI Agents
Use the Upstash Redis CLI from KosmoKrator to call Upstash Redis tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Upstash Redis CLI Setup
Upstash Redis can be configured headlessly with `kosmokrator integrations:configure upstash`.
# 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 upstash --set api_key="$UPSTASH_API_KEY" --set redis_url="$UPSTASH_REDIS_URL" --enable --read allow --write ask --json
kosmokrator integrations:doctor upstash --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 | UPSTASH_API_KEY | Secret secret | yes | API Key |
redis_url | UPSTASH_REDIS_URL | URL url | yes | Redis REST URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call upstash.upstash_get_key '{"key":"example_key"}' --json kosmo integrations:upstash upstash_get_key '{"key":"example_key"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs upstash --json
kosmo integrations:docs upstash.upstash_get_key --json
kosmo integrations:schema upstash.upstash_get_key --json
kosmo integrations:search "Upstash Redis" --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.
upstash.upstash_get_key
Retrieve the value stored at a Redis key. Returns null if the key does not exist.
read - Parameters
- key
kosmo integrations:call upstash.upstash_get_key '{"key":"example_key"}' --json kosmo integrations:upstash upstash_get_key '{"key":"example_key"}' --json upstash.upstash_set_key
Store a key-value pair in Redis. Optionally set a TTL (time-to-live) in seconds so the key expires automatically.
write - Parameters
- key, value, ex
kosmo integrations:call upstash.upstash_set_key '{"key":"example_key","value":"example_value","ex":1}' --json kosmo integrations:upstash upstash_set_key '{"key":"example_key","value":"example_value","ex":1}' --json upstash.upstash_delete_key
Delete a key from Redis. Returns the number of keys that were removed.
write - Parameters
- key
kosmo integrations:call upstash.upstash_delete_key '{"key":"example_key"}' --json kosmo integrations:upstash upstash_delete_key '{"key":"example_key"}' --json upstash.upstash_list_keys
List Redis keys matching a glob-style pattern. Defaults to "*" to list all keys.
read - Parameters
- pattern
kosmo integrations:call upstash.upstash_list_keys '{"pattern":"example_pattern"}' --json kosmo integrations:upstash upstash_list_keys '{"pattern":"example_pattern"}' --json upstash.upstash_list_databases
List all Redis databases in the Upstash account. Returns database IDs, names, regions, and endpoints.
read - Parameters
- none
kosmo integrations:call upstash.upstash_list_databases '{}' --json kosmo integrations:upstash upstash_list_databases '{}' --json upstash.upstash_get_database
Get details for a specific Upstash Redis database by ID, including endpoint, region, and usage stats.
read - Parameters
- id
kosmo integrations:call upstash.upstash_get_database '{"id":"example_id"}' --json kosmo integrations:upstash upstash_get_database '{"id":"example_id"}' --json upstash.upstash_get_current_user
Get current team information from Upstash, including team name, members, and plan details.
read - Parameters
- none
kosmo integrations:call upstash.upstash_get_current_user '{}' --json kosmo integrations:upstash upstash_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
upstash.upstash_get_key 1 parameters
kosmo integrations:schema upstash.upstash_get_key --json | Parameter | Type | Required | Description |
|---|---|---|---|
key | string | yes | The Redis key to retrieve. |
upstash.upstash_set_key 3 parameters
kosmo integrations:schema upstash.upstash_set_key --json | Parameter | Type | Required | Description |
|---|---|---|---|
key | string | yes | The Redis key to set. |
value | string | yes | The value to store. |
ex | integer | no | Time-to-live in seconds (optional). |
upstash.upstash_delete_key 1 parameters
kosmo integrations:schema upstash.upstash_delete_key --json | Parameter | Type | Required | Description |
|---|---|---|---|
key | string | yes | The Redis key to delete. |
upstash.upstash_list_keys 1 parameters
kosmo integrations:schema upstash.upstash_list_keys --json | Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | no | Glob-style pattern to match keys against (default: "*"). |
upstash.upstash_list_databases 0 parameters
kosmo integrations:schema upstash.upstash_list_databases --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
upstash.upstash_get_database 1 parameters
kosmo integrations:schema upstash.upstash_get_database --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Upstash database ID. |
upstash.upstash_get_current_user 0 parameters
kosmo integrations:schema upstash.upstash_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.