langchain-agentx-cli
AgentX Code — Terminal AI coding assistant with Claude Code compatible TUI.
依托 langchain-agentx-python SDK,提供功能完整的终端编码助手。
Installation
pip install langchain-agentx-cli
Requires Python 3.11+ and ANTHROPIC_API_KEY environment variable.
Quick Start
# Navigate to your project directory
cd ~/my-project
# Start AgentX Code
agentx-code
Environment Setup
# Set your Anthropic API key
export ANTHROPIC_API_KEY="sk-ant-..."
Command Options
agentx-code # Start in current directory
agentx-code --workspace-root /path/to/project # Specify workspace
agentx-code --mode agentx|claude|cursor # Config-home brand mode (see below)
agentx-code --agent-home .cursor # Or set segment directly (overridden by --mode)
agentx-code --model claude-sonnet-4-6 # Specify model
agentx-code --provider claude | openai # Choose provider
agentx-code --dangerously-skip-permissions # Skip permission prompts (CC-aligned)
agentx-code --allowed-tools Read Grep Glob # Pre-approve tools (space or comma; CC --allowed-tools)
agentx-code --allowed-tools Bash,Skill # Tier1 scan profile (OPS/new_agent); see SDK A25 R0
agentx-code --disallowed-tools Bash Edit # Block tools (space or comma; deny wins)
agentx-code --tools Read Grep Glob # Only these built-ins; others auto-denied (CC --tools)
agentx-code -p "summarize README.md" # One-shot print mode (headless)
agentx-code --show-config # Print merged config
Config home mode (agent_home_segment,与 SDK 三模式对齐):
--mode |
Segment | Typical paths |
|---|---|---|
claude(默认) |
.claude |
~/.claude/(与 Claude Code 同构,默认复用其全局配置/skills) |
agentx |
.langchain_agentx |
~/.langchain_agentx/、仓库内 .langchain_agentx/ |
cursor |
.cursor |
~/.cursor/ |
优先级:--mode > --agent-home > 环境变量 LANGCHAIN_AGENTX_AGENT_HOME > CLI 默认 .claude。只换品牌目录名,不按「目录是否存在」隐式回退。与默认 --provider claude 对齐:裸跑 agentx-code 即走 Claude 配置树。
Read-only audit (aligned with Claude Code CLI semantics):
agentx-code --permission-mode dontAsk \
--allowed-tools Read,Grep,Glob \
--disallowed-tools Bash,Edit,WebSearch,WebFetch
Input Habits (Claude Code Compatible)
| Key | Action |
|---|---|
| Enter | Send message |
| Shift+Enter | Insert newline |
| \ + Enter | Insert newline (alternative) |
| ↑ / ↓ | Navigate history / move in multiline |
| Tab | Command completion |
| Ctrl+R | History search |
| Ctrl+Shift+L | Clear messages |
| Ctrl+C | Cancel generation / Quit (twice) |
Type /help in the REPL for full command list.
Development
# Clone and install in editable mode
git clone https://github.com/GoodMood2008/langchain-agentx-cli.git
cd langchain-agentx-cli
pip install -e ".[dev]"
# Run tests
pytest tests -v
# Run directly (without install)
python -m langchain_agentx_cli
Configuration
Config file location: ~/.config/langchain_agentx/langchain_agentx.json
{
"llm": {
"provider": "claude",
"model": "claude-sonnet-4-6",
"api_key": null,
"base_url": null
},
"theme": "dark",
"show_suppressed_text": false
}
历史字段
user_message_preview_lines已随 BriefTool/user_message移除而废弃,请勿写入新配置。
Architecture
工程约定与开发说明见根目录 CLAUDE.md。
| Layer | Name | Description |
|---|---|---|
| PyPI Package | langchain-agentx-cli |
pip install langchain-agentx-cli |
| CLI Command | agentx-code |
User types in terminal |
| Python Package | langchain_agentx_cli |
import for use as library |
Design Docs
- Tool naming SSOT — RuntimeTool.name、GrantScope、MemoryToolKind 边界
- Implementation Plans
历史:D01 user_message(BriefTool 已移除,仅作归档)
License
Apache License 2.0
Metadata
Release files for langchain-agentx-cli 0.8.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_agentx_cli-0.8.9.tar.gz | 402.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_agentx_cli-0.8.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 974.1 kB
Release files / langchain_agentx_cli-0.8.9.tar.gz
| Download URL | langchain_agentx_cli-0.8.9.tar.gz |
|---|---|
| Size | 402.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcae93433c4b303dfc51d424b995bf7c14ff835cc215676fc41ec90d6a14d4d6
|
|
BLAKE2b-256 checksum How to use checksums |
593a9a35e0043b33153f09268e73a915f7c7d2635df121c2d8215be9fea3bd9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.6
|
Release files / langchain_agentx_cli-0.8.9-py3-none-any.whl
| Download URL | langchain_agentx_cli-0.8.9-py3-none-any.whl |
|---|---|
| Size | 572.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a66795ba4cb15c7b9bd44f92e996c5ccf66206e26589ecc81eeacca6af259f5
|
|
BLAKE2b-256 checksum How to use checksums |
4252d63ef83b3084f41d1c491e33f7123757c089d6e7dd4e52afd2791e87ae75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.6
|