> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laragent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Artisan Commands

> Artisan commands available in LarAgent for managing AI agents

LarAgent provides several Artisan commands to help you create and manage your AI agents. These commands streamline the development process and make it easier to interact with your agents.

## Creating an Agent

You can quickly create a new agent using the `make:agent` command:

```bash theme={null}
php artisan make:agent AgentName
```

This will create a new agent class in your `app/AiAgents` directory with the basic structure and methods needed to get started. The generated agent includes:

* Default model configuration
* In-memory chat history
* Default provider setting
* Empty tools array
* Placeholder for instructions and prompt methods

## Interactive Chat

You can start an interactive chat session with any of your agents using the `agent:chat` command:

```bash theme={null}
# Start a chat with default history name
php artisan agent:chat AgentName

# Start a chat with a specific history name
php artisan agent:chat AgentName --history=weather_chat_1
```

The interactive chat session provides the following capabilities:

* Send messages to your agent
* Get responses in real-time
* Use any tools configured for the agent
* **View response completion time** after each agent response
* Type 'exit' to end the chat session

### Completion Time Display

After each response, the command displays how long the agent took to respond:

```
TestAgent:
Hello! How can I help you today?

Response completed in 1.35 seconds.

You:
```

<Tip>
  Completion time is shown in milliseconds for sub-second responses, and in seconds (with 2 decimal places) for longer responses. This helps you monitor latency and performance during development.
</Tip>

This is particularly useful for testing your agent's functionality and behavior directly from the command line without needing to implement a full UI.

## Clear Chat History

You can clear all chat histories for a specific agent using the `agent:chat:clear` command:

```bash theme={null}
php artisan agent:chat:clear AgentName
```

This command clears all chat histories for the specified agent while preserving the chat history structure and keys. This is useful when you want to reset conversations but maintain the same history identifiers.

## Remove Chat History

You can completely remove all chat histories and keys for a specific agent using the `agent:chat:remove` command:

```bash theme={null}
php artisan agent:chat:remove AgentName
```

This command removes all chat histories and their associated keys for the specified agent, effectively resetting the chat history completely. Use this when you want to completely remove all traces of previous conversations.

<Warning>
  Both, `remove` and `clear` commands will affect the current type of chat
  history. For example, if you were using `session` chat history, and later
  switched to `file`, both commands will remove from the `file` (current type of
  chat history) storage.
</Warning>

## Planned Commands

LarAgent has plans to add more commands in the future to enhance developer experience:

* `make:agent:tool` - Generate tool classes with ready-to-use stubs
* `make:agent:chat-history` - Scaffold custom chat history implementations

These upcoming commands will further simplify the development process and make it easier to extend LarAgent's functionality.
