agentcli
AGENTS.md12 starsChanged 10 days agoApache-2.0View on GitHub
uag is a local tool-execution agent written in Python. It runs shell commands, edits files, and interacts with LLMs through multiple providers (OpenAI, Claude, Gemini, DeepSeek, Ollama, OpenRouter, etc.). - Python 3.11+ required. Check with python --version. - Node.js v24.18.0 required for locale tooling. - Runtime dependencies are declared as optional extras and are auto-installed when missing. For a full development environment use: pip install -e ".[core,providers,tools,development,platform,web,test]". - requirements.txt is the convenience entry point for the full environment. - Work…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- batch-state-runbookSkill
- browser4-cliSkill
- create-toolSkill
- dummy-weatherSkill
- jp-postageSkill
- prompt-librarySkill
- pypi-upload-distSkill
- python-idiomsSkill
- sample-skillSkill
- vup-build-release-whlSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Create provider client from environment variables
- Distinctive: line 56
Use VSCode for editing. The workspace is at the project root.
- Very specific: line 59
Run python -m uagent to start the CLI and test changes interactively.
- Distinctive: line 107
Do not rely on an unpinned globally installed Black/Ruff version.
- Distinctive: line 116
After changing tools, startup, or MCP behavior, run the affected path end-to-end.
- Distinctive: line 120
Write every commit message in English.
- Very specific: line 121
Use a concise Conventional Commits-style subject when practical, for example feat: add infinite mode to auto command or fix: preserve …
- Distinctive: line 123
Keep each commit focused on one completed work item.
- Very specific: line 130
Keep DEVELOP.md in sync with implementation changes.
- Distinctive: line 132
Prefer CLI arguments over environment variables for configuration.
- Very specific: line 133
All entry points (CLI/GUI/Web/A2A) should share consistent behavior.
- Very specific: line 142
Responses API + GPT-5.4+ (OpenAI/Azure): All tools are sent to the server (server-side tool_search).
- Very specific: line 164
Placeholders: Use %(name)s format in both systems
- Distinctive: line 169
Run the applicable checks above before submitting.
- Very specific: line 170
If adding a new LLM provider, update: provider_caps.py (add to ALL_PROVIDERS), setup_cli.py, util_providers.py, llm_round_helpers.py, …
- Very specific: line 171
If adding a CLI option, ensure it works across all entry points (CLI/GUI/Web/A2A).
- Very specific: line 172
Update DEVELOP.md and any relevant docs under src/uagent/docs/.
- Distinctive: line 174
Test the affected flow end-to-end.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
uag is a local tool-execution agent written in Python. It runs shell commands, edits files, and interacts with LLMs through multiple providers (OpenAI, Claude, Gemini, DeepSeek, Ollama, OpenRouter, etc.).
Project structure
src/uagent/— main Python packagecli.py— CLI entry point (python -m uagent, command:uag)gui.py— GUI entry point (python -m uagent.gui, command:uagg)web.py— Web entry point (python -m uagent.web, command:uagw)core.py— core state and UI integrationuagent_llm.py— LLM orchestration entrypointllm_helpers.py,llm_message_helpers.py,llm_round_helpers.py,llm_flow_helpers.py— round/message/tool-call helpersllm_errors.py— retry/backoffutil_tools.py— common helpers, commands (:auto,:cd,:ls, etc.)util_providers.py— provider wiring (detect, model name, client creation)tools/— tool plugin modules (one file per tool)providers/— LLM provider implementationsruntime/— startup initialization, workdir, banner, env, memorya2a/— A2A server implementationdocs/— developer documentation (DEVELOP.md, DEVELOP_TOOL.md, DEVELOP_I18N.md, etc.)
scripts/— utility scripts (compile_locales.py, po_qc_summary.py)pyproject.toml— project metadata and dependenciesREADME.md,README.ja.md,README_AUTO.md— user-facing documentation
Entry points
| Command | Description |
python -m uagent (or uag) | Interactive CLI |
python -m uagent.gui (or uagg) | GUI mode |
python -m uagent.web (or uagw) | Web UI |
python -m uagent.a2a.server | A2A server (default port 8765) |
Startup flow
- Decide workdir (
--workdir/-C>UAGENT_WORKDIR> current dir) - Load
.envand.env.sec(decrypted with.uagent.key) - Build and print startup banner
- Load tool plugins from
src/uagent/tools/ - Create provider client from environment variables
- Enter UI loop (CLI/GUI/Web) and receive user input
- LLM rounds via
uagent_llm.run_llm_rounds()
Dev environment tips
- Python 3.11+ required. Check with
python --version. - Node.js v24.18.0 required for locale tooling.
- Runtime dependencies are declared as optional extras and are auto-installed when
missing. For a full development environment use:
pip install -e ".[core,providers,tools,development,platform,web,test]". requirements.txtis the convenience entry point for the full environment.- Work in the project root (
C:\KAIHATSU\agentclion the primary dev machine). - Use VSCode for editing. The workspace is at the project root.
- Environment variables prefixed with
UAGENT_configure behavior. - Sensitive config goes into
.env.sec(encrypted with.uagent.key). - Run
python -m uagentto start the CLI and test changes interactively.
Supported providers
| Provider key | Name |
openai | OpenAI-compatible |
pfn | PFN (Preferred Networks / PLaMo) OpenAI-compatible Chat Completions |
azure | Azure OpenAI |
bedrock | Bedrock OpenAI-compatible gateway |
openrouter | OpenRouter |
perplexity | Perplexity Router API (Chat Completions / Responses) |
gemini | Gemini |
vertexai | Vertex AI |
grok | Grok |
claude | Claude |
ollama | Ollama |
vllm | vLLM OpenAI-compatible server |
nvidia | NVIDIA |
deepseek | DeepSeek |
zai | Z.AI (Zhipu AI) |
alibaba | Alibaba Cloud (Qwen) |
moonshot | Moonshot AI |
mimo | Xiaomi MiMo |
lmstudio | LM Studio |
minimax | MiniMax |
hf | HuggingFace |
sakana | Sakana AI (Fugu) |
sakura | SAKURA AI Engine |
sarashina | Sarashina AI (SB Intuitions) |
novita | Novita AI |
together | Together AI |
vercel | Vercel AI Gateway |
Commands to run before committing
Choose checks according to the change. Documentation-only edits need Markdown
formatting and git diff --check, not Python lint or pytest. During code iteration,
run the affected tests; run the full suite once for the final code revision before
submission, rather than repeating it for every intermediate edit. For CI-only
changes, validate workflow syntax and changed routing behavior; the PR CI runs the
Python checks. Prompt/skill Markdown and test fixtures are not documentation-only.
- Python syntax:
python -m py_compile src/uagent/(catches import/syntax errors). - Format/lint: install the pinned toolchain with
pip install -e ".[quality]". For Python edits, runpython -m black <changed-python-files>before committing, then verify withpython -m ruff check src testsandpython -m black --check src tests. Do not rely on an unpinned globally installed Black/Ruff version. - Locale compile:
python scripts/compile_locales.py(after editing .po files). - Locale QC:
python scripts/po_qc_summary.py(check translation quality). - Targeted tests:
pytest -q tests/<affected_area>. - CI-equivalent test run: for the final code revision, after
pip install -r requirements.txt, runpython -m pytest -q . --durations=30. - Tool catalogs:
python scripts/tool_json_i18n_batch.py statusand validate each tool-side translation JSON withscripts/i18n_validate.py. English lives in Pythondefault=values; tool JSON must not contain anenblock. - After changing tools, startup, or MCP behavior, run the affected path end-to-end.
Git commit convention
- Write every commit message in English.
- Use a concise Conventional Commits-style subject when practical, for example
feat: add infinite mode to auto commandorfix: preserve locale in background tasks. - Complete the work in this order: implement, run the relevant tests and checks, review the diff, then commit.
- Keep each commit focused on one completed work item.
Coding conventions
- New tools go in
src/uagent/tools/<name>_tool.pywithTOOL_SPECdict and arun_tool()function. - CLI subcommands are registered via
CMD_SPECdicts (command + subcommand + handler). - i18n: use
_("msgid", default="English text")viamake_tool_translator(__file__). - Keep
DEVELOP.mdin sync with implementation changes. - Backup files (
.org,.org1,.org2) must not be edited directly. - Prefer CLI arguments over environment variables for configuration.
- All entry points (CLI/GUI/Web/A2A) should share consistent behavior.
- File creation: output full file contents, not diffs or partial summaries.
- Dangerous operations require user confirmation before execution.
Tool flow
Tools are delivered to the LLM differently depending on the provider and mode:
- Chat Completions API (DeepSeek, etc.): Tools start with a small set and discover additional tools dynamically. The LLM discovers additional tools dynamically via
tool_catalog→tool_load. Seesrc/uagent/docs/TOOL_FLOW.md. - Responses API + GPT-5.4+ (OpenAI/Azure): All tools are sent to the server (server-side
tool_search). Server-side compaction is applied automatically. UAGENT_GPT54_TOOL_SEARCH=legacy: Client-side narrowing viatool_catalog. Only management tools sent initially.- Auto-unload: Skipped when
previous_response_idis set.
Tool system
- Tools are plugin modules under
src/uagent/tools/. - Each tool exports
TOOL_SPEC(OpenAI function schema compatible) andrun_tool(args) -> str. - Tool genres:
basic,comm,office,devel,dev,iot,exec,external,media,file,index,web,utility. - Genre names are descriptive metadata only; use
tool_catalog/tool_loador--enable-toolto select individual tools. - Tool-less mode:
--no-use-toolorUAGENT_USE_TOOL=0or:tools off. - Skills: installed via
:skills installor APM (:skills apm use). - MCP servers: defined in
mcp_servers.json, managed viamcp_servers/mcp_tools_list/handle_mcp_v2tools.
i18n (internationalization)
See the unified guide at src/uagent/docs/DEVELOP_I18N.md for complete documentation covering both host-side (gettext .po/.mo) and tool-side (JSON key-based) i18n.
Key points:
- Host side:
from .i18n import _— gettext with.po/.mofiles insrc/uagent/locales/ - Tool side:
_ = make_tool_translator(__file__)— JSON key-value insrc/uagent/tools/*_tool.json - Placeholders: Use
%(name)sformat in both systems - Workflow scripts:
scripts/compile_locales.py,scripts/po_rebuild_en.py,scripts/po_rebuild_non_en.py,scripts/po_qc_summary.py,scripts/i18n_tools_check.py
PR instructions
- Run the applicable checks above before submitting.
- If adding a new LLM provider, update:
provider_caps.py(add toALL_PROVIDERS),setup_cli.py,util_providers.py,llm_round_helpers.py,runtime_banner.py.detect_provider()andenv_validate.pyvalidation are centralised viaprovider_caps.ALL_PROVIDERS. - If adding a CLI option, ensure it works across all entry points (CLI/GUI/Web/A2A).
- Update
DEVELOP.mdand any relevant docs undersrc/uagent/docs/. - For i18n changes, run
python scripts/compile_locales.pyandpython scripts/po_qc_summary.py. - Test the affected flow end-to-end.
Repository ontology
- Repository ontology (JSON-LD) — generated by
code_map.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

