- Drop scripts into
.kadai/actions/. - Run with
bunx kadai. - Share them with your team in the repo.
- Automatically make them discoverable by AI.
kadai requires Bun as its runtime.
# macOS / Linux
curl -fsSL https://bun.sh/install | bash
# Homebrew
brew install oven-sh/bun/bun
# Windows
powershell -c "irm bun.sh/install.ps1 | iex"bunx kadaiOn first run, kadai creates a .kadai/ directory with a sample action and config file. Run it again to open the interactive menu.
.kadai/
├── config.ts # Optional configuration (env vars, actions dir)
└── actions/ # Your scripts live here
├── hello.sh
├── deploy.ts
└── database/ # Subdirectories become categories
├── reset.sh
└── seed.py
| Extension | Runtime |
|---|---|
.sh, .bash |
bash |
.ts, .js, .mjs |
bun |
.py |
python |
.tsx |
ink |
Shebangs are respected — if your script has #!/usr/bin/env python3, kadai uses that directly. Otherwise it finds the best available interpreter automatically (e.g. uv run before python3 for .py files).
Add metadata as comments in the first 20 lines of any script:
#!/bin/bash
# kadai:name Deploy Staging
# kadai:emoji 🚀
# kadai:description Deploy the app to staging
# kadai:confirm trueFor JS/TS, use // comments:
// kadai:name Reset Database
// kadai:emoji 🗑️
// kadai:confirm true| Key | Type | Description |
|---|---|---|
name |
string | Display name (inferred from filename if omitted) |
emoji |
string | Emoji prefix in menus |
description |
string | Short description |
confirm |
boolean | Require confirmation before running |
hidden |
boolean | Hide from menu (still runnable via CLI) |
fullscreen |
boolean | Use alternate screen buffer (.tsx only) |
.tsx files let you build interactive terminal UIs that render directly inside kadai. Export a default React component that receives InkActionProps:
// kadai:name Todo List
// kadai:emoji ✅
// kadai:description Manage project tasks
import { Box, Text, useInput } from "ink";
import { useState } from "react";
import type { InkActionProps } from "kadai/types";
export default function TodoList({ onExit }: InkActionProps) {
const [items] = useState(["Buy groceries", "Write code"]);
const [cursor, setCursor] = useState(0);
useInput((input, key) => {
if (key.upArrow) setCursor((c) => Math.max(0, c - 1));
if (key.downArrow) setCursor((c) => Math.min(items.length - 1, c + 1));
if (input === "q") onExit();
});
return (
<Box flexDirection="column">
{items.map((item, i) => (
<Text key={item} color={i === cursor ? "cyan" : undefined}>
{i === cursor ? "❯ " : " "}{item}
</Text>
))}
<Text dimColor>↑↓ navigate q quit</Text>
</Box>
);
}Your component receives these props:
| Prop | Type | Description |
|---|---|---|
cwd |
string |
Working directory kadai was launched from |
env |
Record<string, string> |
Environment variables from kadai config |
args |
string[] |
Additional arguments passed to the action |
onExit |
() => void |
Call this to return to the kadai menu |
By default, ink actions render inline within kadai's UI. Add kadai:fullscreen true to use the terminal's alternate screen buffer — the action takes over the full screen and restores the previous view on exit:
// kadai:fullscreen trueSee .kadai/actions/ in this repo for working examples.
.kadai/config.ts lets you set environment variables injected into all actions:
export default {
env: {
DATABASE_URL: "postgres://localhost:5432/myapp",
APP_ENV: "development",
},
};kadai # Interactive menu
kadai list --json # List actions as JSON
kadai list --json --all # Include hidden actions
kadai run <action-id> # Run an action directly
kadai mcp # Start MCP server (creates .mcp.json)kadai is designed to work well with AI coding agents like Claude Code.
kadai includes a built-in MCP server that exposes your actions as tools. Any MCP-compatible client (Claude Code, Claude Desktop, etc.) can auto-discover and run your project's actions.
kadai will automatically configure a .mcp.json file in your project root so Claude can automatically discover any kadai actions you define.
kadai mcpThis creates the .mcp.json in your project root if it doesn't already exist (so claude will autodiscover it.)
It then starts the mcp server (this is the command claude uses to invoke kadai MCP.)
Each action becomes an MCP tool. Nested action IDs use -- as a separator (e.g. database/reset becomes the tool database--reset) since MCP tool names don't allow slashes.
kadai list --jsongives agents a machine-readable list of available project actionskadai run <action-id>runs actions non-interactively (confirmation prompts auto-skip in non-TTY)- Agents can discover what's available, then run the right action — no hardcoded commands
If your project uses Claude Code (has a .claude/ directory or CLAUDE.md), kadai automatically creates a skill file at .claude/skills/kadai/SKILL.md on first run. This teaches Claude Code how to discover and run your project's actions.
The skill is non-user-invocable — Claude Code reads it automatically and uses kadai when relevant, without needing explicit prompts.