Skip to main content

Agent-friendly CLI layer inspired by GNU Coreutils.

Project description

AICoreUtils

中文说明

AICoreUtils 是一个面向 LLM Agent 的 JSON 优先命令行工具包原型。它参考 GNU Coreutils 的常用命令,但不是完整的 GNU 兼容替代品。

项目目标是给机器调用方提供确定、低噪音、易解析的 CLI 接口:

  • 默认输出 JSON
  • 错误以 JSON 写入 stderr
  • 退出码语义稳定
  • 修改文件的命令支持 --dry-run
  • 需要管道组合时显式使用 --raw

快速开始

pip install aicoreutils
aicoreutils schema --pretty
aicoreutils ls . --limit 20
aicoreutils rm build --recursive --dry-run

🤖 Claude Desktop / MCP 集成

一行配置,让 Claude 直接操作你的文件系统:

编辑 Claude Desktop 配置文件(详细说明 →):

系统 配置文件
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "aicoreutils": {
      "command": "python",
      "args": ["-m", "aicoreutils.mcp_server"]
    }
  }
}

重启 Claude Desktop,然后对它说:

"列出项目里所有 Python 文件,统计代码行数"

Claude 自动调用 aicoreutils ls + aicoreutils wc,全程 JSON 交互。

更多集成方式:aicoreutils tool-list --format openai 输出 OpenAI Function Calling 格式,可直接用于任意 Agent 框架。

运行测试

# 推荐主入口(pytest,含 Hypothesis property-based 测试和 GNU 对照测试)
python -m pytest project/tests/ -v --tb=short

# Legacy 入口(unittest,部分运行器)
python -m unittest discover -s project/tests -v

项目结构

.
|-- src/aicoreutils/        # Python 包源码
|-- .github/               # CI、Copilot 指令和开发脚本
|-- pyproject.toml         # 包元数据和构建配置
|-- README.md              # 项目入口
`-- project/               # 项目附属资源
    |-- tests/             # 子进程级行为测试
    |-- docs/              # 文档入口和分类文档目录
    |   |-- reference/     # 协议、命令面和安全生产契约
    |   |-- guides/        # 使用指南
    |   |-- audits/        # 兼容性和质量审计
    |   |-- development/   # 测试和开发说明
    |   |-- status/        # 当前项目状态(唯一权威来源)
    |   |-- analysis/      # 项目分析日志(历史归档)
    |   |-- agent-guides/  # AI 辅助编码与文档治理规则
    |   `-- reports/       # 测试报告等生成/归档文档
    |-- vendor/gnu-coreutils/  # 本地上游源码缓存,默认被 Git 忽略
    `-- AGENTS.md          # 仓库级 Agent 入口规则

文档

发布状态

当前实现:aicoreutils schema 中登记 114 个 CLI 命令(含 tool-list 等 Agent 元命令)。

重要限制:本项目是受 GNU Coreutils 启发的 Agent 友好子集,不是完整的 GNU Coreutils 克隆。


English

AICoreUtils is a JSON-first command-line toolkit prototype for LLM agents. It is inspired by common GNU Coreutils commands, but it is not a complete GNU-compatible replacement.

The goal is a deterministic, low-noise interface for machine callers:

  • JSON output by default
  • JSON errors on stderr
  • Stable semantic exit codes
  • --dry-run for mutation commands
  • Explicit --raw output for pipeline composition

Quick Start

pip install aicoreutils
aicoreutils schema --pretty
aicoreutils ls . --limit 20
aicoreutils rm build --recursive --dry-run

🤖 Claude Desktop / MCP Integration

One config line to let Claude operate your filesystem:

Edit Claude Desktop config (full guide →):

OS Config File
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "aicoreutils": {
      "command": "python",
      "args": ["-m", "aicoreutils.mcp_server"]
    }
  }
}

Restart Claude Desktop, then ask:

"List all Python files in the project and count lines of code"

Claude calls aicoreutils ls + aicoreutils wc automatically.

For other frameworks: aicoreutils tool-list --format openai outputs OpenAI Function Calling format directly.

Run tests

# Recommended primary entry (pytest, includes Hypothesis property-based and GNU differential tests)
python -m pytest project/tests/ -v --tb=short

# Legacy entry (unittest, partial runner)
python -m unittest discover -s project/tests -v

Project Layout

.
|-- src/aicoreutils/        # Python package
|-- .github/               # CI, Copilot instructions and development scripts
|-- pyproject.toml         # package metadata and build config
|-- README.md              # project entry point
`-- project/               # project collateral
    |-- tests/             # subprocess-level behavior tests
    |-- docs/              # documentation index and categorized docs
    |   |-- reference/     # protocol, command-surface and security contracts
    |   |-- guides/        # usage guides
    |   |-- audits/        # compatibility and quality audits
    |   |-- development/   # testing and development notes
    |   |-- status/        # current project status (single authoritative source)
    |   |-- analysis/      # project analysis logs (historical archive)
    |   |-- agent-guides/  # AI coding assistant and docs governance rules
    |   `-- reports/       # test reports and archived generated docs
    |-- vendor/gnu-coreutils/  # local upstream source cache, ignored by Git by default
    `-- AGENTS.md          # repository-level agent entry rules

Documentation

Release Status

Current implementation: 114 CLI commands in aicoreutils schema (including agent-native meta-commands like tool-list).

Important limitation: this project is an agent-friendly subset inspired by GNU Coreutils, not a full GNU Coreutils clone.

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

aicoreutils-0.3.5.tar.gz (169.0 kB view details)

Uploaded Source

Built Distribution

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

aicoreutils-0.3.5-py3-none-any.whl (96.0 kB view details)

Uploaded Python 3

File details

Details for the file aicoreutils-0.3.5.tar.gz.

File metadata

  • Download URL: aicoreutils-0.3.5.tar.gz
  • Upload date:
  • Size: 169.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aicoreutils-0.3.5.tar.gz
Algorithm Hash digest
SHA256 fe5f01f5306f956e87134012c879308caec344fbfefa7087f817e1d7b8b9eae0
MD5 4874a4a51716ec52d65015373d0524f4
BLAKE2b-256 80cb5b32c6ee99afaec47ff6ed5172bca9706d33749325ad60ac41283dde8b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicoreutils-0.3.5.tar.gz:

Publisher: publish.yml on caseSHY/AI-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aicoreutils-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: aicoreutils-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 96.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aicoreutils-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f5152eaeeb0e2580cbe8919735d30d5b534efb1d7db991a1a4d3a7e1643182f9
MD5 385239b4bc2ef07a2b72179353d6e361
BLAKE2b-256 2d6975e4c389f165240415271b1eb37c789713441d1f9b18018104b1a8681202

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicoreutils-0.3.5-py3-none-any.whl:

Publisher: publish.yml on caseSHY/AI-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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