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.0.tar.gz (370.2 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.0-py3-none-any.whl (131.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mens-0.1.0.tar.gz
  • Upload date:
  • Size: 370.2 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.0.tar.gz
Algorithm Hash digest
SHA256 1be89b4c0f2b11e57ef66af7b5d5849df556670e9430b52b76ff7cadb1d73a41
MD5 55a6ae6977ba7246e0e0112fab5709e1
BLAKE2b-256 a30e34ad2f49295499dcdbd5cbf551ac0f2a22b3807d5b42fcff2e60975bb516

See more details on using hashes here.

Provenance

The following attestation bundles were made for mens-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: mens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 131.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 273f310e127e89c015caba0cce6e11aa2b29ae4f2d516ae59e82c90ac12b51b2
MD5 32b61f04dd00619f0e9997c8aa33aa98
BLAKE2b-256 dd43498492836b67382452dd0a3f7d400feff7436feb41d32a78b20b94dfd4d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mens-0.1.0-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