Catalog PyPI
PACKAGE EXPLORERView in registry

aicommand

PyPI

AI-powered CLI agent — describe tasks in natural language, it plans and executes commands autonomously. Supports local, SSH Linux, SSH Windows. Like ChatGPT for your terminal.

agentaiai-agentai-automationai-devopsai-shellautomationchatgpt-cliclicommand-linedevopslinux-adminllmmcpnatural-languagenatural-language-shell
All keywords (25)
ollamaopenaipythonremote-executionshellsshssh-agentsysadminterminal
Versions collected1
Direct dependencies3From release 0.1.5
Last observed21 Oct, 10:14 UTC

README

Version 0.1.5 documentation

aiCLI - AI Command Line Agent Logo

aiCLI — AI-Powered Command Line Agent

Natural language to command execution. Describe what you want, it plans the steps, runs the commands, and handles errors autonomously.
Like ChatGPT for your terminal. Supports local, SSH Linux, and SSH Windows.

PyPI Release License Python Platform

爱 CLI — Because nobody remembers all those commands.
爱 CLI — 因为没人记得住那么多命令。

English | 中文


😤 Sound Familiar? (Or: Why You Need an AI Terminal Agent)

  • Can't remember the exact grep/awk/sed flags to extract that field?
  • Every time you install software, you Google the tutorial? Docker, Nginx, MySQL — all different?
  • Staring at the terminal, unsure what command to type next?
  • You're great at Java/Python/Frontend, but Linux sysadmin is not your thing?

aiCLI is built for developers who just want to get things done — without memorizing a thousand commands.

$ aicli --local
aicli> install Docker and Docker Compose

==================================================
  1. Check existing Docker installation — 5s — safe
  2. Install Docker Engine — 60s — low risk
  3. Install Docker Compose plugin — 30s — low risk
  4. Verify installation — 5s — safe
==================================================

  Confirm execution plan? [Y]: Y

──────────────────────────────────────────────────
  Step 1
  GOAL:  Check if Docker is already installed
  CMD:   docker --version
  RISK:  safe *  [auto-execute]
──────────────────────────────────────────────────
[auto] executing...
[OK] | 200ms

  ... (aiCLI continues through all steps autonomously)

==================================================
[DONE] | 4 commands executed
       Docker v27.3.1 and Docker Compose v2.29.7 installed successfully

Three Scenarios, One Tool

ScenarioCommandDescription
Local Machineaicli --localExecute commands on your own computer
Remote Linuxaicli --host 192.168.1.100 --user rootSSH into any Linux server
Remote Windowsaicli --host 10.0.0.5 --user administratorSSH into Windows (OpenSSH Server required)

Quick Start

# Install
pip install aicommand
# or
uv tool install aicommand

# Run
aicli --local

# Switch language (English / 中文)
aicli --lang en --local
aicli --lang zh --local

Option 2: Run from Source

git clone https://github.com/yanzhangyanyan/ai-cli.git
cd ai-cli
uv sync
uv run aicli --local

Prerequisites

DependencyVersionNotes
Python≥ 3.11Runtime
LLM APIAny OpenAI-compatibleChatGPT, GLM, Ollama, LiteLLM, etc.

Features

FeatureDescription
Natural Language → ExecutionDescribe what you want, aiCLI plans and executes
Autonomous PlanningReceives task → outputs full plan → confirms → executes step by step
Auto / Confirm ModesLow-risk operations auto-execute; high-risk operations ask first
Error Self-HealingIf a step fails, aiCLI analyzes the error and tries an alternative
Safe by DesignCode-level safety net: rm -rf, mkfs, reboot always require confirmation
Cross-PlatformLocal (Windows/Linux/macOS), Remote Linux, Remote Windows
Dual ModeStandalone CLI + MCP Server (embed into any AI agent)
Context MemorySet project context; agent remembers across tasks
Smart Compression200-step long tasks auto-summarize early steps to stay within token limits
BilingualEnglish and Chinese UI — select on first run
Connection DiagnosticsIf SSH fails, tells you exactly why and how to fix it

Usage

Interactive CLI

# Local mode
aicli --local

# Remote SSH
aicli --host 192.168.1.100 --user root --password secret

# With options
aicli --local --llm https://api.openai.com/v1 --model gpt-4o

Inside aiCLI

aicli> install nginx

aicli> check disk space and clean up /tmp if over 80%

aicli> configure UFW firewall: allow 80, 443, deny 3306

aicli> deploy this docker-compose.yml and make sure all containers are healthy

MCP Server Mode

aiCLI can be embedded into any MCP-compatible AI agent (opencode, Claude Desktop, etc.):

{
  "mcpServers": {
    "aicli": {
      "type": "local",
      "command": ["aicli", "serve"],
      "environment": {
        "AICLI_LLM_BASE_URL": "https://api.openai.com/v1",
        "AICLI_LLM_API_KEY": "sk-...",
        "AICLI_LLM_MODEL": "gpt-4o"
      },
      "timeout": 60000
    }
  }
}

CLI Commands

local                               Local mode (no SSH needed)
connect <user@host> [password]      Connect to remote host
disconnect                          Disconnect
exec <command>                      Execute a single command manually
file_read <path>                    Read a file
file_write <path> <content>         Write to a file
probe                               Detect system info
run <description>                   Agent plans and executes
<free text>                         Just type what you want (same as run)
config                              View config
config model [name]                 Switch model
config thinking [on|off]            Toggle thinking mode
config setup                        Reconfigure wizard
context <description>               Set project context

Configuration

Config Priority

CLI args (--llm, --model)  >  Environment vars (AICLI_LLM_*)  >  Config file

Supported LLM Providers

Any OpenAI-compatible API:

ProviderBase URLNotes
OpenAIhttps://api.openai.com/v1GPT-4o, etc.
GLM (Zhipu)https://open.bigmodel.cn/api/paas/v4GLM-4, GLM-5
Ollama (local)http://localhost:11434/v1Any local model
LiteLLM (proxy)http://localhost:4000/v1Unified gateway

License

GNU Affero General Public License v3.0 (AGPL-3.0) — free to use and modify, but all derivative works must also be open source. Cloud service providers using modified versions must provide source code to users.



😤 是不是很熟悉?

  • 记不住 grep/awk/sed 的各种参数组合?
  • 每次装软件都要搜教程?Docker、Nginx、MySQL 配置各不同?
  • 对着终端发呆,不知道下一步该敲什么?
  • Java/前端写得溜,但 Linux 命令行是你的噩梦?

aiCLI 专为"只想把活干完,不想背一千条命令"的开发者而生。

$ aicli --local
aicli> 安装 Docker 和 Docker Compose

==================================================
  1. 检查现有 Docker 安装 — 5s — 安全
  2. 安装 Docker Engine — 60s — 低风险
  3. 安装 Docker Compose 插件 — 30s — 低风险
  4. 验证安装 — 5s — 安全
==================================================

  确认执行此方案?[Y]: Y

──────────────────────────────────────────────────
  Step 1
  GOAL:  检查是否已安装 Docker
  CMD:   docker --version
  RISK:  安全 *  [自动执行]
──────────────────────────────────────────────────
[auto] executing...
[OK] | 200ms

  ... (aiCLI 自动继续执行后续步骤)

==================================================
[DONE] | 4 commands executed
       Docker v27.3.1 和 Docker Compose v2.29.7 安装成功

三个场景,一个工具

场景命令说明
本机执行aicli --local在你自己的电脑上智能执行命令,无需 SSH
远程 Linuxaicli --host 192.168.1.100 --user rootSSH 连接任意 Linux 服务器
远程 Windowsaicli --host 10.0.0.5 --user administratorSSH 连接 Windows(需安装 OpenSSH Server)

快速开始

方式一:pip / uv 安装(推荐)

pip install aicommand
# 或者
uv tool install aicommand

# 运行
aicli --local

# 切换语言(English / 中文)
aicli --lang en --local
aicli --lang zh --local

方式二:源码运行

git clone https://github.com/yanzhangyanyan/ai-cli.git
cd ai-cli
uv sync
uv run aicli --local

前提条件

依赖版本说明
Python≥ 3.11运行时
LLM API任何 OpenAI 兼容接口ChatGPT、智谱 GLM、Ollama、LiteLLM 等

核心特性

特性说明
自然语言 → 自动执行说人话,aiCLI 自动规划并执行
自主规划收到任务后输出完整方案,确认后逐步执行
自动/确认模式低风险操作自动执行,高风险操作需确认
错误自修复步骤失败时自动分析原因,换方案重试
安全设计代码层安全网:rm -rf、mkfs、reboot 强制确认
跨平台本机(Windows/Linux/macOS)、远程 Linux、远程 Windows
双模式独立 CLI + MCP Server(可嵌入任意 AI 智能体)
上下文记忆设置项目上下文,跨任务记忆不丢失
智能压缩200 步长任务自动摘要,不爆 token
中英双语首次运行选择语言,全程中文/英文界面
连接诊断SSH 失败时告诉你原因和修复方法

使用方法

交互式 CLI

# 本机模式
aicli --local

# 远程 SSH
aicli --host 192.168.1.100 --user root --password 密码

# 指定 LLM
aicli --local --llm https://api.openai.com/v1 --model gpt-4o

在 aiCLI 内部

aicli> 安装 nginx

aicli> 检查磁盘空间,超过 80% 就清理 /tmp

aicli> 配置防火墙:放行 80、443,拒绝 3306

aicli> 部署 docker-compose.yml,确保所有容器健康运行

MCP Server 模式

aiCLI 可以嵌入任何支持 MCP 协议的 AI 智能体(opencode、Claude Desktop 等):

{
  "mcpServers": {
    "aicli": {
      "type": "local",
      "command": ["aicli", "serve"],
      "environment": {
        "AICLI_LLM_BASE_URL": "https://api.openai.com/v1",
        "AICLI_LLM_API_KEY": "sk-...",
        "AICLI_LLM_MODEL": "gpt-4o"
      },
      "timeout": 60000
    }
  }
}

CLI 命令

local                               本机模式(无需 SSH)
connect <user@host> [密码]          连接远程主机
disconnect                          断开连接
exec <命令>                         手动执行单条命令
file_read <路径>                    读取文件
file_write <路径> <内容>            写入文件
probe                               探测系统信息
run <任务描述>                      Agent 规划并执行
<自然语言>                          直接输入(等同于 run)
config                              查看配置
config model [名称]                 切换模型
config thinking [on|off]            切换思考模式
config setup                        重新配置向导
context <描述>                      设置项目上下文

配置

配置优先级

命令行参数 (--llm, --model)  >  环境变量 (AICLI_LLM_*)  >  配置文件

支持的 LLM

任何 OpenAI 兼容 API:

提供商地址说明
OpenAIhttps://api.openai.com/v1GPT-4o 等
智谱 GLMhttps://open.bigmodel.cn/api/paas/v4GLM-4、GLM-5
Ollama(本地)http://localhost:11434/v1任意本地模型
LiteLLM(代理)http://localhost:4000/v1统一网关

许可证

GNU Affero General Public License v3.0 (AGPL-3.0) — 自由使用和修改,但所有衍生作品必须开源。云服务商使用修改版本必须向用户提供源代码。


aiCLI — 爱CLI
因为命令应该听懂你,而不是反过来。
Because commands should understand you, not the other way around.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.531 May 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
yanzhangyanyan/ai-cli

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:049249538443403fbe0916a1917544eab6284ddebe1a88a3bf55dd1cbc2f8c15