ai
Jina AI CLI for Shell Scripts
Use the Jina AI CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
5 functions 5 read 0 write API key auth
Jina AI CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Jina AI CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Jina AI CLI for Shell Scripts
kosmokrator integrations:configure jinaai --set api_key="$JINAAI_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call jinaai.jinaai_search '{"q":"example_q"}' --json Discovery Before Execution
Agents and scripts can inspect Jina AI docs and schemas before choosing a function.
kosmo integrations:docs jinaai --json
kosmo integrations:docs jinaai.jinaai_search --json
kosmo integrations:schema jinaai.jinaai_search --json
kosmo integrations:search "Jina AI" --json
kosmo integrations:list --json Useful Jina AI CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
jinaai.jinaai_search | Read | q | Search the web using Jina AI. Returns search results with titles, URLs, descriptions, and extracted content. Useful for finding up-to-date information on any topic. |
jinaai.jinaai_read | Read | url | Read and extract clean content from a URL using Jina AI Reader. Returns the main text content of a web page, stripping away navigation, ads, and other clutter. Useful for reading articles, documentation, or any web page. |
jinaai.jinaai_ground | Read | statement, context | Ground a statement against provided context using Jina AI. Verifies whether a claim or statement is supported by the given reference text. Returns grounding results indicating which parts of the statement are supported or contradicted. |
jinaai.jinaai_embeddings | Read | input, model | Generate text embeddings using Jina AI. Converts text into dense vector representations useful for semantic search, similarity comparison, clustering, and retrieval-augmented generation (RAG). |
jinaai.jinaai_rerank | Read | query, documents, model, top_n | Rerank documents by relevance to a query using Jina AI. Takes a query and a list of text documents, then returns them sorted by relevance with scores. Useful for improving search results or filtering the most relevant content. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.