Kubiya LogoKubiya Developer Docs

Chat Commands

Interacting with AI Teammates using the Kubiya CLI.

Chat Commands

kubiya chat

Interact with your AI Teammates directly from the command line using natural language.

Available Commands

CommandDescription
chatStart interactive chat or send a one-off message
historyView chat history with a teammate
exportExport conversation history to a file
saveSave a chat message or result to a file

Usage Examples

Interactive Chat Sessions

# Start an interactive chat with the default teammate
kubiya chat --interactive
 
# Chat with a specific teammate
kubiya chat --teammate "devops-expert" --interactive
 
# Start chat in debug mode (shows additional information)
kubiya chat --teammate "infrastructure-expert" --interactive --debug

In interactive mode, you can type messages directly to your AI teammate. End the session with /exit or by pressing Ctrl+D.

Interactive Mode

Interactive mode provides a chat-like experience in your terminal, letting you have a continuous conversation with an AI teammate.

Start interactive mode

kubiya chat --interactive

Available commands during chat

During an interactive session, you can use these special commands:

/help              Show available commands
/clear             Clear the current conversation
/tools             List tools available to the teammate
/file <path>       Share a file for context
/dir <path>        Share a directory for context
/save <filename>   Save the conversation to a file
/exit              End the chat session

Share files during chat

> /file main.py
File 'main.py' uploaded. You can now ask questions about it.

> Can you explain what this code does?
[AI teammate provides explanation]

End the session

> /exit
Chat session ended.

Command Flags

Chat Command Flags

FlagDescription
--interactive, -iStart an interactive chat session
--teammate, -tSpecify the teammate to chat with
--files, -fFile paths to include as context (comma-separated)
--context-dir, -dDirectory to include as context
--output-file, -oSave the response to a file
--output-formatFormat for the output (text, json, yaml, markdown)
--debugShow additional debug information
--silentSuppress non-essential output
--rawOutput raw response without formatting
--max-tokensMaximum tokens for the response
--languagePreferred response language (e.g., 'python', 'javascript')

History Command Flags

FlagDescription
--teammate, -tSpecify which teammate's history to view
--limit, -lMaximum number of messages to show
--sinceShow messages since a specific date/time
--formatOutput format (text, json, markdown)
--filterFilter messages by content

Advanced Features

Code Generation with File Output

You can generate code and save it directly to a file:

# Generate Python script and save to file
kubiya chat "Write a script to parse CSV files" \
  --teammate "python-expert" \
  --output-file "csv_parser.py"
 
# Generate multiple files (result will contain instructions)
kubiya chat "Create a React component for a user profile" \
  --teammate "frontend-expert"

Multi-turn Conversations in Non-interactive Mode

For scripts or automation, you can simulate a conversation:

# First message establishes context
CONVERSATION_ID=$(kubiya chat "I'm working with AWS EC2" \
  --teammate "cloud-expert" --return-id)
 
# Follow-up uses the same conversation
kubiya chat "How do I list all running instances?" \
  --conversation $CONVERSATION_ID
 
# Another follow-up in the same thread
kubiya chat "And how do I stop a specific instance?" \
  --conversation $CONVERSATION_ID

For the best experience with complex tasks, use interactive mode which allows for natural back-and-forth communication with your teammate.