Get started with OS Copilot

更新时间:
复制 MD 格式

OS Copilot is an intelligent assistant for operating systems, built by Alibaba Cloud on a Large Language Model (LLM). It supports natural language Q&A, assisted command execution, and system O&M and optimization to help you use Linux systems more efficiently. This guide covers the benefits, features, and usage of OS Copilot.

Release history

Version

Release date

Updates

V1.1.0

December 2024

  • Introduced a multi-agent architecture to enhance complex task processing.

  • Added support for specifying backend Bailian Models and custom invocation parameters.

  • Added support for custom MCP Servers.

V0.9.1

February 2024

Upgraded the command-line interface with a scrolling "thought process" feature for clearer, more organized output.

V0.9.0

January 2024

  • Added support for the -t parameter to automatically execute tasks.

  • Added the -f parameter to read and process complex tasks from a file.

  • Added support for direct file read and write operations.

  • Added support for automatically installing missing commands during task execution.

V0.4.8 - V0.8.0

2024

  • Added support for x86_64 and aarch64 architectures.

  • Added support for major OS distributions, including Alibaba Cloud Linux, Anolis OS, CentOS, Ubuntu, and KeyarchOS.

  • For other key features, see the sections below.

Supported operating systems

Operating system

Version

Supported architectures

Alibaba Cloud Linux

Alibaba Cloud Linux 3

x86_64, aarch64

Alibaba Cloud Linux 2

x86_64

KeyarchOS

KOS V5.8 SP2

x86_64, aarch64

Note

KeyarchOS requires a specific version of OS Copilot to be installed.

  • For the x86_64 architecture:

    yum install http://kos.ieisystem.com/os-copilot/os-copilot-0.9.0-1.kos5.x86_64.rpm
  • For the aarch64 architecture:

    yum install http://kos.ieisystem.com/os-copilot/os-copilot-0.9.0-1.kos5.aarch64.rpm

Ubuntu

Ubuntu 24.04

x86_64, aarch64

Ubuntu 22.04

x86_64, aarch64

Ubuntu 20.04

x86_64

Anolis OS

Anolis OS 8

x86_64, aarch64

Anolis OS 7

x86_64

CentOS

CentOS 8

x86_64, aarch64

CentOS 7

x86_64

Benefits

  • Intelligent

    OS Copilot continuously learns from your usage patterns to improve accuracy and provide predictive suggestions.

  • Expert

    OS Copilot provides expert answers to operating system questions.

  • Efficient

    OS Copilot helps you with system diagnosis, optimization, and programming.

  • Collaborative

    Manage your Alibaba Cloud resources with OS Copilot for an integrated service experience.

Features

  • Natural language Q&A on the command line

    OS Copilot allows you to ask questions in natural language directly from the command line, providing expert answers related to daily use and OS-specific topics. This improves your operational efficiency and overall experience.

  • Assisted command execution

    OS Copilot's assisted command execution feature helps new Linux users quickly master basic skills.

  • Alibaba Cloud CLI integration

    OS Copilot integrates with the Alibaba Cloud CLI, allowing you to manage Alibaba Cloud products and query ECS information with simple commands directly from the operating system.

  • System O&M and optimization

    System O&M and optimization are critical scenarios where the performance of the operating system significantly impacts your business. OS Copilot lets you use natural language to invoke relevant O&M and optimization tools, especially Alibaba Cloud's proprietary system tools, making it easier to diagnose system issues and improve performance.

Prerequisites

  • If you are a RAM user, ensure the root Alibaba Cloud account has granted your user the AliyunSysOMOSCopilotAccess system policy. For more information, see Grant permissions to a RAM User.

  • OS Copilot runs only on Elastic Compute Service (ECS) instances.

Install OS Copilot

  1. Install the latest version of OS Copilot.

    Alibaba Cloud Linux

    Check if OS Copilot is installed.

    rpm -q os-copilot
    • If it is not installed, run the following command to install it.

      sudo yum install -y os-copilot
    • If it is already installed, run the following command to upgrade it to the latest version.

      sudo yum update os-copilot

    Ubuntu, Anolis OS, or CentOS

    • For x86_64 architecture:

      curl -#S https://mirrors.aliyun.com/os-copilot/os-copilot-all-in-one-latest.sh | sudo bash
    • For aarch64 architecture:

      curl -#S https://mirrors.aliyun.com/os-copilot/os-copilot-all-in-one-arm-latest.sh | sudo bash
  2. Configure your credentials.

    You can configure credentials in either of the following ways. We recommend using ECS instance role-based authentication to minimize the risk of exposing your AccessKey pair.

    ECS instance role

    Limitations

    For the latest information, see Instance RAM Roles.

    Procedure

    1. Log in to the RAM console to create a RAM role and grant permissions to it.

      1. Create a RAM role for an Alibaba Cloud service.

        In the left-side navigation pane, choose Identities > Roles, and then click Create Role. Follow the on-screen instructions to create the role. Pay attention to the following parameters. For more information about other parameters, see Create a common service role.

        • For Select Trusted Entity, select Alibaba Cloud Service.

        • For Role Type, select Normal Service Role. For Trusted Service, select Elastic Compute Service.

        image

      2. Grant the AliyunSysOMOSCopilotAccess permission to the newly created RAM role.

        image

    2. Assign the RAM role to your ECS instance.

      1. Go to ECS console - Instances.

      2. In the top navigation bar, select the resource group and region where your target instance is located.

      3. Click the ID of the target instance to go to its details page. In the upper-right corner of the page, choose More > Grant/Revoke RAM Role.

      4. In the dialog box that appears, select the instance RAM role you created, and click OK.image

    AK/SK authentication

    Run the following commands to configure environment variables.

    export ALIBABA_CLOUD_ACCESS_KEY_ID=<AccessKey ID>
    export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<AccessKey Secret>
    Note

    Replace <AccessKey ID> and <AccessKey Secret> with your actual AccessKey ID and AccessKey Secret.

Upgrade or uninstall OS Copilot

Alibaba Cloud Linux

  • Upgrade OS Copilot to the latest version.

    sudo yum update os-copilot
  • Uninstall OS Copilot.

    sudo yum remove -y os-copilot

Ubuntu, Anolis OS, or CentOS

Uninstall OS Copilot.

sudo rm -f /bin/co /bin/copilot /etc/profile.d/os-copilot_fix_command_tool_config.sh
Note

To upgrade, first uninstall the current version, and then install the new one.

Use OS Copilot

Custom configuration

You can customize model invocation and MCP Server connections by using the following configuration.

Note

Custom model invocation supports only text generation models. It fully supports the Qwen series and third-party models such as deepseek-r1, deepseek-v3.2, and kimi-k2.

For specific model names, see the Alibaba Cloud Bailian model list.

# Instructions:
# 1. Copy this file to the default path: ~/.copilot_tool/config.toml
#    OR
# 2. Copy this file to any location and set the environment variable OS_COPILOT_CONFIG_PATH to point to its path.

# For general conversation and tasks
[default]
model_name = "qwen3-max"  
[default.generate_kwargs]
temperature = 0.2
max_tokens = 2000
top_p = 0.5

# For code-related tasks
[code]
model_name = "qwen3-coder-plus"
[code.generate_kwargs]
temperature = 0.1
max_tokens = 4000
top_p = 0.5


# MCP (Model Context Protocol) Configuration
[[mcp]]
name = "mcp_tool_1"               # MCP server name
transport = "streamable_http"     # Transport protocol: 'streamable_http' or 'sse'
url = ""                          # MCP service endpoint
# timeout = 30                    # Optional: Connection timeout (seconds)
# sse_read_timeout = 300          # Optional: SSE read timeout (seconds)
# headers = { }                   # Optional: Custom request headers

# Example: Add a second MCP service
[[mcp]]
name = "mcp_tool_2"
transport = "streamable_http"
url = ""

Single-command mode

In single-command mode, append your question directly to the copilot or co command. The command exits after providing an answer.

image

Parameters supported in single-command mode:

# co --help
usage: copilot [-h] [-v] [--mode MODE] [--task] [-f FILE] [prompt ...]

OS Copilot: An OS assistant using LLM technique

positional arguments:
  prompt                The prompt containing your query. If empty, interactive mode is entered.

options:
  -h, --help            show this help message and exit
  -v, -V, --version     show version info and exit
  --mode MODE, -m MODE, -M MODE
                        specify the MODE to use (optional). available MODE: chat, task, aliyun, codesum, codegen
  --task, -t, -T        task mode(can use mcp tools),automatically identify and execute tasks
  -f FILE, --file FILE  get prompt from the FILE
  • Key parameters

    Parameter

    Description

    Example

    -t

    Enters task mode, which allows OS Copilot to automatically orchestrate workflows and call sub-agents to complete the task.

    co check current system health -t

    -f

    Reads content from a file or defines complex tasks for processing.

    co -f task -t. For a video demonstration, see Use files to define complex tasks.

    |

    Uses a pipe.

    cat /etc/sysctl.conf | co explain what these parameters mean

  • Key tools and features

    OS Copilot integrates plugin tools for software management, command checking and execution, file reading and writing, and the Alibaba Cloud CLI. The following examples demonstrate these capabilities.

    • Knowledge Q&A

      image

    • Simple command or script generation and execution

      image

    • Software management

      • 截屏2025-12-29 18

      • 截屏2025-12-29 18

    • Multi-step task execution

      • image

      • image

      • image

    • File read and write operations

      Note

      Ensure that the log file to be analyzed does not exceed 100 lines to avoid exceeding the maximum token limit.

      image

    • Alibaba Cloud CLI

      1. Install the Alibaba Cloud CLI software.

        Note

        This document uses the installation of Alibaba Cloud CLI on an Alibaba Cloud Linux 3 system as an example. For instructions on how to install the CLI on other systems, see Install the CLI on Linux.

        sudo dnf install aliyun-cli -y
      2. Configure Alibaba Cloud CLI permissions by using an AK/SK.

        aliyun configure

        Configure the settings as prompted.

        image

      3. The following example shows how to use OS Copilot to call the Alibaba Cloud CLI.

        image

Question mark command

If a command fails, enter ? or why to ask OS Copilot for an explanation and a potential solution.

Run source /etc/os-copilot/fix_command_config.sh to enable this feature.

image.png

Note
  • If you encounter a "command not found" error for ? or why, run source /etc/os-copilot/fix_command_config.sh to enable the command.

  • This feature collects command execution error logs. To disable it, start a new session (for example, by logging out and back in).

Interactive mode

  • Run the copilot or co command to enter interactive mode, which supports multi-turn conversations and defaults to Chat mode.

  • Run the exit or quit command, or press Ctrl+D or Ctrl+C to exit interactive mode.

The following modes are available:

  • CHAT: The default chat mode. You can switch to this mode by running the chat command. If OS Copilot outputs a shell command in this mode, you can select the corresponding number to automatically execute it.

  • TASK: The task orchestration mode. OS Copilot understands your intent, breaks down tasks, and assigns them to sub-agents for execution. Switch to this mode with the task command.

  • CODEGEN: Automatically generates code based on your instructions. You can switch to this mode by running the codegen command.

  • CODESUM: Reads a local code snippet file and automatically generates a code summary. You can switch to this mode by running the codesum command.

  • ALIYUN: Calls the Alibaba Cloud CLI to perform O&M operations. You can switch to this mode by running the aliyun command.

    image

Hands-on lab

Explore features like Q&A, assisted O&M, and code learning in our hands-on lab. This lab helps you efficiently solve system problems and improve your programming productivity. Access the lab here: [Lab] Unlock OS O&M and Programming with OS Copilot.

Console diagnostic agent

The diagnostic agent in the Operating System Console's smart assistant automatically runs diagnostic tools when you ask for help with an issue.

Procedure

  1. Open the smart assistant chat box on the Operating System Console page.

    image.png

  2. Start a conversation with the smart assistant about a diagnostic issue, for example, a memory anomaly.

    Enter a query, such as "memory anomaly". The assistant guides you to provide the necessary information for diagnosis, such as the ECS Instance ID and Region.

    Output: Prompts the user to enter additional diagnostic information.

    Input: ECS ID and Region

    image.png

    image.png

    After you provide the required information, the system indicates that a diagnosis is in progress.image.png

    When the diagnosis is complete, the assistant provides a summary of the results.image.png

    image.png

    image.png

    Click the link to view the detailed diagnosis report.image.png

  3. You can continue the conversation or ask about other diagnostic functions.

    Input: Other questions

    Output: A normal response is returned.

If the conversation freezes or becomes unresponsive, type "Start a new conversation" to restart.

Product video

Technical support

If you have any questions or suggestions while using OS Copilot, you can use the following channels to provide feedback and obtain technical support.

  • DingTalk Group (Recommended): Join the technical support DingTalk group (ID: 71050008820) to contact technical support.

  • Submit a ticket: You can also submit a ticket for more free support.

  • Documentation feedback: If you find any issues with the product documentation, such as broken links, incorrect content, or API errors, you can click Feedback in the floating menu on the right side of the page or select the problematic content and click Feedback.

  • To help us improve OS Copilot, please fill out our survey.