Skip to main content

mens

Agent framework with built-in tools, MCP integration, and CLI.

Install

pip install mens[all]

Quick Start

from flexllm import LLMClient
from mens import AgentClient

llm = LLMClient(model="gpt-4o")
agent = AgentClient(llm)
result = await agent.run("读取 main.py 并分析")

CLI

mens run "查一下 cpu 使用率"          # 非交互执行(支持 stdin 管道)
mens run --tools code "读取 main.py"
mens chat                             # 交互式全屏 TUI
mens chat -c                          # 恢复最近会话
mens sessions list                    # 会话管理

程序 / AI Agent 调用

mens run 是给自动化用的入口:stdout 是结果、stderr 是过程,退出码表达成败。

mens info                                          # 自描述:工具/skill/退出码(JSON)
mens run "任务" --format json                       # 完整执行记录
mens run "任务" --format json || echo "失败: $?"    # 0 成功 / 2 参数错 / 5 未完成

跨调用多轮:--session <id> 新建会话、--resume <id> 续接(分开是为了让"撞上同名旧会话" 报错而不是静默接上陌生上下文)。

退出码与 JSON 字段的完整契约见 docs/agent-cli.md

给 Claude Code 等 AI agent 用时,先装 skill 让它一次拿到心智模型,不必逐层 --help 摸索:

mens install-skill        # → 软链到 ~/.claude/skills/mens/(重开会话后生效)

软链而非复制:升级 mens 后 skill 自动跟着更新,不必记得重装。

交互式 TUI(mens chat)

全屏终端界面:流式输出、工具调用卡片、斜杠命令(/help /clear /compact /model /resume …)、 Esc 中断当前任务、↑/↓ 输入历史、Tab @路径 补全。

  • 权限:默认 default 模式(只读放行,写操作弹窗审批),"总是允许"会把规则持久化到 .mens/settings.json(如 bash(git commit:*))。详见 docs/permissions.md
  • 会话:每轮自动持久化(flaxkv2),-c/--resume 或 TUI 内 /resume 恢复。详见 docs/sessions.md

完整文档见 docs/

Download files

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

Source Distribution

mens-0.1.1.tar.gz (371.8 kB view details)

Uploaded Source

Built Distribution

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

mens-0.1.1-py3-none-any.whl (132.0 kB view details)

Uploaded Python 3

File details

Details for the file mens-0.1.1.tar.gz.

File metadata

  • Download URL: mens-0.1.1.tar.gz
  • Upload date:
  • Size: 371.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mens-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f5634bdbe815e4e904c8dcb7b8c17f05f0699e21aeab92c4b07a726680bed289
MD5 d7f1d9ea5b4cbe2fbd06de4cfcff11dc
BLAKE2b-256 7954fe9799f02e8238d1fb7e05e741eafc6dedf2e13efddf1d0557a8d8c59883

See more details on using hashes here.

Provenance

The following attestation bundles were made for mens-0.1.1.tar.gz:

Publisher: release.yml on KenyonY/mens

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

File details

Details for the file mens-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mens-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 132.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mens-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9d9574f2018fdab267ad962c6c7ae22db636847d61da3d7fc89c7aac0176484
MD5 fdeb6605d64b307b754d77e082b5106d
BLAKE2b-256 c7d97499ab3dd39cbbcedf2bbe064cc49e6b7ae1db27261a9ea250e3953fe195

See more details on using hashes here.

Provenance

The following attestation bundles were made for mens-0.1.1-py3-none-any.whl:

Publisher: release.yml on KenyonY/mens

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