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 |
|
|
Main entrance, start AI interactive terminal |
|
|
Structured JSON CLI (package management, service management, workspace snapshots, security auditing) |
|
|
Switch between cosh-ng and copilot-shell |
NoticeAfter installationcoshwill be registered to/etc/shells, can be passedchshManually 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 |
|
|
Show help for available commands |
|
|
View current configuration |
|
|
Set language to auto-detect |
|
|
Set language to Chinese |
|
|
Set language to English |
Mode switch
|
Order |
illustrate |
|
|
Approval mode: AI suggestion, user confirmation required each time |
|
|
Approval mode: read-only operations are automatic, write operations require approval |
|
|
Approval mode: all executed automatically |
|
|
Analysis mode: automatically decides whether to analyze based on the command type |
|
|
Analysis mode: automatic analysis after each command execution |
|
|
Analysis mode: no automatic analysis, needs to be triggered manually |
Hook Management
|
Order |
illustrate |
|
|
View Hook status (registered number, source, enabled or disabled) |
|
|
Enable specified Hook |
|
|
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 |
|
|
list all extensions |
|
|
View extension details |
|
|
Enable extension |
|
|
Disable extension |
|
|
list all skills |
|
|
View skill details |
|
|
Enable skills |
|
|
Disable skills |
|
|
list all mcp |
|
|
list all mcp |
|
|
Connect to mcp server |
|
|
View mcp server tool list |
|
|
Refresh mcp server |
|
|
Disconnect mcp server |
|
|
Log in to mcp server |
|
|
Exit mcp server |
Other commands
|
Order |
illustrate |
|
|
Trigger authentication process |
|
|
Show session debugging information |
|
|
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
-
.copilot-shell/config.toml(project level, current directory) -
~/.copilot-shell/config.toml(User level) -
/etc/copilot-shell/config.toml(system level)
Commonly used environment variables
|
environment variables |
illustrate |
|
|
DashScope API Key |
|
|
Alibaba Cloud AK |
|
|
Alibaba Cloud SK |
|
|
Override active model |
|
|
Override default adapter |
|
|
Override UI language |
|
|
Global log level |