Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

@aigne/cli


GitHub star chart
Open Issues
codecov
NPM Version
Elastic-2.0 licensed

Command-line tool for AIGNE Framework, providing convenient development and management capabilities.

Introduction#

@aigne/cli is the official command-line tool for AIGNE Framework, designed to simplify the development, testing, and deployment processes for AIGNE applications. It provides a series of useful commands to help developers quickly create projects, run agents, test code, and deploy applications.

Features#

  • Project Creation: Quickly create new AIGNE projects with predefined file structures and configurations
  • Agent Running: Easily run and test AIGNE agents
  • Testing Support: Built-in test command for unit testing and integration testing
  • MCP Services: Support for launching agents as MCP servers for integration with external systems
  • Interactive Interface: Beautiful command-line interface providing an intuitive user experience
  • Multi-model Support: Support for OpenAI, Claude, XAI, and other model providers

Installation#

Using npm#

npm install -g @aigne/cli

Using yarn#

yarn global add @aigne/cli

Using pnpm#

pnpm add -g @aigne/cli

Basic Commands#

AIGNE CLI provides the following main commands:

# Display help information
aigne --help

# Create a new project
aigne create [path]

# Run an agent
aigne run --path xxx

# Run tests
aigne test --path xxx

# Start MCP server
aigne serve-mcp --path xxx

# Start observability server
aigne observe [option]

Create Command#

Create a new AIGNE project with agent configuration files.

# Create a project in the current directory (will prompt for project name)
aigne create

# Create a project at the specified path
aigne create my-project

The interactive creation process will ask for:

  • Project name
  • Project template (currently supports the default template)

Run Command#

Launch a chat loop with the specified agent.

# Run the agent in the current directory
aigne run

# Run the agent at the specified path
aigne run path/to/agents

# Run the agent from a remote URL
aigne run https://example.com/aigne-project

# Run a specific agent
aigne run --entry-agent myAgent

Available options:

  • --entry-agent <entry-agent> - Specify the agent name to run (defaults to the first agent found)
  • --cache-dir <dir> - Specify the directory to download the package to (used in URL mode)
  • --model <provider[:model]> - Specify the AI model in format 'provider[:model]' where model is optional (e.g., 'openai' or 'openai:gpt-4o-mini')
  • --verbose - Enable verbose logging

Test Command#

Run tests in the specified agents directory.

# Test the agents in the current directory
aigne test

# Test the agents at the specified path
aigne test path/to/agents

Serve MCP Command#

Serve the agents in the specified directory as a MCP server.

# Start MCP server on default port 3000
aigne serve-mcp

# Start MCP server on specified port
aigne serve-mcp --port 3001

# Start MCP server for agents at specified path
aigne serve-mcp --path path/to/agents

Serve Command (observability)#

Start the service for monitoring data

# Start observability server on default port 7890
aigne observe

# Start observability server on specified port
aigne observe --port 3001

License#

Elastic-2.0