agentleFS
awaku7awaku7/agentcli/AGENTS.md

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

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
  1. Distinctive:

    Create provider client from environment variables

    line 43
  2. Distinctive:

    Use VSCode for editing. The workspace is at the project root.

    line 56
  3. Very specific:

    Run python -m uagent to start the CLI and test changes interactively.

    line 59
  4. Distinctive:

    Do not rely on an unpinned globally installed Black/Ruff version.

    line 107
  5. Distinctive:

    After changing tools, startup, or MCP behavior, run the affected path end-to-end.

    line 116
  6. Distinctive:

    Write every commit message in English.

    line 120
  7. Very specific:

    Use a concise Conventional Commits-style subject when practical, for example feat: add infinite mode to auto command or fix: preserve …

    line 121
  8. Distinctive:

    Keep each commit focused on one completed work item.

    line 123
  9. Very specific:

    Keep DEVELOP.md in sync with implementation changes.

    line 130
  10. Distinctive:

    Prefer CLI arguments over environment variables for configuration.

    line 132
  11. Very specific:

    All entry points (CLI/GUI/Web/A2A) should share consistent behavior.

    line 133
  12. Very specific:

    Responses API + GPT-5.4+ (OpenAI/Azure): All tools are sent to the server (server-side tool_search).

    line 142
  13. Very specific:

    Placeholders: Use %(name)s format in both systems

    line 164
  14. Distinctive:

    Run the applicable checks above before submitting.

    line 169
  15. Very specific:

    If adding a new LLM provider, update: provider_caps.py (add to ALL_PROVIDERS), setup_cli.py, util_providers.py, llm_round_helpers.py, …

    line 170
  16. Very specific:

    If adding a CLI option, ensure it works across all entry points (CLI/GUI/Web/A2A).

    line 171
  17. Very specific:

    Update DEVELOP.md and any relevant docs under src/uagent/docs/.

    line 172
  18. Distinctive:

    Test the affected flow end-to-end.

    line 174

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 package
    • cli.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 integration
    • uagent_llm.py — LLM orchestration entrypoint
    • llm_helpers.py, llm_message_helpers.py, llm_round_helpers.py, llm_flow_helpers.py — round/message/tool-call helpers
    • llm_errors.py — retry/backoff
    • util_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 implementations
    • runtime/ — startup initialization, workdir, banner, env, memory
    • a2a/ — A2A server implementation
    • docs/ — 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 dependencies
  • README.md, README.ja.md, README_AUTO.md — user-facing documentation

Entry points

CommandDescription
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.serverA2A server (default port 8765)

Startup flow

  1. Decide workdir (--workdir / -C > UAGENT_WORKDIR > current dir)
  2. Load .env and .env.sec (decrypted with .uagent.key)
  3. Build and print startup banner
  4. Load tool plugins from src/uagent/tools/
  5. Create provider client from environment variables
  6. Enter UI loop (CLI/GUI/Web) and receive user input
  7. 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.txt is the convenience entry point for the full environment.
  • Work in the project root (C:\KAIHATSU\agentcli on 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 uagent to start the CLI and test changes interactively.

Supported providers

Provider keyName
openaiOpenAI-compatible
pfnPFN (Preferred Networks / PLaMo) OpenAI-compatible Chat Completions
azureAzure OpenAI
bedrockBedrock OpenAI-compatible gateway
openrouterOpenRouter
perplexityPerplexity Router API (Chat Completions / Responses)
geminiGemini
vertexaiVertex AI
grokGrok
claudeClaude
ollamaOllama
vllmvLLM OpenAI-compatible server
nvidiaNVIDIA
deepseekDeepSeek
zaiZ.AI (Zhipu AI)
alibabaAlibaba Cloud (Qwen)
moonshotMoonshot AI
mimoXiaomi MiMo
lmstudioLM Studio
minimaxMiniMax
hfHuggingFace
sakanaSakana AI (Fugu)
sakuraSAKURA AI Engine
sarashinaSarashina AI (SB Intuitions)
novitaNovita AI
togetherTogether AI
vercelVercel 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, run python -m black <changed-python-files> before committing, then verify with python -m ruff check src tests and python -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, run python -m pytest -q . --durations=30.
  • Tool catalogs: python scripts/tool_json_i18n_batch.py status and validate each tool-side translation JSON with scripts/i18n_validate.py. English lives in Python default= values; tool JSON must not contain an en block.
  • 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 command or fix: 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.py with TOOL_SPEC dict and a run_tool() function.
  • CLI subcommands are registered via CMD_SPEC dicts (command + subcommand + handler).
  • i18n: use _("msgid", default="English text") via make_tool_translator(__file__).
  • Keep DEVELOP.md in 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. See src/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 via tool_catalog. Only management tools sent initially.
  • Auto-unload: Skipped when previous_response_id is set.

Tool system

  • Tools are plugin modules under src/uagent/tools/.
  • Each tool exports TOOL_SPEC (OpenAI function schema compatible) and run_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_load or --enable-tool to select individual tools.
  • Tool-less mode: --no-use-tool or UAGENT_USE_TOOL=0 or :tools off.
  • Skills: installed via :skills install or APM (:skills apm use).
  • MCP servers: defined in mcp_servers.json, managed via mcp_servers / mcp_tools_list / handle_mcp_v2 tools.

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/.mo files in src/uagent/locales/
  • Tool side: _ = make_tool_translator(__file__) — JSON key-value in src/uagent/tools/*_tool.json
  • Placeholders: Use %(name)s format 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 to ALL_PROVIDERS), setup_cli.py, util_providers.py, llm_round_helpers.py, runtime_banner.py. detect_provider() and env_validate.py validation are centralised via provider_caps.ALL_PROVIDERS.
  • If adding a CLI option, ensure it works across all entry points (CLI/GUI/Web/A2A).
  • Update DEVELOP.md and any relevant docs under src/uagent/docs/.
  • For i18n changes, run python scripts/compile_locales.py and python scripts/po_qc_summary.py.
  • Test the affected flow end-to-end.

Repository ontology

  • Repository ontology (JSON-LD) — generated by code_map.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.