KosmoKrator

productivity

Pocket CLI for AI Agents

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

Pocket CLI Setup

Pocket can be configured headlessly with `kosmokrator integrations:configure pocket`.

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 pocket --set consumer_key="$POCKET_CONSUMER_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor pocket --json
kosmokrator integrations:status --json

Credentials

Authentication type: oauth2 variant oauth2_variant. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
consumer_key POCKET_CONSUMER_KEY Secret secret yes Consumer Key
access_token POCKET_ACCESS_TOKEN Secret secret no Access Token
url POCKET_URL Text text no API URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call pocket.pocket_request_token '{}' --json
Provider shortcut
kosmo integrations:pocket pocket_request_token '{}' --json

Discovery

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

Discovery commands
kosmo integrations:docs pocket --json
kosmo integrations:docs pocket.pocket_request_token --json
kosmo integrations:schema pocket.pocket_request_token --json
kosmo integrations:search "Pocket" --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.

pocket.pocket_request_token

Create a Pocket OAuth request token for an authorization redirect.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_request_token '{}' --json
Shortcut
kosmo integrations:pocket pocket_request_token '{}' --json

pocket.pocket_authorize_url

Build the Pocket web authorization URL for a request token.

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

pocket.pocket_access_token

Exchange an approved request token for a Pocket access token.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_access_token '{}' --json
Shortcut
kosmo integrations:pocket pocket_access_token '{}' --json

pocket.pocket_add_item

Save one URL to Pocket.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_add_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_add_item '{}' --json

pocket.pocket_retrieve_items

Retrieve Pocket list items with filtering and pagination.

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

pocket.pocket_send_actions

Send one or more raw Pocket modify actions to /v3/send.

Write write
Parameters
actions
Generic call
kosmo integrations:call pocket.pocket_send_actions '{"actions":"example_actions"}' --json
Shortcut
kosmo integrations:pocket pocket_send_actions '{"actions":"example_actions"}' --json

pocket.pocket_archive_item

Move a Pocket item to archive.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_archive_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_archive_item '{}' --json

pocket.pocket_readd_item

Move an archived Pocket item back to unread.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_readd_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_readd_item '{}' --json

pocket.pocket_favorite_item

Mark a Pocket item as favorite.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_favorite_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_favorite_item '{}' --json

pocket.pocket_unfavorite_item

Remove favorite status from a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_unfavorite_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_unfavorite_item '{}' --json

pocket.pocket_delete_item

Permanently delete a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_delete_item '{}' --json
Shortcut
kosmo integrations:pocket pocket_delete_item '{}' --json

pocket.pocket_add_tags

Add tags to a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_add_tags '{}' --json
Shortcut
kosmo integrations:pocket pocket_add_tags '{}' --json

pocket.pocket_remove_tags

Remove tags from a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_remove_tags '{}' --json
Shortcut
kosmo integrations:pocket pocket_remove_tags '{}' --json

pocket.pocket_replace_tags

Replace all tags on a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_replace_tags '{}' --json
Shortcut
kosmo integrations:pocket pocket_replace_tags '{}' --json

pocket.pocket_clear_tags

Clear all tags from a Pocket item.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_clear_tags '{}' --json
Shortcut
kosmo integrations:pocket pocket_clear_tags '{}' --json

pocket.pocket_rename_tag

Rename a Pocket tag across the account.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_rename_tag '{}' --json
Shortcut
kosmo integrations:pocket pocket_rename_tag '{}' --json

pocket.pocket_delete_tag

Delete a Pocket tag across the account.

Write write
Parameters
none
Generic call
kosmo integrations:call pocket.pocket_delete_tag '{}' --json
Shortcut
kosmo integrations:pocket pocket_delete_tag '{}' --json

pocket.pocket_api_post

Call a safe relative Pocket v3 POST path for endpoints not covered by first-class tools.

Write write
Parameters
path, payload
Generic call
kosmo integrations:call pocket.pocket_api_post '{"path":"example_path","payload":"example_payload"}' --json
Shortcut
kosmo integrations:pocket pocket_api_post '{"path":"example_path","payload":"example_payload"}' --json

Function Schemas

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

pocket.pocket_request_token 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_request_token --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_authorize_url 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_authorize_url --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_access_token 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_access_token --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_add_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_add_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_retrieve_items 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_retrieve_items --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_send_actions 1 parameters
Schema command
kosmo integrations:schema pocket.pocket_send_actions --json
ParameterTypeRequiredDescription
actions array yes Pocket modify action objects.
pocket.pocket_archive_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_archive_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_readd_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_readd_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_favorite_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_favorite_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_unfavorite_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_unfavorite_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_delete_item 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_delete_item --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_add_tags 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_add_tags --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_remove_tags 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_remove_tags --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_replace_tags 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_replace_tags --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_clear_tags 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_clear_tags --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_rename_tag 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_rename_tag --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_delete_tag 0 parameters
Schema command
kosmo integrations:schema pocket.pocket_delete_tag --json
ParameterTypeRequiredDescription
No parameters.
pocket.pocket_api_post 2 parameters
Schema command
kosmo integrations:schema pocket.pocket_api_post --json
ParameterTypeRequiredDescription
path string yes Relative Pocket API path.
payload object no JSON body fields.

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.