multimodal/tarko/agent-cli/README.md
A flexible Agent CLI framework built on top of the Agent Kernel (@tarko/agent). Deploy and run agents with ease, featuring built-in Web UI and powerful extensibility.
npm install @tarko/agent-cli
# Start interactive Web UI (default)
tarko
# Run with built-in agents
tarko run agent-tars # Agent TARS
tarko run omni-tars # Omni-TARS
tarko run mcp-agent # MCP Agent
# Run with custom agent
tarko run ./my-agent.js
# Start headless API server
tarko serve
# Headless mode with direct input
tarko --headless --input "Analyze current directory structure"
# Pipeline input
echo "Summarize this code" | tarko --headless
Tarko CLI includes several built-in agents:
agent-tars - Agent TARS: Advanced task automation and reasoning systemomni-tars - Omni-TARS: Multi-modal agent with comprehensive capabilitiesmcp-agent - MCP Agent: Model Context Protocol agent for tool integration# Use built-in agents
tarko run agent-tars
tarko run omni-tars
tarko run mcp-agent
tarko / tarko runLaunches interactive Web UI for real-time conversation and file browsing.
tarko run --port 8888 --open
tarko run agent-tars --port 8888
tarko run ./my-agent.js --port 8888
tarko serveStarts headless API server for system integration.
tarko serve --port 8888
# API available at: http://localhost:8888/api/v1/
tarko run --headlessSilent mode execution with stdout output, perfect for scripting.
# Text output (default)
tarko run --headless --input "Analyze files" --format text
# JSON output
tarko run --headless --input "Analyze files" --format json
# Include debug logs
tarko run --headless --input "Analyze files" --include-logs
tarko requestDirect LLM requests for debugging and testing.
tarko request --provider openai --model gpt-4 --body '{"messages":[{"role":"user","content":"Hello"}]}'
tarko workspaceWorkspace management utilities.
tarko workspace --init # Initialize workspace
tarko workspace --open # Open in VSCode
tarko workspace --status # Show status
Supports multiple formats with auto-discovery of tarko.config.{ts,yaml,json}:
// tarko.config.ts
import { AgentAppConfig } from '@tarko/interface';
const config: AgentAppConfig = {
model: {
provider: 'openai',
id: 'gpt-4',
apiKey: process.env.OPENAI_API_KEY,
},
workspace: './workspace',
server: { port: 8888 },
};
export default config;
# Model configuration
tarko --model.provider openai --model.id gpt-4 --model.apiKey sk-xxx
# Server settings
tarko serve --port 3000
# Workspace path
tarko --workspace ./my-workspace
# Debug mode
tarko --debug
--config)Coming soon
Built on event-driven architecture for monitoring agent execution:
const eventStream = agent.getEventStream();
// Subscribe to all events
eventStream.subscribe((event) => {
console.log('Event:', event.type, event);
});
// Subscribe to specific event types
eventStream.subscribeToTypes(['tool_call', 'tool_result'], (event) => {
console.log('Tool event:', event);
});
Capture and process console output during execution:
import { ConsoleInterceptor } from '@tarko/agent-cli';
const { result, logs } = await ConsoleInterceptor.run(
async () => {
return await agent.run('input');
},
{
silent: true, // Suppress output
capture: true, // Capture logs
},
);
Filter available tools and MCP servers via configuration:
// In config
const config = {
tool: {
include: ['file_*', 'web_*'],
exclude: ['dangerous_*'],
},
mcpServer: {
include: ['filesystem', 'browser'],
exclude: ['experimental_*'],
},
};
# Via CLI
tarko --tool.include "file_*,web_*" --tool.exclude "dangerous_*"
tarko --mcpServer.include "filesystem" --mcpServer.exclude "experimental_*"
Refer to TypeScript definitions:
@tarko/agent-interface - Core agent interfaces@tarko/interface - Application layer interfaces@tarko/agent-cli - CLI framework interfaces[Placeholder: Add screenshots of Web UI interface and CLI usage examples]
Welcome to submit issues and pull requests!
Apache-2.0 License