This document serves as a reference for both the CLI commands available to users and the internal API for contributors.
Used within the ag REPL session.
| Command | Arguments | Description |
|---|---|---|
/agent |
[prompt] |
Start the autonomous agentic workflow for complex tasks. |
/ui |
[image_path] |
Analyze a UI screenshot and generate HTML/CSS code. |
/see |
[image_path] [prompt] |
Analyze an image with a specific prompt. |
/commit |
- | Analyze staged git changes and generate a commit message. |
/index |
- | Force re-indexing of the codebase for RAG. |
/init |
[name] |
Scaffolding tool to initialize a new Fractal Agent project. |
/create |
[prompt] |
Quick scaffolding for files/features. |
/debug |
[prompt] |
Debugging workflow triggering. |
/test |
[file] |
Generate unit tests for a specific file. |
/provider |
[name] |
Switch AI provider (gemini, claude, openai, ollama). |
/model |
[name] |
Switch model for the current provider. |
/config |
- | Display current configuration. |
/new |
- | Clear context and start a new conversation. |
/clear |
- | Clear the terminal screen. |
/help |
- | Show help menu. |
/exit |
- | Exit the application. |
| Flag | Description |
|---|---|
--json |
Output response in JSON format (useful for IDE integrations). |
--help |
Show help menu. |
--version |
Show version number. |
-
initialize()- Initializes database, context manager, and API orchestrator.
- Returns:
Promise<void>
-
processRequest(message, options)- Main entry point for handling user messages.
message: stringoptions: object (e.g.,{ image: 'path/to/img' })- Returns:
Promise<ResponseObject>
-
shutdown()- Gracefully closes database connections and saves state.
-
getContext()- Retrieves current conversation context, formatted for the LLM.
- Returns:
Promise<Array<Message>>
-
addAssistantMessage(content, provider, model)- Adds an AI response to history.
-
addUserMessage(content)- Adds a user message to history.
-
sendMessage(message, context, options)- Sends request to the active provider. Handles failover logic automatically.
- Returns:
Promise<Response>
-
switchProvider(providerName)- Manually switches the active provider.
providerName: 'gemini' | 'claude' | 'openai' | 'ollama'
All tools follow a standard interface:
{
name: "tool_name",
description: "Description",
parameters: { ...JSON Schema... },
execute: async (args) => { ... }
}Registered tools include:
read_filewrite_filelist_dirrun_commandbrowser_action