Kiwi Code Docs

Terminal Mode (Scripting)

Use Kiwi Code for one-off queries, piped input, and CI/CD automation.

Terminal Mode (Scripting)

For quick one-off queries, automation scripts, and CI/CD pipelines — without launching the full TUI.

One-off Queries

kiwi --terminal "What does git status do?"

Pipe Input

Feed output from other commands directly to the AI:

echo "Summarize the latest changes" | kiwi --terminal --run-id <RUN_ID>
git diff | kiwi --terminal "Review this diff and suggest improvements"
cat error.log | kiwi --terminal "What caused this error?"

JSON Output

Get structured output for scripts and automation:

kiwi --terminal --json --action-id <ACTION_ID> "Hello"

CI/CD Integration

Use terminal mode in your CI/CD pipelines:

# Generate a PR description from the diff
git diff main...HEAD | kiwi --terminal "Write a PR description for these changes"

# Auto-fix linting issues
kiwi --terminal "Fix all ESLint errors in src/"

# Generate test cases
kiwi --terminal "Write unit tests for src/utils/parser.ts"

Prerequisites

  • kiwi-ai must be installed locally
  • You must be logged in (kiwi will prompt on first use)

Next Steps

On this page