Skip to main content

ai command master example

Project description

AI Command Master

一个基于AI的命令行工具,帮助用户更高效地完成命令行操作。

功能特点

  • 支持多种AI模型配置(OpenAI、Deepseek、智谱AI等)
  • 智能命令解析和执行(自然语言转命令行)
  • 多配置文件管理(支持环境隔离)
  • 跨平台支持(Windows/macOS/Linux)

典型场景

  • 快速查询复杂命令语法
  • 自动化重复性运维操作
  • 安全执行危险命令前确认
  • 开发环境快速配置

安装

环境要求

  • Python >= 3.8(建议3.13.0)
  • pip 23.0+(Python包管理器)
  • Git 2.30+(源码安装需要)

安装步骤

方法一:通过pip安装(推荐)

使用清华PyPI镜像加速安装:

pip install ai-command-master -i https://pypi.tuna.tsinghua.edu.cn/simple

方法二:从源码安装

  1. 克隆项目代码:
git clone https://gitee.com/yourusername/ai-command-master.git
cd ai-command-master
  1. 安装依赖(使用镜像源):
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple .

快速开始

1. 创建配置文件

# Windows系统需要以管理员模式运行CMD/PowerShell
# myconfig为文件名,建议使用model名命名
ai config create myconfig

2. 配置文件示例

# 请以官方提供的API文档为准
model_provider = "Moonshot"
model_name = "moonshot-v1-8k"
base_url = "https://api.moonshot.cn/v1"
api_key = "your_api_key"
max_token: 8192
temperature: 0.3

3. 配置文件管理

# 列出所有配置文件
ai config list

# 显示当前配置
ai config show

# 切换配置文件
ai config switch myconfig

......

使用指南

基础使用

# 获取帮助
ai --help

# 执行命令(Windows路径示例)
ai ask 如何批量重命名当前目录下所有.txt文件为.md文件?

开发说明

环境配置(Windows)

  1. 创建虚拟环境:
python -m venv venv
venv\Scripts\activate
  1. 安装包:
# 使用.virtualenv文件安装所有依赖
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple e .

许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_command_master-1.1.3.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_command_master-1.1.3-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file ai_command_master-1.1.3.tar.gz.

File metadata

  • Download URL: ai_command_master-1.1.3.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for ai_command_master-1.1.3.tar.gz
Algorithm Hash digest
SHA256 445c852b169446e78655023843cdaaf76d3879090e1014fd3385cfa644b4bee8
MD5 d6eba923db057224e9e58ddb50477b4f
BLAKE2b-256 e44afd1d2965ed7cd0b877b161bb017726702b94938e9ad7634071edec8f933b

See more details on using hashes here.

File details

Details for the file ai_command_master-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_command_master-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a7513007229a91efb8413306dfebdefa773f684c6e818d5e2cb2181b3a04bdc4
MD5 7691003fb3649a874e9e422b1250143a
BLAKE2b-256 27c1c20c085a052d926470ad4e6736e57583cbc380176ea0128ed742d9aacae0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page