Skip to content

Commit 7058252

Browse files
docs: add Use Cases section with CLI plugin and Data Apps integration
Co-Authored-By: Jordan Burger <jordanrburger@gmail.com>
1 parent 5037780 commit 7058252

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

kai/python-client.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,67 @@ async with KaiClient(
208208
print(f"API error: {e.code} - {e.message}")
209209
```
210210

211+
## Use Cases
212+
213+
### Kai via CLI with Claude Code
214+
215+
The [kai-cli plugin](https://github.com/keboola/kai-client/tree/main/plugins/kai-cli) lets AI coding assistants like [Claude Code](https://claude.com/claude-code) interact with your Keboola project through the Kai CLI. Install the plugin to give Claude the ability to query data, manage configurations, run jobs, and troubleshoot issues — all through natural language in your terminal.
216+
217+
#### Installation
218+
219+
Download the plugin to your Claude Code plugins directory:
220+
221+
```bash
222+
mkdir -p ~/.claude/plugins
223+
224+
curl -L https://github.com/keboola/kai-client/archive/refs/heads/main.tar.gz | \
225+
tar -xz --strip-components=2 -C ~/.claude/plugins kai-client-main/plugins/kai-cli
226+
```
227+
228+
Or clone and link for development:
229+
230+
```bash
231+
git clone https://github.com/keboola/kai-client.git
232+
ln -s "$(pwd)/kai-client/plugins/kai-cli" ~/.claude/plugins/kai-cli
233+
```
234+
235+
Once installed, ask Claude to "use kai" or "help me with kai cli" to activate the skill. Claude can then run `kai chat`, `kai history`, `kai ping`, and other CLI commands on your behalf.
236+
237+
### Integrating Kai into Data Apps
238+
239+
The Kai Python Client can be embedded into Keboola [Data Apps](/data-apps/) to provide AI-powered chat interfaces for your end users.
240+
241+
#### Streamlit Data Apps
242+
243+
The [kai-streamlit plugin](https://github.com/keboola/kai-client/tree/main/plugins/kai-streamlit) provides patterns and working code for building [Streamlit Data Apps](/data-apps/streamlit/) with an integrated Kai chat interface. It handles the async bridge between Streamlit's synchronous model and the KaiClient's async API, streaming responses into Streamlit containers, tool approval flows with interactive Approve/Deny buttons, and session state management across Streamlit reruns.
244+
245+
To get started, install the dependencies:
246+
247+
```bash
248+
pip install kai-client streamlit
249+
```
250+
251+
Then use the `run_async` bridge pattern to call KaiClient from Streamlit:
252+
253+
```python
254+
import asyncio
255+
from kai_client import KaiClient
256+
257+
def run_async(coro):
258+
"""Run an async coroutine from sync Streamlit code."""
259+
loop = asyncio.new_event_loop()
260+
try:
261+
return loop.run_until_complete(coro)
262+
finally:
263+
loop.close()
264+
```
265+
266+
See the [plugin repository](https://github.com/keboola/kai-client/tree/main/plugins/kai-streamlit) for a complete working example with streaming, tool approval, and suggested action buttons.
267+
268+
#### Python/JS Data Apps
269+
270+
Support for integrating Kai into [Python/JS Data Apps](/data-apps/python-js/) is coming soon. A dedicated plugin will be available to simplify embedding Kai chat into custom Python and JavaScript-based data applications.
271+
211272
## Resources
212273

213274
- [GitHub Repository](https://github.com/keboola/kai-client)

0 commit comments

Comments
 (0)