Skip to main content

Overview

The agent command provides direct interaction with the PicoClaw AI agent. It supports both interactive chat mode and single-message mode, allowing you to have conversations with the AI or send one-off commands.

Usage

Flags

string
Send a single message in non-interactive mode. When provided, the agent processes the message and returns the response without entering interactive mode.
string
default:"cli:default"
Session key for maintaining conversation context. Use different session keys to maintain separate conversation histories.
string
Override the default model specified in config. Allows you to use a specific model for this interaction.
boolean
default:"false"
Enable debug logging to see detailed information about the agent’s operation, including tool usage and internal processing.

Interactive Mode

When run without the -m flag, the agent enters interactive mode:
Output:
In interactive mode:
  • Type your message and press Enter to send
  • The agent maintains conversation context within the session
  • Command history is saved (use Up/Down arrows to navigate)
  • Type exit or quit to leave interactive mode
  • Press Ctrl+C to exit immediately

Non-Interactive Mode

Send a single message and receive a response:
Output:

Examples

Basic Chat

Using a Different Session

Maintain separate conversation contexts:

Override Model

Debug Mode

See what’s happening under the hood:
Output:

Interactive Session with Custom Model

Tips

  • Session Management: Use descriptive session keys to organize different conversation threads
  • Model Selection: Choose models based on task complexity and speed requirements
  • Debug Mode: Enable debug mode when troubleshooting or understanding agent behavior
  • History: In interactive mode, command history is preserved in /tmp/.picoclaw_history
  • Long Conversations: The agent maintains context within a session, so you can refer to previous messages

Common Use Cases

  1. Quick Queries: Use non-interactive mode for one-off questions
  2. Extended Conversations: Use interactive mode for back-and-forth dialogue
  3. Task-Specific Sessions: Create dedicated sessions for different projects
  4. Model Experimentation: Try different models for comparison

Exit Codes

  • 0: Success
  • 1: Error (configuration issue, provider error, or processing failure)

See Also