Skip to content

xAgent-AI/xagent

Repository files navigation

πŸ€– xAgent CLI - Your Autonomous Life AI Assistant

License Node.js TypeScript Version Downloads


πŸš€ The Future of AI Assistants is Here

xAgent CLI is not just another AI coding assistant β€” it's an intelligent agent for personal PCs and autonomous living that transforms how you interact with your digital life.


✨ Why xAgent CLI?

🎯 Universal AI Companion
🏠 Life Automation - From file organization to smart scheduling
πŸ’» Professional Development - Code, debug, and deploy with AI
🌐 Multi-Model Support - Free access to Kimi K2, Qwen3 Coder, DeepSeek v3
πŸ”§ GUI Automation - Precise mouse/keyboard control for any task
πŸ”’ Flexible Security - 5 execution modes from YOLO to DEFAULT

⚑ Quick Start

# Install
npm i -g @xagent-ai/cli

# Launch
xagent start

That's it! Start automating your digital life in seconds.


πŸ“Š Feature Comparison

Feature xAgent CLI Claude Code Gemini CLI
Life Automation βœ… ❌ ❌
PC Smart Management βœ… ❌ ❌
Todo Planning βœ… βœ… ❌
SubAgent System βœ… βœ… ❌
Plan Mode βœ… βœ… ❌
Task Tools βœ… βœ… ❌
Conversation Recovery βœ… βœ… ❌
Context Auto-compression βœ… βœ… βœ…
Web Search βœ… ❌ ⚠️
Thinking Mode βœ… βœ… ❌
Workflow System βœ… ❌ ❌

🎯 What Can xAgent Do?

🏠 Life Assistant

> Organize my desktop, categorize files by type
> Set up daily backup to cloud storage
> Remind me of meetings at 3 PM
> Find largest files eating disk space

πŸ’Ό Productivity Booster

> Batch rename files with date format
> Download all PDFs from a webpage
> Analyze Excel data, generate charts
> Translate documents preserving format

πŸ‘¨β€πŸ’» Developer Companion

> Analyze project architecture
> Find and fix bug root causes
> Create RESTful APIs with auth
> Code review PRs automatically

πŸ”„ Automation Expert

> Download stock prices, send email alerts
> Auto-update project dependencies
> Monitor websites, alert on downtime

πŸ› οΈ Execution Modes

Mode Permissions Best For
🟒 YOLO Full control Complete AI autonomy
🟑 ACCEPT_EDITS File only Safe coding
πŸ”΅ PLAN Plan β†’ Execute Complex tasks
βšͺ DEFAULT Approval required Security-first
🟣 SMART Intelligent Daily use (recommended)

πŸ”‘ Free to Use

xAgent offers completely free access with multiple authentication options:

Method Description
πŸ” xAgent Account Browser-based login (recommended)
πŸ”‘ API Key Server environments
🌐 Third-Party APIs GLM-4, DeepSeek, Qwen, Kimi, and more

πŸ—οΈ Technology Stack

Node.js TypeScript React esbuild Vitest


πŸ“¦ Project Structure

xagent-cli/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ tools/              # 12+ built-in tools
β”‚   β”œβ”€β”€ agents/             # SubAgent system
β”‚   β”œβ”€β”€ gui-subagent/       # GUI automation
β”‚   β”œβ”€β”€ workflow/           # Workflow engine
β”‚   β”œβ”€β”€ checkpoint/         # State persistence
β”‚   └── mcp/                # MCP integration
β”œβ”€β”€ dist/                   # Compiled output
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ test/                   # Test suite
└── package.json

πŸ§ͺ Testing & Quality

npm test          # Unit tests
npm run lint      # ESLint
npm run format    # Prettier
npm run typecheck # TypeScript

βš™οΈ Configuration

Customize xAgent by editing ~/.xagent/settings.json:

{
  "theme": "Default",
  "selectedAuthType": "openai_compatible",
  "apiKey": "your-api-key",
  "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
  "modelName": "glm-4.7",
  "guiSubagentModel": "doubao-1-5-ui-tars-250428",
  "guiSubagentBaseUrl": "https://ark.cn-beijing.volces.com/api/v3",
  "guiSubagentApiKey": "your-api-key",
  "searchApiKey": "",
  "executionMode": "smart",
  "approvalMode": "smart",
  "checkpointing": {
    "enabled": false,
    "autoCreate": true,
    "maxCheckpoints": 10
  },
  "thinking": {
    "enabled": true,
    "mode": "normal",
    "displayMode": "compact"
  },
  "contextCompression": {
    "enabled": true,
    "maxMessages": 30,
    "maxContextSize": 1500000,
    "preserveRecentMessages": 0,
    "enableSummary": true
  },
  "contextFileName": "XAGENT.md",
  "mcpServers": {},
  "language": "en",
  "autoUpdate": true,
  "telemetryEnabled": true,
  "showToolDetails": false,
  "showAIDebugInfo": false,
  "loggerLevel": "info",
  "contextCompress": {
    "enabled": false,
    "autoTrigger": false,
    "messageThreshold": 50,
    "tokenThreshold": 100000,
    "strategy": "summary",
    "preserveRecent": 5
  },
  "type": "openai_compatible"
}

πŸ“š Documentation


🀝 Contributing

We welcome contributions! Here's how to get started:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. βœ… Ensure tests pass
  4. πŸ“ Submit a PR

πŸ“„ License

MIT License - See LICENSE


πŸ™ Acknowledgments

Built with ❀️ using Ink β€’ Powered by xAgent Platform


🌟 Star us on GitHub!

Empowering Your Digital Life with AI