Skip to main content

AI-powered terminal command assistant

Project description

aisk 🚀

aisk 是一个基于 AI 的终端命令助手。只需用自然语言描述你的需求,它就能为你生成相应的 Shell 命令,并支持一键执行。

✨ 特性

  • 自然语言转命令:不再需要苦记复杂的 tarfindffmpeg 参数
  • 智能平台识别:自动识别操作系统(Windows/macOS/Linux),生成对应平台的命令
  • 交互式执行:生成命令后,可以选择立即执行或取消
  • 多模型管理:支持配置多个 AI 模型,随时切换使用
  • 高度可配置:支持任意 OpenAI 兼容的 API,包括通义千问、OpenAI、DeepSeek 等
  • 跨平台支持:支持 Windows、macOS 和 Linux
  • 轻量快捷:基于 Python 开发,极速响应

📦 安装

方式 1:直接通过 PyPI 安装 (推荐)

这是最简单的安装方式,适用于大多数用户:

pip install aisk

方式 2:从源码安装

如果你想参与开发或尝试最新版本:

git clone https://github.com/it-zhouyu/aisk.git
cd aisk
pip install .

⚙️ 配置

初始化配置

在使用之前,需要先进行初始化配置:

aisk init

交互式配置向导会引导你完成以下设置:

  • 配置名称(必填):为这个模型配置起个名字,方便识别(如 qwengpt4 等)
  • API Key(必填):你的 AI 服务 API Key
  • Base URL(选填):API 地址,默认为通义千问 https://dashscope.aliyuncs.com/compatible-mode/v1
  • 模型名称(选填):使用的模型,默认为 qwen3-max

配置文件会保存到 ~/.aisk/config.json

支持任意 OpenAI 兼容的 API,包括通义千问、OpenAI、DeepSeek 等。

多模型管理

你可以配置多个模型,方便在不同场景下切换:

# 添加通义千问模型
aisk init
# 输入配置名称: qwen

# 添加 OpenAI 模型
aisk init
# 输入配置名称: gpt4

# 列出所有模型并切换
aisk model

运行 aisk model 后会显示所有已配置的模型,并支持交互式切换:

已配置的模型:
============================================================

1. qwen [当前]
   模型: qwen3-max
   Base URL: https://dashscope.aliyuncs.com/compatible-mode/v1
   API Key: sk-xxxx...xxxx

2. gpt4
   模型: gpt-4
   Base URL: https://api.openai.com/v1
   API Key: sk-yyyy...yyyy

============================================================

请输入模型编号或名称 (直接回车取消):

💡 使用方法

直接在终端输入 aisk 加上你的需求:

1. 查找文件

aisk 帮我找到当前目录下所有大于 100MB  mp4 文件

2. 压缩/解压

aisk 把当前文件夹打包成 tar.gz 格式,排除 node_modules

3. 系统操作

aisk 查看并杀死占用 8080 端口的进程

🛠 交互逻辑

生成命令后,aisk 会提示是否执行:

  • EnterY:确认并立即执行命令
  • N:取消执行
  • Esc:退出程序

📄 开源协议

本项目采用 MIT 协议。


🤝 贡献

如果你有任何改进建议,欢迎提交 Issue 或 Pull Request!

Made with ❤️ by it_zhouyu

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

aisk-0.1.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

aisk-0.1.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file aisk-0.1.2.tar.gz.

File metadata

  • Download URL: aisk-0.1.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for aisk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e5d1e32795b0a45f998dff416d9a36d50d97c83c08fde50ea25742ca739b8450
MD5 7de00fec5bdb1dcf6ed34a02989048f7
BLAKE2b-256 2eea0d377639749068a14b1e3628b678b554b86b703f39a10c5610fd1caefb9e

See more details on using hashes here.

File details

Details for the file aisk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aisk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for aisk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 17920bcfdb363d617a08a9043d541a7ac7b56e7ae12643351340678013654842
MD5 59079f7448b0bf08410b6aa94d8924bd
BLAKE2b-256 bea30dff44e6012f066684cf8f9064560c0edd8e4c68455141b58344f12f6131

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