All Products
Search
Document Center

Alibaba Cloud Linux:How to use the upgraded cosh

Last Updated:Sep 10, 2026

This article introduces how to use the upgraded version of cosh in Alibaba Cloud Linux 4 Agentic Edition (Agentic OS), complete the configuration, and start using it. The upgraded version of cosh is fully compatible with bash/zsh. Without changing the original terminal habits, it introduces Agent capabilities and provides automatic command diagnosis, natural language operation and maintenance, and scalable plug-in mechanisms.

cosh (Computable Operating System Harness) is a deterministic operating system interface for AI Agents and an upgraded alternative to copilot-shell. It provides an AI-enhanced interactive terminal and structured system operation CLI, giving users access to AI analysis, tool approvals, and intelligent recommendations directly in the terminal.

Install

Agentic OS version 1.1Log in by default at the beginning of the image to enter the upgraded version of cosh. For versions lower than 1.1, you can use the following commands to install or replace them.

# Fresh install, make sure copilot-shell is not installed
sudo yum install cosh-ng

# Existing copilot-shell user switch
cosh-switch

After installation provide the following command:

Order

illustrate

cosh

Main entrance, start AI interactive terminal

cosh-cli

Structured JSON CLI (package management, service management, workspace snapshots, security auditing)

cosh-switch

Switch between cosh-ng and copilot-shell

NoticeAfter installation cosh will be registered to /etc/shells, can be passed chsh Manually set as user login shell.

quick start

Start an interactive terminal

# The most commonly used method: directly enter cosh
cosh

# Specify the underlying shell
cosh --shell zsh

# Pass-through mode: Exit after executing a single command
cosh -c 'ls -la'
cosh -- git status

# Login shell mode
cosh --login

# Isolated mode (skip user ~/.bashrc etc.)
cosh --isolated

After startup, you will enter the native bash/zsh terminal. While executing shell commands normally, cosh-ng will provide AI analysis and tool approval capabilities in the background.

Using cosh-cli for structured operations

# Package management
cosh-cli pkg install nginx
cosh-cli pkg search "web server"
cosh-cli pkg remove nginx --dry-run

# Service management
cosh-cli svc status nginx
cosh-cli svc restart nginx --dry-run

# Workspace snapshot
cosh-cli checkpoint create --workspace ./project --id step-001 -m "safe point"
cosh-cli checkpoint restore step-001 --workspace ./project
cosh-cli checkpoint list --workspace ./project

# security audit
cosh-cli audit check --action "rm -rf /var/log"
cosh-cli audit policy show

All cosh-cli commands output JSON format, support --dry-run Preview.

Slash command

In the interactive terminal enter / The commands at the beginning trigger built-in control functions. enter /help View the list of currently available commands.

Configuration and language

Order

illustrate

/help

Show help for available commands

/config

View current configuration

/config language auto

Set language to auto-detect

/config language zh-CN

Set language to Chinese

/config language en-US

Set language to English

Mode switch

Order

illustrate

/mode approval recommend

Approval mode: AI suggestion, user confirmation required each time

/mode approval auto

Approval mode: read-only operations are automatic, write operations require approval

/mode approval trust

Approval mode: all executed automatically

/mode analysis smart

Analysis mode: automatically decides whether to analyze based on the command type

/mode analysis auto

Analysis mode: automatic analysis after each command execution

/mode analysis manual

Analysis mode: no automatic analysis, needs to be triggered manually

Hook Management

Order

illustrate

/hooks

View Hook status (registered number, source, enabled or disabled)

/hooks enable <name>

Enable specified Hook

/hooks disable <name>

Disable specified Hook

When Hook generates a discovery, the terminal will render a prompt card, which provides operation links such as analyze, ignore, details, etc., without manual input.

Expansion and skills management

Order

illustrate

/extensions

list all extensions

/extensions detail <name>

View extension details

/extensions enable <name>

Enable extension

/extensions disable <name>

Disable extension

/skills

list all skills

/skills detail <name>

View skill details

/skills enable <name>

Enable skills

/skills disable <name>

Disable skills

/mcp

list all mcp

/mcp list

list all mcp

/mcp connect [server]

Connect to mcp server

/mcp inspect [server]

View mcp server tool list

/mcp refresh [server]

Refresh mcp server

/mcp disconnect [server]

Disconnect mcp server

/mcp login [server]

Log in to mcp server

/mcp logout [server]

Exit mcp server

Other commands

Order

illustrate

/auth

Trigger authentication process

/debug session

Show session debugging information

/status

Show status information

Configure

The configuration file is located at ~/.copilot-shell/config.toml, the default startup does not exist, executeThis file will be generated after /auth and other configurations.

[shell]
# Default shell: auto | bash | zsh
default = "auto"
# Analysis mode: smart | auto | manual
analysis_mode = "smart"
# Approval mode: recommend | auto | trust
approval_mode = "auto"

[ai]
# active model
active_model = "qwen-plus"

[ai.providers.dashscope]
type = "dashscope"
api_key = ""    # or via the environment variable DASHSCOPE_API_KEY
model = "qwen-plus"

Configure priority

  1. .copilot-shell/config.toml(project level, current directory)

  2. ~/.copilot-shell/config.toml(User level)

  3. /etc/copilot-shell/config.toml (system level)

Commonly used environment variables

environment variables

illustrate

DASHSCOPE_API_KEY

DashScope API Key

ALIBABA_CLOUD_ACCESS_KEY_ID

Alibaba Cloud AK

ALIBABA_CLOUD_ACCESS_KEY_SECRET

Alibaba Cloud SK

COSH_MODEL

Override active model

COSH_SHELL_ADAPTER

Override default adapter

COSH_SHELL_LANG

Override UI language

COSH_LOG

Global log level