fr-cli 2.5.0__tar.gz → 2.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fr_cli-2.7.0/PKG-INFO +918 -0
- fr_cli-2.7.0/README.md +843 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/__init__.py +1 -1
- fr_cli-2.7.0/fr_cli/agent/artifact_detector.py +153 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/rag.py +150 -180
- fr_cli-2.7.0/fr_cli/agent/builtins/rag_watcher.py +198 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/__init__.py +14 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/analyzer.py +157 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/crawler.py +220 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/deps.py +82 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/evasion.py +231 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/fetcher.py +255 -0
- fr_cli-2.7.0/fr_cli/agent/builtins/spider/memory.py +83 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/executor.py +38 -1
- fr_cli-2.7.0/fr_cli/agent/hermes/__init__.py +64 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/engine.py +64 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/engine_core.py +54 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/engine_daemon.py +43 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/engine_execution.py +226 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/engine_tasks.py +247 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/managers.py +251 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/models.py +141 -0
- fr_cli-2.7.0/fr_cli/agent/hermes/scheduler.py +47 -0
- fr_cli-2.7.0/fr_cli/agent/hermes_daemon.py +449 -0
- fr_cli-2.7.0/fr_cli/agent/hermes_daemon_process.py +125 -0
- fr_cli-2.7.0/fr_cli/agent/hermes_manager.py +199 -0
- fr_cli-2.7.0/fr_cli/agent/hooks.py +382 -0
- fr_cli-2.7.0/fr_cli/agent/master.py +108 -0
- fr_cli-2.7.0/fr_cli/agent/master_loop.py +269 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/master_prompt.py +7 -2
- fr_cli-2.7.0/fr_cli/agent/master_prompt_builder.py +131 -0
- fr_cli-2.7.0/fr_cli/agent/master_reflect.py +177 -0
- fr_cli-2.7.0/fr_cli/agent/master_storage.py +185 -0
- fr_cli-2.7.0/fr_cli/agent/project_memory.py +143 -0
- fr_cli-2.7.0/fr_cli/agent/review_queue.py +136 -0
- fr_cli-2.7.0/fr_cli/agent/shell_mode.py +52 -0
- fr_cli-2.7.0/fr_cli/agent/skills.py +263 -0
- fr_cli-2.7.0/fr_cli/agent/voice.py +187 -0
- fr_cli-2.7.0/fr_cli/command/cmd_parser.py +333 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/executor.py +96 -0
- fr_cli-2.7.0/fr_cli/command/parallel.py +251 -0
- fr_cli-2.7.0/fr_cli/command/registered/bookmark.py +206 -0
- fr_cli-2.7.0/fr_cli/command/registered/console.py +71 -0
- fr_cli-2.7.0/fr_cli/command/registered/crypto.py +104 -0
- fr_cli-2.7.0/fr_cli/command/registered/defi.py +112 -0
- fr_cli-2.7.0/fr_cli/command/registered/dynamic_build.py +133 -0
- fr_cli-2.7.0/fr_cli/command/registered/export_html.py +57 -0
- fr_cli-2.7.0/fr_cli/command/registered/export_ppt.py +88 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/fs.py +85 -0
- fr_cli-2.7.0/fr_cli/command/registered/git_tools.py +173 -0
- fr_cli-2.7.0/fr_cli/command/registered/local_tts.py +125 -0
- fr_cli-2.7.0/fr_cli/command/registered/ollama.py +130 -0
- fr_cli-2.7.0/fr_cli/command/registered/plan_mode.py +37 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/session_config.py +0 -1
- fr_cli-2.7.0/fr_cli/command/registered/skill_gist.py +105 -0
- fr_cli-2.7.0/fr_cli/command/registered/swarm_worktree.py +138 -0
- fr_cli-2.7.0/fr_cli/command/registered/task_tools.py +168 -0
- fr_cli-2.7.0/fr_cli/command/registered/voice.py +60 -0
- fr_cli-2.7.0/fr_cli/command/registered/voice_input.py +117 -0
- fr_cli-2.7.0/fr_cli/command/registered/worktree.py +107 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registry.py +21 -171
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/security.py +40 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/conf/config.py +96 -88
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/conf/default_models.yaml +94 -20
- fr_cli-2.7.0/fr_cli/conf/model_wizard.py +344 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/conf/paths.py +13 -0
- fr_cli-2.7.0/fr_cli/core/ai_intent.py +174 -0
- fr_cli-2.7.0/fr_cli/core/app_state.py +53 -0
- fr_cli-2.7.0/fr_cli/core/app_state_client.py +109 -0
- fr_cli-2.7.0/fr_cli/core/app_state_config.py +144 -0
- fr_cli-2.7.0/fr_cli/core/app_state_core.py +205 -0
- fr_cli-2.7.0/fr_cli/core/app_state_services.py +102 -0
- fr_cli-2.7.0/fr_cli/core/app_state_status.py +152 -0
- fr_cli-2.7.0/fr_cli/core/chat/__init__.py +16 -0
- fr_cli-2.7.0/fr_cli/core/chat/helpers.py +114 -0
- fr_cli-2.7.0/fr_cli/core/chat/pipeline.py +488 -0
- fr_cli-2.7.0/fr_cli/core/chat/plan_mode.py +108 -0
- fr_cli-2.7.0/fr_cli/core/chat.py +12 -0
- fr_cli-2.7.0/fr_cli/core/core.py +18 -0
- fr_cli-2.7.0/fr_cli/core/error_ledger.py +175 -0
- fr_cli-2.7.0/fr_cli/core/errors.py +129 -0
- fr_cli-2.7.0/fr_cli/core/events.py +189 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/intent.py +7 -3
- fr_cli-2.7.0/fr_cli/core/llm/__init__.py +349 -0
- fr_cli-2.7.0/fr_cli/core/llm/anthropic_compat.py +131 -0
- fr_cli-2.7.0/fr_cli/core/llm/base.py +34 -0
- fr_cli-2.7.0/fr_cli/core/llm/mock.py +68 -0
- fr_cli-2.7.0/fr_cli/core/llm/openai_compat.py +30 -0
- fr_cli-2.7.0/fr_cli/core/llm/wenxin.py +75 -0
- fr_cli-2.7.0/fr_cli/core/llm/zhipu.py +24 -0
- fr_cli-2.7.0/fr_cli/core/metrics/__init__.py +92 -0
- fr_cli-2.7.0/fr_cli/core/metrics/plugin.py +485 -0
- fr_cli-2.7.0/fr_cli/core/plan/__init__.py +50 -0
- fr_cli-2.7.0/fr_cli/core/plan/executor.py +182 -0
- fr_cli-2.7.0/fr_cli/core/plan/generator.py +158 -0
- fr_cli-2.7.0/fr_cli/core/plan/prompts.py +102 -0
- fr_cli-2.7.0/fr_cli/core/plan/storage.py +61 -0
- fr_cli-2.7.0/fr_cli/core/plan_mode.py +256 -0
- fr_cli-2.7.0/fr_cli/core/plan_ui.py +336 -0
- fr_cli-2.7.0/fr_cli/core/plan_undo.py +173 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/usage.py +84 -0
- fr_cli-2.7.0/fr_cli/dynamic_builder/gap_analyzer.py +161 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/planner.py +2 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/registry_manager.py +18 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/runner.py +20 -5
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/lang/translations/en.py +117 -8
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/lang/translations/zh.py +117 -8
- fr_cli-2.7.0/fr_cli/memory/compress.py +160 -0
- fr_cli-2.7.0/fr_cli/memory/incremental.py +265 -0
- fr_cli-2.7.0/fr_cli/memory/resume.py +138 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/bootstrap.py +84 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/__init__.py +2 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/_common.py +68 -33
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/base.py +15 -85
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/build.py +21 -1
- fr_cli-2.7.0/fr_cli/repl/commands/config/__init__.py +22 -0
- fr_cli-2.7.0/fr_cli/repl/commands/config/key.py +167 -0
- fr_cli-2.7.0/fr_cli/repl/commands/config/misc.py +106 -0
- fr_cli-2.7.0/fr_cli/repl/commands/config/model.py +142 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/__init__.py +42 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/autostart.py +52 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/context.py +80 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/hermes_cmd.py +213 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/launcher.py +39 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/server.py +61 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/setup.py +15 -0
- fr_cli-2.7.0/fr_cli/repl/commands/system/status.py +89 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/router.py +11 -0
- fr_cli-2.7.0/fr_cli/security/permissions.py +169 -0
- fr_cli-2.7.0/fr_cli/security/policy.py +60 -0
- fr_cli-2.7.0/fr_cli/ui/diff_view.py +345 -0
- fr_cli-2.7.0/fr_cli/ui/markdown_stream.py +245 -0
- fr_cli-2.7.0/fr_cli/ui/prompt/__init__.py +39 -0
- fr_cli-2.7.0/fr_cli/ui/prompt/completer.py +359 -0
- fr_cli-2.7.0/fr_cli/ui/prompt/fallback.py +89 -0
- fr_cli-2.7.0/fr_cli/ui/prompt/status.py +80 -0
- fr_cli-2.7.0/fr_cli/ui/prompt/tui.py +383 -0
- fr_cli-2.7.0/fr_cli/v3/__init__.py +79 -0
- fr_cli-2.7.0/fr_cli/v3/compat/__init__.py +27 -0
- fr_cli-2.7.0/fr_cli/v3/core/__init__.py +8 -0
- fr_cli-2.7.0/fr_cli/v3/core/builtin_plugins.py +89 -0
- fr_cli-2.7.0/fr_cli/v3/core/container.py +265 -0
- fr_cli-2.7.0/fr_cli/v3/core/errors.py +219 -0
- fr_cli-2.7.0/fr_cli/v3/core/events.py +289 -0
- fr_cli-2.7.0/fr_cli/v3/core/lifecycle.py +211 -0
- fr_cli-2.7.0/fr_cli/v3/core/pipeline.py +204 -0
- fr_cli-2.7.0/fr_cli/v3/core/plugin.py +314 -0
- fr_cli-2.7.0/fr_cli/v3/core/provider.py +257 -0
- fr_cli-2.7.0/fr_cli/v3/examples/hello_plugin.py +66 -0
- fr_cli-2.7.0/fr_cli/weapon/bookmark.py +336 -0
- fr_cli-2.7.0/fr_cli/weapon/bookmark_rag.py +92 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/cron.py +1 -1
- fr_cli-2.7.0/fr_cli/weapon/crypto.py +379 -0
- fr_cli-2.7.0/fr_cli/weapon/defi.py +477 -0
- fr_cli-2.7.0/fr_cli/weapon/git_tools.py +218 -0
- fr_cli-2.7.0/fr_cli/weapon/local_tts.py +300 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/__init__.py +47 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager.py +82 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_core.py +117 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_invocation.py +107 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_prompts.py +198 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_resources.py +189 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_servers.py +67 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/manager_tools.py +155 -0
- fr_cli-2.7.0/fr_cli/weapon/mcp/models.py +68 -0
- fr_cli-2.7.0/fr_cli/weapon/ollama.py +208 -0
- fr_cli-2.7.0/fr_cli/weapon/session_html.py +151 -0
- fr_cli-2.7.0/fr_cli/weapon/session_html_md.py +84 -0
- fr_cli-2.7.0/fr_cli/weapon/session_html_render.py +105 -0
- fr_cli-2.7.0/fr_cli/weapon/session_html_styles.py +176 -0
- fr_cli-2.7.0/fr_cli/weapon/session_to_ppt.py +341 -0
- fr_cli-2.7.0/fr_cli/weapon/skill_gist.py +307 -0
- fr_cli-2.7.0/fr_cli/weapon/voice_input.py +193 -0
- fr_cli-2.7.0/fr_cli/weapon/worktree.py +215 -0
- fr_cli-2.7.0/fr_cli/weapon/worktree_cleanup.py +277 -0
- fr_cli-2.7.0/fr_cli/weapon/worktree_group.py +288 -0
- fr_cli-2.7.0/fr_cli/web/__init__.py +0 -0
- fr_cli-2.7.0/fr_cli/web/console/__init__.py +104 -0
- fr_cli-2.7.0/fr_cli/web/console/api_queries.py +167 -0
- fr_cli-2.7.0/fr_cli/web/console/events.py +140 -0
- fr_cli-2.7.0/fr_cli/web/console/handler.py +290 -0
- fr_cli-2.7.0/fr_cli/web/console/lifecycle.py +161 -0
- fr_cli-2.7.0/fr_cli/web/console/templates.py +298 -0
- fr_cli-2.7.0/fr_cli.egg-info/PKG-INFO +918 -0
- fr_cli-2.7.0/fr_cli.egg-info/SOURCES.txt +393 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/pyproject.toml +6 -2
- fr_cli-2.7.0/tests/test_ai_intent.py +113 -0
- fr_cli-2.7.0/tests/test_artifact_detector.py +47 -0
- fr_cli-2.7.0/tests/test_bookmark.py +239 -0
- fr_cli-2.7.0/tests/test_charts.py +116 -0
- fr_cli-2.7.0/tests/test_console.py +177 -0
- fr_cli-2.7.0/tests/test_console_event_bridge.py +275 -0
- fr_cli-2.7.0/tests/test_console_sse.py +199 -0
- fr_cli-2.7.0/tests/test_context.py +145 -0
- fr_cli-2.7.0/tests/test_context_compress.py +145 -0
- fr_cli-2.7.0/tests/test_cron.py +171 -0
- fr_cli-2.7.0/tests/test_crypto.py +259 -0
- fr_cli-2.7.0/tests/test_dataframe.py +165 -0
- fr_cli-2.7.0/tests/test_defi.py +213 -0
- fr_cli-2.7.0/tests/test_defi_chart.py +104 -0
- fr_cli-2.7.0/tests/test_diff_view.py +137 -0
- fr_cli-2.7.0/tests/test_dynamic_builder.py +287 -0
- fr_cli-2.7.0/tests/test_dynamic_builder_selftest.py +89 -0
- fr_cli-2.7.0/tests/test_event_auto_record.py +353 -0
- fr_cli-2.7.0/tests/test_events_dispatch.py +300 -0
- fr_cli-2.7.0/tests/test_events_integration.py +174 -0
- fr_cli-2.7.0/tests/test_fs.py +257 -0
- fr_cli-2.7.0/tests/test_gap_analyzer.py +109 -0
- fr_cli-2.7.0/tests/test_git_tools.py +270 -0
- fr_cli-2.7.0/tests/test_hermes.py +322 -0
- fr_cli-2.7.0/tests/test_hermes_daemon.py +189 -0
- fr_cli-2.7.0/tests/test_hermes_demo.py +147 -0
- fr_cli-2.7.0/tests/test_hermes_manager.py +65 -0
- fr_cli-2.7.0/tests/test_hermes_memory.py +94 -0
- fr_cli-2.7.0/tests/test_hermes_subtasks.py +179 -0
- fr_cli-2.7.0/tests/test_history.py +155 -0
- fr_cli-2.7.0/tests/test_hooks.py +333 -0
- fr_cli-2.7.0/tests/test_i18n.py +128 -0
- fr_cli-2.7.0/tests/test_incremental.py +130 -0
- fr_cli-2.7.0/tests/test_launch_flow.py +680 -0
- fr_cli-2.7.0/tests/test_local_tts.py +191 -0
- fr_cli-2.7.0/tests/test_markdown_stream.py +148 -0
- fr_cli-2.7.0/tests/test_master_evolution.py +126 -0
- fr_cli-2.7.0/tests/test_mcp.py +625 -0
- fr_cli-2.7.0/tests/test_mcp_prompts.py +76 -0
- fr_cli-2.7.0/tests/test_mcp_resources.py +82 -0
- fr_cli-2.7.0/tests/test_mcp_streamable.py +95 -0
- fr_cli-2.7.0/tests/test_metrics_plugin.py +393 -0
- fr_cli-2.7.0/tests/test_multi_edit.py +193 -0
- fr_cli-2.7.0/tests/test_network.py +124 -0
- fr_cli-2.7.0/tests/test_ocr.py +367 -0
- fr_cli-2.7.0/tests/test_ollama.py +121 -0
- fr_cli-2.7.0/tests/test_parallel.py +142 -0
- fr_cli-2.7.0/tests/test_permissions.py +202 -0
- fr_cli-2.7.0/tests/test_plan.py +302 -0
- fr_cli-2.7.0/tests/test_plan_mode.py +213 -0
- fr_cli-2.7.0/tests/test_plan_ui.py +150 -0
- fr_cli-2.7.0/tests/test_plan_undo.py +120 -0
- fr_cli-2.7.0/tests/test_project_memory.py +190 -0
- fr_cli-2.7.0/tests/test_rag.py +481 -0
- fr_cli-2.7.0/tests/test_rag_cache.py +84 -0
- fr_cli-2.7.0/tests/test_rag_persistent.py +91 -0
- fr_cli-2.7.0/tests/test_recommender.py +145 -0
- fr_cli-2.7.0/tests/test_remote.py +229 -0
- fr_cli-2.7.0/tests/test_repl_autostart.py +63 -0
- fr_cli-2.7.0/tests/test_repl_status.py +68 -0
- fr_cli-2.7.0/tests/test_result.py +137 -0
- fr_cli-2.7.0/tests/test_resume.py +149 -0
- fr_cli-2.7.0/tests/test_review_queue.py +64 -0
- fr_cli-2.7.0/tests/test_security.py +171 -0
- fr_cli-2.7.0/tests/test_security_autonomous.py +129 -0
- fr_cli-2.7.0/tests/test_session_html.py +134 -0
- fr_cli-2.7.0/tests/test_session_ppt.py +205 -0
- fr_cli-2.7.0/tests/test_skill_gist.py +194 -0
- fr_cli-2.7.0/tests/test_skills.py +313 -0
- fr_cli-2.7.0/tests/test_spider.py +325 -0
- fr_cli-2.7.0/tests/test_store.py +169 -0
- fr_cli-2.7.0/tests/test_thinking.py +127 -0
- fr_cli-2.7.0/tests/test_tts_stream.py +93 -0
- fr_cli-2.7.0/tests/test_usage.py +145 -0
- fr_cli-2.7.0/tests/test_v3_container.py +152 -0
- fr_cli-2.7.0/tests/test_v3_events.py +180 -0
- fr_cli-2.7.0/tests/test_v3_lifecycle.py +210 -0
- fr_cli-2.7.0/tests/test_v3_provider_plugin.py +403 -0
- fr_cli-2.7.0/tests/test_voice.py +174 -0
- fr_cli-2.7.0/tests/test_voice_input.py +88 -0
- fr_cli-2.7.0/tests/test_web.py +124 -0
- fr_cli-2.7.0/tests/test_worktree.py +146 -0
- fr_cli-2.7.0/tests/test_worktree_cleanup.py +177 -0
- fr_cli-2.7.0/tests/test_worktree_group.py +192 -0
- fr_cli-2.5.0/PKG-INFO +0 -502
- fr_cli-2.5.0/README.md +0 -427
- fr_cli-2.5.0/fr_cli/agent/artifact_detector.py +0 -105
- fr_cli-2.5.0/fr_cli/agent/builtins/spider.py +0 -952
- fr_cli-2.5.0/fr_cli/agent/hermes.py +0 -344
- fr_cli-2.5.0/fr_cli/agent/hermes_daemon.py +0 -264
- fr_cli-2.5.0/fr_cli/agent/master.py +0 -587
- fr_cli-2.5.0/fr_cli/agent/personality.py +0 -237
- fr_cli-2.5.0/fr_cli/agent/shell_mode.py +0 -178
- fr_cli-2.5.0/fr_cli/agent/skills.py +0 -227
- fr_cli-2.5.0/fr_cli/command/registered/dynamic_build.py +0 -51
- fr_cli-2.5.0/fr_cli/core/chat.py +0 -418
- fr_cli-2.5.0/fr_cli/core/core.py +0 -329
- fr_cli-2.5.0/fr_cli/core/errors.py +0 -199
- fr_cli-2.5.0/fr_cli/core/llm.py +0 -403
- fr_cli-2.5.0/fr_cli/core/plan.py +0 -488
- fr_cli-2.5.0/fr_cli/repl/commands/config.py +0 -525
- fr_cli-2.5.0/fr_cli/repl/commands.py +0 -43
- fr_cli-2.5.0/fr_cli/ui/prompt.py +0 -886
- fr_cli-2.5.0/fr_cli/ui/splash.py +0 -339
- fr_cli-2.5.0/fr_cli/ui/web_config.py +0 -238
- fr_cli-2.5.0/fr_cli/weapon/mcp.py +0 -354
- fr_cli-2.5.0/fr_cli.egg-info/PKG-INFO +0 -502
- fr_cli-2.5.0/fr_cli.egg-info/SOURCES.txt +0 -181
- fr_cli-2.5.0/tests/test_charts.py +0 -139
- fr_cli-2.5.0/tests/test_dynamic_builder.py +0 -184
- fr_cli-2.5.0/tests/test_ocr.py +0 -224
- fr_cli-2.5.0/tests/test_plan.py +0 -298
- fr_cli-2.5.0/tests/test_result.py +0 -37
- fr_cli-2.5.0/tests/test_security.py +0 -206
- fr_cli-2.5.0/tests/test_usage.py +0 -87
- {fr_cli-2.5.0 → fr_cli-2.7.0}/LICENSE +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/MANIFEST.in +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/README.md +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/WEAPON.MD +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/addon/plugin.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/_utils.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/db.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/local.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/rag_watcher_daemon.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/remote.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/builtins/stock.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/client.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/dispatch.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/generator.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/manager.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/remote.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/server.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/swarm.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/swarm_resolver.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/agent/workflow.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/assets/splash.jpeg +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/breakthrough/update.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/agent_data_mcp.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/charts.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/image.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/main_routes.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/network.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/ocr.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/remote.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/services.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/swarm.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/command/registered/web.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/conf/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/conf/wizard.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/cache.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/model_factory.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/optimizations.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/preferences.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/project.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/recommender.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/result.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/store.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/stream.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/sysmon.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/core/thinking.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/code_generator.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/dynamic_builder/dependency_manager.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/gatekeeper/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/gatekeeper/daemon.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/gatekeeper/manager.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/lang/i18n.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/lang/translations/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/main.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/memory/context.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/memory/history.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/memory/session.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/__init__.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/actions.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/batch.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/agent.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/cron.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/dataframe.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/dev.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/fs.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/mcp.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/ocr.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/rag.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/remote_agent.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/session.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/stock.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/commands/system.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/queue.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/quick_actions.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/repl/scenarios.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/security/security.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/ui/banner.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/ui/buddha.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/ui/markdown.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/ui/ui.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/charts.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/dataframe.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/disk.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/fs.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/launcher.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/loader.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/m365.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/mail.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/network.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/ocr.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/remote.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/vision.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli/weapon/web.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli.egg-info/dependency_links.txt +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli.egg-info/entry_points.txt +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli.egg-info/requires.txt +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/fr_cli.egg-info/top_level.txt +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/setup.cfg +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_a2a_and_providers.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_agent_create.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_agent_manager_store.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_agent_server.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_batch_mode.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_builtin_tools.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_cron_persist.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_gatekeeper_store.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_help_update.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_integration_real.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_json_store.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_m365_mail.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_master_prompt_fix.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_mcp_real.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_memory_store.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_model_config.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_new_providers.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_no_color_prompt_toolkit.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_plugin_exec.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_prompt_completion.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_stock.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_swarm.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_vfs_diff.py +0 -0
- {fr_cli-2.5.0 → fr_cli-2.7.0}/tests/test_workflow.py +0 -0
fr_cli-2.7.0/PKG-INFO
ADDED
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fr-cli
|
|
3
|
+
Version: 2.7.0
|
|
4
|
+
Summary: 凡人打字机 - 支持多模型(Zhipu/DeepSeek/Kimi/Qwen/StepFun/MiniMax/Spark/Doubao/MiMo)的终极全能终端工具
|
|
5
|
+
Author: FANREN CLI Author
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/leungyukit/fr-cli
|
|
8
|
+
Project-URL: Issues, https://github.com/leungyukit/fr-cli/issues
|
|
9
|
+
Keywords: zhipuai,deepseek,kimi,qwen,cli,ai,terminal,chatbot
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: zhipuai>=2.0.0
|
|
27
|
+
Requires-Dist: openai>=1.0.0
|
|
28
|
+
Requires-Dist: requests>=2.28.0
|
|
29
|
+
Requires-Dist: mcp>=1.6.0
|
|
30
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
31
|
+
Requires-Dist: prompt_toolkit>=3.0.0
|
|
32
|
+
Requires-Dist: Pillow>=10.0.0
|
|
33
|
+
Requires-Dist: pymupdf>=1.23.0
|
|
34
|
+
Provides-Extra: data
|
|
35
|
+
Requires-Dist: pandas>=1.5.0; extra == "data"
|
|
36
|
+
Requires-Dist: openpyxl>=3.0.0; extra == "data"
|
|
37
|
+
Provides-Extra: db
|
|
38
|
+
Requires-Dist: pymysql>=1.0.0; extra == "db"
|
|
39
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "db"
|
|
40
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "db"
|
|
41
|
+
Requires-Dist: oracledb>=1.3.0; extra == "db"
|
|
42
|
+
Provides-Extra: rag
|
|
43
|
+
Requires-Dist: chromadb>=0.4.0; extra == "rag"
|
|
44
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "rag"
|
|
45
|
+
Provides-Extra: remote
|
|
46
|
+
Requires-Dist: paramiko>=3.0.0; extra == "remote"
|
|
47
|
+
Provides-Extra: spider
|
|
48
|
+
Requires-Dist: selenium>=4.10.0; extra == "spider"
|
|
49
|
+
Provides-Extra: cloud
|
|
50
|
+
Requires-Dist: bypy; extra == "cloud"
|
|
51
|
+
Requires-Dist: aligo; extra == "cloud"
|
|
52
|
+
Requires-Dist: msal; extra == "cloud"
|
|
53
|
+
Provides-Extra: monitor
|
|
54
|
+
Requires-Dist: watchdog>=3.0.0; extra == "monitor"
|
|
55
|
+
Provides-Extra: all
|
|
56
|
+
Requires-Dist: pandas>=1.5.0; extra == "all"
|
|
57
|
+
Requires-Dist: openpyxl>=3.0.0; extra == "all"
|
|
58
|
+
Requires-Dist: pymysql>=1.0.0; extra == "all"
|
|
59
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
|
|
60
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "all"
|
|
61
|
+
Requires-Dist: oracledb>=1.3.0; extra == "all"
|
|
62
|
+
Requires-Dist: chromadb>=0.4.0; extra == "all"
|
|
63
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
|
|
64
|
+
Requires-Dist: paramiko>=3.0.0; extra == "all"
|
|
65
|
+
Requires-Dist: selenium>=4.10.0; extra == "all"
|
|
66
|
+
Requires-Dist: bypy; extra == "all"
|
|
67
|
+
Requires-Dist: aligo; extra == "all"
|
|
68
|
+
Requires-Dist: msal; extra == "all"
|
|
69
|
+
Requires-Dist: watchdog>=3.0.0; extra == "all"
|
|
70
|
+
Provides-Extra: dev
|
|
71
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
72
|
+
Requires-Dist: build; extra == "dev"
|
|
73
|
+
Requires-Dist: twine; extra == "dev"
|
|
74
|
+
Dynamic: license-file
|
|
75
|
+
|
|
76
|
+
# 凡人打字机 (fr-cli)
|
|
77
|
+
|
|
78
|
+
**支持 25 种 AI 模型(智谱/Anthropic/OpenAI/DeepSeek/Kimi/StepFun/MiniMax/豆包/MiMo/Qwen 等)的终端全能 AI 工具。**
|
|
79
|
+
|
|
80
|
+
**集成 MasterAgent 主控 + Hermes 后台自治任务引擎:自我进化、目标分解、定时执行。**
|
|
81
|
+
|
|
82
|
+
## ✨ 功能特性
|
|
83
|
+
|
|
84
|
+
### 🤖 多模型支持(25 个厂商)
|
|
85
|
+
支持以下 AI 模型提供商,默认 `zhipu / glm-4-flash`,启动时按 `default_provider → backup_provider` 自动降级:
|
|
86
|
+
|
|
87
|
+
| 厂商 | 默认模型 | 协议 |
|
|
88
|
+
|------|---------|------|
|
|
89
|
+
| **zhipu** 智谱 | glm-4-flash | 原生 SDK |
|
|
90
|
+
| **zhipu-coding** 智谱 Coding Plan | glm-4.7 | OpenAI 兼容 |
|
|
91
|
+
| **anthropic** Anthropic Claude | claude-sonnet-4-5 | Anthropic 协议 |
|
|
92
|
+
| **openai** | gpt-4o-mini | OpenAI 兼容 |
|
|
93
|
+
| **deepseek** | deepseek-chat | OpenAI 兼容 |
|
|
94
|
+
| **kimi** 月之暗面 | moonshot-v1-8k | OpenAI 兼容 |
|
|
95
|
+
| **kimi-k2** | kimi-k2-0905-preview | OpenAI 兼容 |
|
|
96
|
+
| **kimi-code** 代码平台 | kimi-for-coding | OpenAI 兼容 |
|
|
97
|
+
| **kimi-code-anthropic** | kimi-for-coding | Anthropic 协议 |
|
|
98
|
+
| **qwen** 通义千问 | qwen-turbo | OpenAI 兼容 |
|
|
99
|
+
| **doubao** 豆包 | doubao-1-5-pro-32k | OpenAI 兼容 |
|
|
100
|
+
| **mimo** 小米 MiMo | mimo-v2-flash | OpenAI 兼容 |
|
|
101
|
+
| **mimo-token-plan** | mimo-v2-flash | OpenAI 兼容(Token Plan) |
|
|
102
|
+
| **minimax** MiniMax | MiniMax-Text-01 | OpenAI 兼容 |
|
|
103
|
+
| **minimax-chat** | abab6.5s-chat | OpenAI 兼容 |
|
|
104
|
+
| **minimax-m27** Token Plan | MiniMax-M2.7 | OpenAI 兼容(Token Plan) |
|
|
105
|
+
| **minimax-m27-fast** | MiniMax-M2.7-HighSpeed | OpenAI 兼容(Token Plan) |
|
|
106
|
+
| **minimax-token-plan** | MiniMax-M2.7 | OpenAI 兼容(Token Plan) |
|
|
107
|
+
| **stepfun** 阶跃星辰 | step-1-8k | OpenAI 兼容 |
|
|
108
|
+
| **step-1 / step-2 / step-3** | step-X-8k/16k/auto | OpenAI 兼容 |
|
|
109
|
+
| **step-audio** | step-audio-2 | OpenAI 兼容 |
|
|
110
|
+
| **stepfun-step-plan** | step-3-auto | OpenAI 兼容(Token Plan) |
|
|
111
|
+
| **ernie** 文心一言 | ernie-bot-4 | Wenxin SDK |
|
|
112
|
+
|
|
113
|
+
### 🧠 核心功能
|
|
114
|
+
- **MasterAgent 主控**(默认启用):自我进化的 ReAct 主控 Agent,自动规划、调用工具、反思进化、失败驱动学习
|
|
115
|
+
- **Hermes 后台自治任务**:持久化任务队列、目标自动分解、子任务依赖链、跨任务记忆、定时执行、审核队列
|
|
116
|
+
- **启动流程 v2.6+**:首次启动自动引导配置 → 6 步模型向导 → default/backup 自动降级 → 后台服务自动拉起
|
|
117
|
+
- **项目记忆自动加载 (v2.7+)**:自动发现 `.frcli.md` / `AGENTS.md` / `CLAUDE.md` / `.github/AGENTS.md`,注入到 system prompt(类似 Claude Code 的 CLAUDE.md 机制)
|
|
118
|
+
- **完整 Plan mode (v2.7+)**:AI 主动 `enter_plan_mode` → 生成执行计划 → 用户审批 → `exit_plan_mode` 自动执行(类似 Claude Code 的 EnterPlanMode/ExitPlanMode)
|
|
119
|
+
- **多文件原子编辑 (v2.7+)**:`multi_edit` 工具一次性编辑多个文件,任一失败整体回滚
|
|
120
|
+
- **Git 集成 (v2.7+)**:7 个 AI 工具(`git_status` / `git_diff` / `git_log` / `git_add` / `git_commit` / `git_branch` / `git_show`),让 AI 像 Claude Code 一样感知版本控制
|
|
121
|
+
- **Sub-agent 委派 (v2.7+)**:MasterAgent 通过 `spawn_agent` 工具启动子 Agent 处理子任务,`task_output` 查询后台任务状态(类似 Claude Code 的 Task/TaskOutput)
|
|
122
|
+
- **Skill 系统 (v2.7+)**:用户可定义 `.md` skill(frontmatter + steps),通过触发词或 `/skill` 命令加载,AI 自动按步骤执行
|
|
123
|
+
- **Hooks 系统 (v2.7+)**:PreToolUse / PostToolUse / UserPromptSubmit / SessionStart 等可扩展点,支持 shell 命令钩子(`exit 2` 阻止 / JSON 输出修改参数)
|
|
124
|
+
- **Per-tool 权限 (v2.7+)**:在 `sec_*` 类别基础上加 tool 级控制(always_allow / always_deny / ask_each_time + path_rules)
|
|
125
|
+
- **Voice / TTS (v2.7+)**:复用 matrix MCP 的 TTS 工具,支持 AI 回复自动朗读
|
|
126
|
+
- **STT 语音输入 (v2.8+)**:通过 matrix MCP `transcribe_audio` 工具转写音频文件(mp3/wav/m4a/flac 等),可选本地 `faster-whisper` fallback;macOS 支持 `/voice_record` 录音 + 转写
|
|
127
|
+
- **Git Worktree 环境隔离 (v2.8+)**:4 个 AI 工具(`worktree_create` / `worktree_list` / `worktree_remove` / `worktree_switch`),主仓库里并行开多个独立 worktree,互不干扰地开发多个 feature
|
|
128
|
+
- **Plan mode UI 增强 (v2.8+)**:彩色 ANSI 渲染 + 进度条 `████░░░░ 60%` + 步骤状态图标 `✅❌🏃⏳⏭️` + 步骤耗时估算 + 依赖箭头可视化
|
|
129
|
+
- **RAG 检索结果缓存 (v2.8+)**:基于 query+top_k+lang 的 SHA256 hash,10 分钟 TTL,128 条 LRU 自动清理,避免重复 embedding + LLM 调用
|
|
130
|
+
- **会话自动恢复 (v2.8+)**:启动时检测 24h 内的最近会话,询问是否继续(加载最后 5 轮到 messages),支持 y/n/s 三个选项
|
|
131
|
+
- **消息分块持久化 (v2.8+)**:增量写 + 周期 full snapshot(默认 20 条触发一次),减少大 messages 列表的 IO 开销
|
|
132
|
+
- **并行工具调用 (v2.8+)**:AI 用 `【并行调用:tool1({...}),tool2({...})】` 显式并发执行,ThreadPoolExecutor 后台跑,失败隔离
|
|
133
|
+
- **Plan mode 撤销栈 (v2.8+)**:保存 20 步历史 plan,`undo_plan` / `redo_plan` 回退/重做,持久化到 `~/.fr_cli/plan_history/`
|
|
134
|
+
- **Worktree 自动清理 (v2.8+)**:空闲 7 天的 worktree 自动加入清理列表,`clean_idle_worktrees` 支持 `--dry-run` / `--force`
|
|
135
|
+
- **RAG 跨会话缓存 (v2.8+)**:可选持久化模式,缓存写到 `~/.fr_cli/rag_cache.json`,重启后还能命中
|
|
136
|
+
- **Diff 可视化 (v2.8+)**:彩色 unified diff + 行号对齐 + 上下文折叠 + 双栏并排,集成到 `git_diff` 工具
|
|
137
|
+
- **Streaming Markdown (v2.8+)**:边输出边渲染,状态机跟踪 heading/code/list/quote/table,逐 chunk 渲染不重写
|
|
138
|
+
- **会话导出 PPT (v2.8+)**:`/export_ppt <会话索引或路径>` 导出为 PPTX(python-pptx)或 Markdown 大纲(fallback),每对 user/assistant 转为一张幻灯片
|
|
139
|
+
- **多 Agent 共享 Worktree (v2.8+)**:蜂群协作时每个 Agent 自动分到独立 worktree(`/swarm_wt_new`),避免冲突,完成后统一 merge 到主分支
|
|
140
|
+
- **Skill 远程共享 Gist (v2.8+)**:`/skill_share <name>` 推送本地 skill 到 GitHub Gist(需 GITHUB_TOKEN),`/skill_import <URL>` 导入别人分享的 skill
|
|
141
|
+
- **会话时间线 HTML (v2.8+)**:`/timeline <会话索引>` 生成可视化 HTML 时间线(暗色 GitHub 风格,工具调用折叠面板),自动用浏览器打开
|
|
142
|
+
- **AI 意图可视化 (v2.8+)**:支持 `[AI_INTENT]` 块 / `【理由:...】` 两种格式,AI 可在调用前声明"为什么做这个调用",在执行前展示给用户
|
|
143
|
+
- **本地 LLM Ollama (v2.8+)**:`/ollama_status` 探测本地 ollama 服务,`/ollama_pull <model>` 流式下载,`/ollama_rm <model>` 删除,`/ollama_use <model>` 切换到 Ollama 作为当前 provider
|
|
144
|
+
- **MCP Streamable HTTP (v2.8+)**:MCP 服务器传输类型从 stdio-only 扩展到支持 Streamable HTTP 和 SSE,基于官方 `mcp.client.streamable_http` SDK
|
|
145
|
+
- **Web Bookmark + RAG (v2.8+)**:`/bookmark <url>` 收藏网页(自动抓取正文为 Markdown),`/bm_list` / `/bm_search` 列表与全文搜索,`/bm_rag [--all]` 同步到 RAG 知识库便于后续 @RAG 查询,`/bm_chrome <html文件>` 从 Chrome 浏览器导入
|
|
146
|
+
- **Web 控制台 (v2.8+)**:`/console [--port=7777]` 启动本地 HTTP 服务,浏览器打开暗色面板查看全局状态 / 会话 / Hermes 任务 / Worktree / Bookmark / 用量统计;Bearer Token 鉴权,默认只绑 127.0.0.1
|
|
147
|
+
- **Crypto Wallet 只读查询 (v2.8+)**:`/crypto_balance 0x... [--chain bsc|polygon|...]` 查询 EVM 链地址余额,`/crypto_tx 0x...` 最近交易,`/crypto_price ETH` CoinGecko 实时价格(完全只读,不接触私钥/助记词)
|
|
148
|
+
- **MCP Resources (v2.8+)**:MCP 协议除了 Tools 还支持 Resources(`/resources/list` + `/resources/read`),fr-cli 现已完整支持两个 API,通过 `MCPServerManager.list_resources/read_resource_sync` 调用
|
|
149
|
+
- **Web 控制台 SSE 实时推送 (v2.8+)**:浏览器面板通过 `/api/events` SSE 长连接接收实时事件,新事件通过 `push_event()` 函数推送,自动重连 + 心跳
|
|
150
|
+
- **DeFi 查询 (v2.8+)**:DeFi Llama API(免 key),`/defi_protocols` 列出协议,`/defi_tvl uniswap` 协议详情,`/defi_yields [--chain eth --project aave]` 收益池 APY,`/defi_pool <uuid>` 单池详情
|
|
151
|
+
- **本地 TTS (v2.8+)**:`/say "你好"` 调用系统朗读(macOS `say` / Linux `espeak`/`spd-say`/`festival` / Windows SAPI),`--voice` 选声音,`-o file.aiff` 保存文件,`--async` 后台播放
|
|
152
|
+
- **MCP Prompts (v2.8+)**:MCP 协议的第三个核心 API(prompts/list + prompts/get),fr-cli 现已完整支持,与 Tools/Resources 并列
|
|
153
|
+
- **Web 控制台 PWA (v2.8+)**:manifest.json + service-worker.js + icon.svg,支持离线访问,iOS 添加到主屏变 PWA 应用
|
|
154
|
+
- **DeFi 历史 APY 图表 (v2.8+)**:`/defi_chart <pool_uuid>` 显示 APY/TVL 随时间变化的 ASCII sparkline + bar chart
|
|
155
|
+
- **TTS 流式合成 (v2.8+)**:`/say_stream "长文本"` 自动按句号/段落分块朗读,避免单个 say 命令被截断,支持回调逐块同步
|
|
156
|
+
- **思维模式**:`direct / CoT / ToT / ReAct / Plan` 五种推理模式切换
|
|
157
|
+
- **文件沙盒**:安全的虚拟文件系统(VFS),支持读写/目录操作、`../` 防逃逸
|
|
158
|
+
- **联网搜索**:内置 Web 搜索与网页内容提取(SSRF 防护)
|
|
159
|
+
- **Token 上下文压缩**:长会话自动摘要早期对话,降低 prompt token 消耗
|
|
160
|
+
- **4 阶安全确认**:`Y / A / F / N` 四级授权,支持 `sandbox_auto` / `full_auto` 自治模式
|
|
161
|
+
|
|
162
|
+
### 🎯 特色功能
|
|
163
|
+
- **视觉能力**:图片生成(CogView)与多模态识别(GLM-4V / Claude Vision)
|
|
164
|
+
- **OCR 文字识别**:`/ocr <文件>` 识别图片或 PDF 中的文字,支持 Vision API + PaddleOCR 本地引擎
|
|
165
|
+
- **邮件收发**:IMAP/SMTP 标准邮箱 + Microsoft 365 现代认证(OAuth2 + MFA)
|
|
166
|
+
- **定时任务**:后台定时执行命令(Cron)与 Agent 定时任务(Agent Cron)
|
|
167
|
+
- **云盘集成**:百度/阿里/OneDrive 网盘
|
|
168
|
+
- **插件系统**:AI 生成代码自动保存为插件(子进程隔离,15s 超时)
|
|
169
|
+
- **会话记忆**:最近 5 轮对话摘要注入 + 按日期自动存档 + 手动保存
|
|
170
|
+
- **Agent 分身系统**:AI 自动生成 Agent,支持工作流编排、专属模型绑定、远程 Agent 注册
|
|
171
|
+
- **Agent HTTP API**:将 Agent / 蜂群 / MasterAgent 发布为 REST API
|
|
172
|
+
- **蜂群协作 (Swarm)**:`parallel / council / pipeline` 三种多 Agent/工具/MCP/插件协作模式
|
|
173
|
+
- **动态构建系统**:按需自动安装依赖、生成工具、自测回滚、能力缺口发现
|
|
174
|
+
- **本机应用启动**:一键调用浏览器、微信、Word、WPS 等本地程序
|
|
175
|
+
- **内置 Agent**:`@local` `@remote` `@spider` `@db` `@RAG` `@stock`
|
|
176
|
+
- **数据卷轴**:Excel / CSV 读取与智能分析
|
|
177
|
+
- **数据库助手**:MySQL / PostgreSQL / SQL Server / Oracle 智能 SQL 生成
|
|
178
|
+
- **本地 RAG**:ChromaDB 向量库 + 自动文件监控与向量化(支持独立守护进程)
|
|
179
|
+
- **股票助手**:akshare / 麦蕊 / tushare 数据源,模拟交易
|
|
180
|
+
- **MCP 外部神通**:支持 Model Context Protocol(stdio / SSE)
|
|
181
|
+
- **多源信息融合**:大模型 + 工具结果统一汇总,双源回答
|
|
182
|
+
- **集中式错误报告**:`/status errors` 聚合 Hermes / 动态构建 / 审核拒绝 / MasterAgent 失败模式
|
|
183
|
+
- **中英文切换**:完整国际化支持
|
|
184
|
+
- **NO_COLOR 支持**:`NO_COLOR=1` 禁用所有 ANSI 颜色,适合 CI/管道环境
|
|
185
|
+
|
|
186
|
+
## 🚀 快速开始
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# 安装
|
|
190
|
+
pip install fr-cli
|
|
191
|
+
|
|
192
|
+
# 启动
|
|
193
|
+
fr-cli
|
|
194
|
+
|
|
195
|
+
# 或从源码运行
|
|
196
|
+
git clone https://github.com/yourname/fr-cli.git
|
|
197
|
+
cd fr-cli
|
|
198
|
+
pip install -e ".[all]"
|
|
199
|
+
fr-cli
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**首次运行**(v2.6+):
|
|
203
|
+
1. 检测到未配置 → 提示是否进入 6 步配置向导
|
|
204
|
+
2. 选 N → 进入 Mock 模式试用
|
|
205
|
+
3. 选 Y → 6 步流程:`选厂商 → 选 compat → 选模型 → 设 baseUrl → 设 API Key → 设 default/backup`
|
|
206
|
+
|
|
207
|
+
启动后自动:
|
|
208
|
+
- 启用 MasterAgent(默认开,可 `/master off` 关掉)
|
|
209
|
+
- 拉起 Hermes 后台守护进程(可 `autostart_on_launch: false` 关掉)
|
|
210
|
+
- 拉起 Gatekeeper 守护进程(Agent HTTP + 定时任务持久化)
|
|
211
|
+
|
|
212
|
+
## 📝 使用方法
|
|
213
|
+
|
|
214
|
+
### 📋 常用命令
|
|
215
|
+
|
|
216
|
+
#### 💬 对话 / 模型
|
|
217
|
+
```
|
|
218
|
+
/model <模型名> 切换 AI 模型(仅当前会话)
|
|
219
|
+
/model <道统>:<模型名> 同时切换道统和模型
|
|
220
|
+
/model current 显示当前模型
|
|
221
|
+
/model default 恢复 factory 默认模型
|
|
222
|
+
/model list 列出所有可用模型
|
|
223
|
+
/model config 🆕 6 步模型配置向导(等价 /providers setup)
|
|
224
|
+
/key <key> 修改当前道统 API Key
|
|
225
|
+
/key <道统> <key> 为指定道统设置 Key
|
|
226
|
+
/providers 查看所有道统配置(含 default/backup)
|
|
227
|
+
/providers setup 🆕 6 步模型配置向导
|
|
228
|
+
/providers add <p> <k> [m] 添加/更新道统配置
|
|
229
|
+
/providers use <p> 切换到指定道统
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### 🧠 主控 / 思维
|
|
233
|
+
```
|
|
234
|
+
/master on|off|status MasterAgent 主控(默认开)
|
|
235
|
+
/mode direct|cot|tot|react|plan 切换思维模式
|
|
236
|
+
/autonomous [mode] 切换自治模式(manual/sandbox_auto/full_auto/off)
|
|
237
|
+
|
|
238
|
+
# v2.7+:完整 Plan mode(类似 Claude Code 的 EnterPlanMode/ExitPlanMode)
|
|
239
|
+
# AI 工具:
|
|
240
|
+
enter_plan_mode AI 主动进入计划模式,生成详细执行计划
|
|
241
|
+
exit_plan_mode 用户审批/拒绝后,自动按步骤执行或放弃
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### 📂 文件 / 上下文
|
|
245
|
+
```
|
|
246
|
+
/dir [路径] 列出目录文件 / 添加允许访问的目录
|
|
247
|
+
/dirs 列出已挂载的工作目录
|
|
248
|
+
/rmdir <索引> 删除已挂载的目录
|
|
249
|
+
/open <file> 查看文件内容
|
|
250
|
+
/write <file> 写入文件(多行,Ctrl+D 结束)
|
|
251
|
+
/delete <file> 删除文件
|
|
252
|
+
/context [status|compress|threshold N|keep N] 管理上下文压缩
|
|
253
|
+
/limit <n> 设置 Token 上限(最小 1000)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### 🧬 项目记忆 + 多文件编辑 + Git
|
|
257
|
+
```
|
|
258
|
+
# v2.7+:自动加载 .frcli.md / AGENTS.md / CLAUDE.md 作为项目记忆
|
|
259
|
+
# 放在项目根目录(或 .github/AGENTS.md)即可被 AI 自动感知
|
|
260
|
+
|
|
261
|
+
# AI 工具:
|
|
262
|
+
multi_edit 原子性多文件编辑(任一失败整体回滚,适合批量重构)
|
|
263
|
+
git_status git working tree 状态
|
|
264
|
+
git_diff [path] 查看变更内容
|
|
265
|
+
git_log [limit] 查看提交历史
|
|
266
|
+
git_add [paths] 暂存文件
|
|
267
|
+
git_commit 提交变更
|
|
268
|
+
git_branch 列出/创建/切换/删除分支
|
|
269
|
+
git_show 查看某次提交详情
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### 💾 会话 / 用量
|
|
273
|
+
```
|
|
274
|
+
/save <name> 保存当前会话
|
|
275
|
+
/load [name] 加载历史会话
|
|
276
|
+
/export [path] 导出会话为 Markdown
|
|
277
|
+
/session_list 列出按日期自动存档的会话
|
|
278
|
+
/session_load <idx> 加载自动存档的会话
|
|
279
|
+
/session_del <idx> 删除自动存档
|
|
280
|
+
/usage [days] 查看 LLM 用量统计(provider/model/tokens/cost)
|
|
281
|
+
/status [json|errors] 查看全局状态 / 集中错误报告
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### 🔌 MCP / 插件 / 动态构建
|
|
285
|
+
```
|
|
286
|
+
/mcp_list 列出 MCP 服务器及工具
|
|
287
|
+
/mcp_add <名> <命令> [参数] 添加 MCP 服务器
|
|
288
|
+
/mcp_del <名> 删除 MCP 服务器
|
|
289
|
+
/mcp_enable / mcp_disable <名> 启用/禁用 MCP
|
|
290
|
+
/mcp_refresh 刷新 MCP 工具列表
|
|
291
|
+
/build <需求> AI 自动生成工具并注册
|
|
292
|
+
/build list 列出已构建工具
|
|
293
|
+
/build check <name> 重新测试已构建工具
|
|
294
|
+
/build del <name> 删除已构建工具
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### 🤖 Agent 管理
|
|
298
|
+
```
|
|
299
|
+
/agent_create <名> <描述> AI 自动生成 Agent
|
|
300
|
+
/agent_forge <名> 从历史代码铸造 Agent
|
|
301
|
+
/agent_list 列出所有 Agent
|
|
302
|
+
/agent_show <名> 查看 Agent 详情
|
|
303
|
+
/agent_edit <名> persona|memory|skills 编辑 Agent 文件
|
|
304
|
+
/agent_run <名> <任务> 运行 Agent
|
|
305
|
+
/agent_model <名> [<provider>:<model>] 配置 Agent 专属模型
|
|
306
|
+
/agent_delete <名> 删除 Agent
|
|
307
|
+
/agent_server start|stop|status [port] 启动 Agent HTTP API
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### 🛰️ 远程 Agent / 内置 Agent
|
|
311
|
+
```
|
|
312
|
+
@local <任务> 本地系统操作(安全确认后执行)
|
|
313
|
+
/remote <host> <任务> 远程 SSH 操作(支持 sftp/scp)
|
|
314
|
+
/spider <url> [depth] 智能网页爬虫
|
|
315
|
+
/db <conn> <任务> 数据库智能助手
|
|
316
|
+
@RAG <问题> 本地知识库问答
|
|
317
|
+
@stock <任务> 股票/量化助手
|
|
318
|
+
|
|
319
|
+
/remote_setup 配置 SSH 远程主机
|
|
320
|
+
/db_setup 配置数据库连接
|
|
321
|
+
/remote_agent_add <名> <url> 注册远程 Agent
|
|
322
|
+
/remote_agent_list 列出远程 Agent
|
|
323
|
+
/remote_agent_publish <名> 将本地 Agent 发布为 HTTP API
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### 🔧 后台服务 / 系统
|
|
327
|
+
```
|
|
328
|
+
/autostart [--agent-server port] [--hermes port] 一键启动所有后台服务
|
|
329
|
+
/hermes status|start|stop|list|task|goal|confirm|review Hermes 后台自治(统一入口,start 即启动独立 HTTP 守护进程)
|
|
330
|
+
/gatekeeper start|stop|status Gatekeeper 守护进程(Agent HTTP + Cron)
|
|
331
|
+
/hermes_review approve|reject <id> 审核队列(动态构建 / Agent 自动产物)
|
|
332
|
+
|
|
333
|
+
# v2.7+:AI 工具(类似 Claude Code 的 TaskOutput)
|
|
334
|
+
task_output 查询 Hermes 后台任务的状态/输出
|
|
335
|
+
list_background_tasks 列出所有后台任务
|
|
336
|
+
spawn_agent 启动子 Agent 处理子任务,返回 task_id(可并发)
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
#### 🎯 Skill 系统 (v2.7+)
|
|
340
|
+
```
|
|
341
|
+
# 用户可定义 .md skill,放在 ~/.fr_cli/skills/ 或项目 .fr_cli/skills/
|
|
342
|
+
|
|
343
|
+
# skill 文件格式(Markdown frontmatter):
|
|
344
|
+
---
|
|
345
|
+
name: my-skill
|
|
346
|
+
description: 描述
|
|
347
|
+
triggers:
|
|
348
|
+
- 触发词1
|
|
349
|
+
- 触发词2
|
|
350
|
+
steps: |
|
|
351
|
+
1. 第一步
|
|
352
|
+
2. 第二步
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
# 触发方式:/skill <name> 或自然语言包含触发词
|
|
356
|
+
# AI 会自动加载 skill 并按步骤执行
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### 🎣 Hooks 系统 (v2.7+)
|
|
360
|
+
```
|
|
361
|
+
# ~/.fr_cli/hooks.json 或项目级 .fr_cli/hooks.json
|
|
362
|
+
{
|
|
363
|
+
"PreToolUse": [
|
|
364
|
+
{"matcher": "delete_file", "command": "exit 2", "description": "禁止删除"}
|
|
365
|
+
],
|
|
366
|
+
"PostToolUse": [
|
|
367
|
+
{"matcher": ".*", "command": "logger.sh"}
|
|
368
|
+
],
|
|
369
|
+
"UserPromptSubmit": [
|
|
370
|
+
{"matcher": ".*rm\\s+-rf.*", "command": "exit 2"}
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
# PreToolUse hook:
|
|
375
|
+
# - exit 0: 放行
|
|
376
|
+
# - exit 2: 阻止(类似 Claude Code)
|
|
377
|
+
# - stdout 输出 JSON {block: true} → 阻止
|
|
378
|
+
# - stdout 输出 JSON {modified_args: {...}} → 修改参数
|
|
379
|
+
# - 纯文本 stdout → 替换 tool_result(用于 PostToolUse)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
#### 🔐 Per-tool 权限 (v2.7+)
|
|
383
|
+
```json
|
|
384
|
+
// ~/.fr_cli/config.json
|
|
385
|
+
{
|
|
386
|
+
"permissions": {
|
|
387
|
+
"always_allow": ["search_web", "read_file"],
|
|
388
|
+
"always_deny": ["delete_file"],
|
|
389
|
+
"ask_each_time": ["git_commit"],
|
|
390
|
+
"path_rules": {
|
|
391
|
+
"write_file": {
|
|
392
|
+
"always_allow_paths": ["/tmp/*"],
|
|
393
|
+
"always_deny_paths": ["/etc/*", "/usr/*", "re:.*\\.env$"]
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
优先级:`deny` > `path_allow` > `always_allow` > `ask` > `fallthrough(sec_*)`
|
|
400
|
+
|
|
401
|
+
#### 🔊 Voice / TTS (v2.7+)
|
|
402
|
+
```
|
|
403
|
+
# 需要配置 matrix MCP server(内置 TTS 工具)
|
|
404
|
+
# 配置后:
|
|
405
|
+
voice_speak 朗读文本(同步,生成音频文件)
|
|
406
|
+
voice_list 列出可用声音
|
|
407
|
+
voice_toggle 切换自动朗读(AI 回复自动朗读)
|
|
408
|
+
# AI 工具:
|
|
409
|
+
【调用:voice_speak({"text": "你好世界"})】
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### 🎙️ STT 语音输入 (v2.8+)
|
|
413
|
+
```
|
|
414
|
+
# 需要配置 matrix MCP server(内置 transcribe_audio 工具)
|
|
415
|
+
# 用法:
|
|
416
|
+
/voice_input /path/to/audio.mp3 # 文件转写
|
|
417
|
+
/voice_input /path/to/audio.wav --lang en # 英文转写
|
|
418
|
+
/voice_input /path/to/audio.mp3 --local # 优先用本地 whisper
|
|
419
|
+
/voice_record 30 # macOS 录音 30 秒 + 自动转写
|
|
420
|
+
# AI 工具:
|
|
421
|
+
【调用:voice_input({"path": "/tmp/audio.mp3", "language": "zh"})】
|
|
422
|
+
```
|
|
423
|
+
支持的音频格式:mp3 / wav / m4a / flac / ogg / opus / webm / aac
|
|
424
|
+
引擎优先级:MCP matrix → 本地 faster-whisper(fallback)
|
|
425
|
+
|
|
426
|
+
#### 🌳 Git Worktree 环境隔离 (v2.8+)
|
|
427
|
+
```
|
|
428
|
+
# 在当前 git 仓库下创建隔离 working copy,适合并行开发多个 feature
|
|
429
|
+
/worktree_create feat-x # 创建 feat-x 分支 + worktree
|
|
430
|
+
/worktree_create feat-y /path/to/wt # 自定义路径
|
|
431
|
+
/worktree_list # 列出所有 worktree
|
|
432
|
+
/worktree_switch /path/to/wt # 切换 cwd 到 worktree
|
|
433
|
+
/worktree_remove /path/to/wt --force # 删除 worktree(保留分支)
|
|
434
|
+
# AI 工具:
|
|
435
|
+
【调用:worktree_create({"branch": "feat-x", "base": "master"})】
|
|
436
|
+
【调用:worktree_list({})】
|
|
437
|
+
```
|
|
438
|
+
默认路径: `<repo>/.worktrees/<branch>/`,可自定义。删除分支用普通 git 命令。
|
|
439
|
+
|
|
440
|
+
#### 📋 Plan mode UI 增强 (v2.8+)
|
|
441
|
+
```
|
|
442
|
+
# Plan mode 的可视化增强:
|
|
443
|
+
- ANSI 彩色(标题/成功/失败/警告)
|
|
444
|
+
- 进度条 ████░░░░ 60%
|
|
445
|
+
- 步骤状态 ✅ ❌ 🏃 ⏳ ⏭️
|
|
446
|
+
- 步骤耗时估算(基于工具类型)
|
|
447
|
+
- 依赖箭头 │ ▼ 连接步骤
|
|
448
|
+
- 审批选项:y/n/e/s/d(原版只有 y/n/e/s)
|
|
449
|
+
+ d = 步骤详情(查看每个步骤的参数)
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
#### 💾 RAG 缓存 + 会话自动恢复 (v2.8+)
|
|
453
|
+
```
|
|
454
|
+
# RAG 检索缓存:
|
|
455
|
+
- 10 分钟 TTL,基于 query + top_k + lang 的 SHA256 hash
|
|
456
|
+
- 最多缓存 128 条,LRU 自动清理
|
|
457
|
+
- 避免重复 embedding + LLM 调用
|
|
458
|
+
|
|
459
|
+
# 会话自动恢复:
|
|
460
|
+
- 启动时检测 24h 内的最近会话
|
|
461
|
+
- 提示:y / n / s
|
|
462
|
+
- y / 回车 = 继续上次(加载最后 5 轮)
|
|
463
|
+
- n = 开始新会话
|
|
464
|
+
- s = 选择其他会话
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
#### ⏰ 定时任务
|
|
468
|
+
```
|
|
469
|
+
/agent_cron_add <名> <秒> [输入] Agent 定时任务
|
|
470
|
+
/agent_cron_list 列出 Agent 定时任务
|
|
471
|
+
/agent_cron_del <id> 删除 Agent 定时任务
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
#### 📧 邮件
|
|
475
|
+
```
|
|
476
|
+
/mail setup 配置 IMAP/SMTP 邮箱
|
|
477
|
+
/mail inbox 查看收件箱
|
|
478
|
+
/mail read <id> 读取邮件
|
|
479
|
+
/mail send <to> <sub> <body> 发送邮件
|
|
480
|
+
/m365_config setup 配置 Microsoft 365 邮箱(OAuth2 + MFA)
|
|
481
|
+
/m365_inbox / m365_read / m365_send
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
#### 🌐 RAG / 股票 / OCR
|
|
485
|
+
```
|
|
486
|
+
/rag_dir <目录> 设置并同步本地知识库
|
|
487
|
+
/rag_sync [路径] 手动同步文件到向量库
|
|
488
|
+
/rag_watch start|stop|status|log RAG 独立文件监控守护进程
|
|
489
|
+
/stock_config setup 交互式配置股票数据源
|
|
490
|
+
/ocr <文件> OCR 识别图片或 PDF
|
|
491
|
+
/ocr_config setup|engine|provider|model|key|base_url|prompt 配置 OCR
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
#### 🛠️ 其它
|
|
495
|
+
```
|
|
496
|
+
/search <query> 联网搜索
|
|
497
|
+
/read_excel <xlsx> 读取 Excel
|
|
498
|
+
/read_csv <csv> 读取 CSV
|
|
499
|
+
/security 查看安全设置
|
|
500
|
+
/lang <zh|en> 切换语言
|
|
501
|
+
/update check|run 检查 / 执行更新
|
|
502
|
+
/tutorial 显示交互式教程
|
|
503
|
+
/banner on|off 控制启动动画
|
|
504
|
+
/exit 退出
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### 🖥️ 非交互 / 批处理模式
|
|
508
|
+
|
|
509
|
+
适合脚本、cron、管道场景:
|
|
510
|
+
|
|
511
|
+
```bash
|
|
512
|
+
# 执行一条 slash 命令后退出
|
|
513
|
+
fr-cli -c "/model current"
|
|
514
|
+
fr-cli -c "/dir"
|
|
515
|
+
|
|
516
|
+
# 向 AI 提问后退出
|
|
517
|
+
fr-cli "请总结 README.md"
|
|
518
|
+
fr-cli -p "Python 如何读取 JSON?"
|
|
519
|
+
|
|
520
|
+
# 从文件或标准输入读取提示词
|
|
521
|
+
cat article.txt | fr-cli -s
|
|
522
|
+
fr-cli -f prompt.txt
|
|
523
|
+
|
|
524
|
+
# 静默模式(跳过启动 banner,只输出核心结果)
|
|
525
|
+
fr-cli -q -c "/model current"
|
|
526
|
+
fr-cli -q -p "1+1等于几"
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### 🤖 模型配置详解(v2.6+)
|
|
530
|
+
|
|
531
|
+
**首次启动自动引导**,或手动 `/model config` / `/providers setup` 启动 6 步向导:
|
|
532
|
+
|
|
533
|
+
| 步骤 | 内容 |
|
|
534
|
+
|------|------|
|
|
535
|
+
| a | 选择供应商(25 个,显示已配置标记 + compat 类型) |
|
|
536
|
+
| b | 选择 compat 模式(Anthropic / OpenAI,zhipu 自动跳过) |
|
|
537
|
+
| c | 选择模型(支持 `c` 自定义) |
|
|
538
|
+
| d | 设置 baseUrl(`none` 清空,可读环境变量) |
|
|
539
|
+
| e | 设置 API Key(getpass 隐藏,可读环境变量) |
|
|
540
|
+
| f | 设置 default / backup / 仅保存 |
|
|
541
|
+
|
|
542
|
+
**default / backup 自动降级**:
|
|
543
|
+
```json
|
|
544
|
+
{
|
|
545
|
+
"default_provider": "zhipu",
|
|
546
|
+
"backup_provider": "deepseek",
|
|
547
|
+
"providers": {
|
|
548
|
+
"zhipu": {"key": "sk-xxx", "model": "glm-4-flash"},
|
|
549
|
+
"deepseek": {"key": "sk-yyy", "model": "deepseek-chat"}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
启动时若 `default_provider` 不可用(无 key / 接口挂),自动降级到 `backup_provider`,可通过 `/status json` 查看 `active_model_source`。
|
|
554
|
+
|
|
555
|
+
**Agent 专属模型**(不影响全局默认):
|
|
556
|
+
```bash
|
|
557
|
+
>>> /agent_model my_agent
|
|
558
|
+
>>> /agent_model my_agent deepseek:deepseek-chat
|
|
559
|
+
>>> /agent_model my_agent --key sk-own-key
|
|
560
|
+
>>> /agent_model my_agent clear
|
|
561
|
+
```
|
|
562
|
+
配置存储于 `~/.fr_cli/agents/<name>/config.json`。
|
|
563
|
+
|
|
564
|
+
### 🐝 蜂群协作 (Swarm)
|
|
565
|
+
|
|
566
|
+
通过 AI 工具调用实现多 Agent / 工具协作:
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
【调用:swarm_run({"mode": "parallel", "names": ["@local", "tool:search_web"], "user_input": "分析项目并搜索相关资料"})】
|
|
570
|
+
【调用:swarm_run({"mode": "council", "names": ["planner", "coder", "reviewer"], "user_input": "设计用户登录模块"})】
|
|
571
|
+
【调用:swarm_run({"mode": "pipeline", "names": ["extractor", "summarizer"], "user_input": "从报告中提取关键点"})】
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
支持任务单元:Agent / 内置 Agent / 注册表工具 / `/` 命令 / MCP 工具 / 自定义插件。
|
|
575
|
+
也可用 `/swarm parallel coder,reviewer ...` 直接执行。
|
|
576
|
+
|
|
577
|
+
### 🤖 AI 调用格式
|
|
578
|
+
|
|
579
|
+
```
|
|
580
|
+
【调用:search_web({"query": "搜索词"})】
|
|
581
|
+
【调用:write_file({"path": "a.md", "content": "..."})】
|
|
582
|
+
【命令:/build 生成二维码工具】
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
## 🧠 Hermes 后台自治任务
|
|
586
|
+
|
|
587
|
+
Hermes 是 fr-cli 的后台自治引擎,负责目标分解、任务队列、定时执行、跨任务记忆、审核队列。
|
|
588
|
+
|
|
589
|
+
### REPL 命令
|
|
590
|
+
```
|
|
591
|
+
/hermes status 查看引擎状态(任务/目标/统计/守护进程)
|
|
592
|
+
/hermes start [port] 启动独立 HTTP 守护进程(默认 8765)
|
|
593
|
+
/hermes stop 停止守护进程
|
|
594
|
+
/hermes goal [--autonomous] <目标> [--tags a,b] 创建目标并自动分解
|
|
595
|
+
/hermes task [--autonomous|-a] <描述> 创建后台任务
|
|
596
|
+
/hermes confirm <id> 显式确认 autonomous 任务(以 full_auto 执行)
|
|
597
|
+
/hermes list [status] 列任务(pending/running/completed/failed/paused)
|
|
598
|
+
/hermes log <id> 查看任务结果/日志
|
|
599
|
+
/hermes cancel <id> 暂停任务
|
|
600
|
+
/hermes review [approve|reject <id>] 审核队列(动态构建 / Agent 自动产物)
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
### HTTP API(默认 127.0.0.1:8765,写端点需 Bearer Token)
|
|
604
|
+
|
|
605
|
+
| 方法 | 路径 | 说明 |
|
|
606
|
+
|------|------|------|
|
|
607
|
+
| GET | `/health` | 健康检查 |
|
|
608
|
+
| GET | `/tasks` / `/tasks/<id>` | 任务列表 / 详情 |
|
|
609
|
+
| POST | `/task` | 创建任务(`execution_mode=autonomous` 返回 needs_confirmation) |
|
|
610
|
+
| POST | `/tasks/<id>/confirm` | 确认 autonomous 任务 |
|
|
611
|
+
| POST | `/chat` | 提交对话任务给 MasterAgent |
|
|
612
|
+
| POST | `/goal` | 创建目标(带 `decompose=true` 自动分解) |
|
|
613
|
+
| GET | `/goals` | 目标列表 |
|
|
614
|
+
| GET | `/analytics` | 统计 |
|
|
615
|
+
| GET | `/review` | 审核队列列表 |
|
|
616
|
+
| POST | `/review/<id>/approve?name=xxx` | 批准并安装产物 |
|
|
617
|
+
| POST | `/review/<id>/reject` | 拒绝产物 |
|
|
618
|
+
|
|
619
|
+
### 安全执行模式
|
|
620
|
+
|
|
621
|
+
| 模式 | 说明 | 适用 |
|
|
622
|
+
|------|------|------|
|
|
623
|
+
| `sandbox`(默认) | 后台任务默认,沙盒操作自动放行,系统操作非交互时拒绝 | 普通后台任务 |
|
|
624
|
+
| `autonomous` | 完全信任,所有操作自动放行 | `/hermes task -a` 创建后需 `/hermes confirm` |
|
|
625
|
+
| `interactive` | 占位,走当前 REPL 模式 | 实时对话 |
|
|
626
|
+
|
|
627
|
+
### 🐚 Shell 模式(Ctrl-X 切换)
|
|
628
|
+
```
|
|
629
|
+
Agent 模式: 输入消息与 AI 对话
|
|
630
|
+
Shell 模式: 直接执行 shell 命令
|
|
631
|
+
按 Ctrl-X 切换模式
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
## 🔧 开发
|
|
635
|
+
|
|
636
|
+
```bash
|
|
637
|
+
# 克隆项目
|
|
638
|
+
git clone https://github.com/yourname/fr-cli.git
|
|
639
|
+
cd fr-cli
|
|
640
|
+
|
|
641
|
+
# 安装开发依赖
|
|
642
|
+
pip install -e ".[all]"
|
|
643
|
+
|
|
644
|
+
# 运行测试
|
|
645
|
+
python3 -m pytest tests/ -v
|
|
646
|
+
|
|
647
|
+
# Lint
|
|
648
|
+
ruff check fr_cli tests
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### 测试覆盖
|
|
652
|
+
|
|
653
|
+
项目共有 **745+ 个测试用例**,覆盖核心模块:
|
|
654
|
+
|
|
655
|
+
| 测试文件 | 数量 | 覆盖范围 |
|
|
656
|
+
|---------|------|---------|
|
|
657
|
+
| `test_remote.py` | 10 | SSH / SCP(本地 mock server) |
|
|
658
|
+
| `test_rag.py` | 37 | RAG 知识库(文件读取/分块/入库/同步/query/守护) |
|
|
659
|
+
| `test_spider.py` | 28 | @spider 智能爬虫(链接提取/反爬检测/自适应) |
|
|
660
|
+
| `test_ocr.py` | 22 | OCR 文字识别(Vision/PDF/格式检测) |
|
|
661
|
+
| `test_fs.py` | 26 | VFS 文件沙盒(路径解析/读写/../ 逃逸防护) |
|
|
662
|
+
| `test_security.py` | 17 | 4 阶安全确认(manual/sandbox_auto/full_auto) |
|
|
663
|
+
| `test_cron.py` | 15 | CronManager(添加/删除/列表/shlex 安全) |
|
|
664
|
+
| `test_charts.py` | 17 | 控制台图表(bar/pie/line) |
|
|
665
|
+
| `test_network.py` | 13 | 网络探测(ping/port_scan/ip_scan) |
|
|
666
|
+
| `test_web.py` | 16 | WebRaider 搜索 + SSRF 防护 |
|
|
667
|
+
| `test_history.py` | 12 | 会话历史(保存/加载/导出 Markdown) |
|
|
668
|
+
| `test_context.py` | 13 | 上下文记忆(摘要/最近轮) |
|
|
669
|
+
| `test_result.py` | 19 | Result 统一返回风格 |
|
|
670
|
+
| `test_store.py` | 19 | JsonStore 原子持久化 |
|
|
671
|
+
| `test_dataframe.py` | 9 | Excel/CSV 读取 |
|
|
672
|
+
| `test_project_memory.py` | 18 | 项目记忆加载(.frcli.md/AGENTS.md/CLAUDE.md) |
|
|
673
|
+
| `test_multi_edit.py` | 13 | 原子多文件编辑 |
|
|
674
|
+
| `test_git_tools.py` | 31 | Git 集成(7 个工具,真实 git 仓库) |
|
|
675
|
+
| `test_skills.py` | 21 | Skill 系统(解析/发现/触发词) |
|
|
676
|
+
| `test_hooks.py` | 28 | Hooks 系统(Pre/Post/UserPromptSubmit) |
|
|
677
|
+
| `test_permissions.py` | 26 | Per-tool 权限 + path rules |
|
|
678
|
+
| `test_plan_mode.py` | 15 | Plan mode(EnterPlanMode/edit/show) |
|
|
679
|
+
| `test_voice.py` | 18 | Voice / TTS(matrix MCP 集成) |
|
|
680
|
+
| 其他 | ~450 | 既有测试(MasterAgent/Hermes/Swarm/MCP 等) |
|
|
681
|
+
|
|
682
|
+
测试可在任何环境运行(RAG/OCR/SSH/SPIDER 等都用 mock 隔离外部依赖)。
|
|
683
|
+
|
|
684
|
+
**累计:59+ 个测试文件,1459+ 个测试用例**
|
|
685
|
+
|
|
686
|
+
v2.8+ 新增测试:
|
|
687
|
+
|
|
688
|
+
| 测试文件 | 数量 | 覆盖范围 |
|
|
689
|
+
|---------|------|---------|
|
|
690
|
+
| `test_worktree.py` | 18 | Git worktree(create/list/remove/prune/format) |
|
|
691
|
+
| `test_voice_input.py` | 7 | STT 音频转写(格式校验 / fallback) |
|
|
692
|
+
| `test_plan_ui.py` | 16 | Plan mode 彩色 UI(渲染 / 进度 / 摘要 / 估算) |
|
|
693
|
+
| `test_rag_cache.py` | 10 | RAG 检索结果缓存(SHA256 / TTL / LRU) |
|
|
694
|
+
| `test_resume.py` | 18 | 会话自动恢复(找最新 / 时间窗 / 加载 / 询问) |
|
|
695
|
+
| `test_incremental.py` | 12 | 消息增量持久化(snapshot / delta / 触发 / 兼容) |
|
|
696
|
+
| `test_parallel.py` | 13 | 并行工具调用(提取 / 拆分 / 并发执行 / 失败隔离) |
|
|
697
|
+
| `test_plan_undo.py` | 13 | Plan 撤销栈(push / undo / redo / 清空 / 深度限制) |
|
|
698
|
+
| `test_worktree_cleanup.py` | 14 | Worktree 自动清理(注册 / touch / 找空闲 / dry-run / 实际清理) |
|
|
699
|
+
| `test_rag_persistent.py` | 7 | RAG 跨会话持久化(写盘 / 读盘 / 过期跳过 / 删除) |
|
|
700
|
+
| `test_diff_view.py` | 16 | Diff 可视化(解析 / unified / 双栏 / 统计) |
|
|
701
|
+
| `test_markdown_stream.py` | 19 | Streaming Markdown 渲染(状态机 / code block / 列表) |
|
|
702
|
+
| `test_session_ppt.py` | 15 | 会话导出 PPT(配对提取 / 大纲 / Markdown fallback) |
|
|
703
|
+
| `test_worktree_group.py` | 11 | 多 Agent 共享 Worktree(创建群组 / 列出 / 丢弃) |
|
|
704
|
+
| `test_skill_gist.py` | 14 | Skill Gist 共享(URL 解析 / 分享 / 导入 / 搜索) |
|
|
705
|
+
| `test_session_html.py` | 9 | 会话 HTML 时间线(渲染 / 工具调用 / 导出) |
|
|
706
|
+
| `test_ai_intent.py` | 9 | AI 意图可视化(block 解析 / 理由提取 / 预览格式化) |
|
|
707
|
+
| `test_ollama.py` | 11 | Ollama 本地 LLM(探测 / 列模型 / 删除 / 格式化) |
|
|
708
|
+
| `test_bookmark.py` | 27 | Web Bookmark(HTML→MD / CRUD / 搜索 / Chrome 导入) |
|
|
709
|
+
| `test_mcp_streamable.py` | 8 | MCP Streamable HTTP/SSE(server 配置 / 传输类型) |
|
|
710
|
+
| `test_console.py` | 16 | Web 控制台(token / 生命周期 / HTTP 端点 / 鉴权) |
|
|
711
|
+
| `test_crypto.py` | 32 | Crypto 只读查询(余额 / 交易 / 价格 / 多链) |
|
|
712
|
+
| `test_mcp_resources.py` | 8 | MCP Resources(list/read URI,多传输类型) |
|
|
713
|
+
| `test_console_sse.py` | 7 | Web 控制台 SSE(push/get/history,HTTP 集成) |
|
|
714
|
+
| `test_defi.py` | 15 | DeFi Llama(协议 / TVL / 收益池 / 格式化) |
|
|
715
|
+
| `test_local_tts.py` | 14 | 本地 TTS(macOS say / Linux espeak / 声音列表) |
|
|
716
|
+
| `test_mcp_prompts.py` | 7 | MCP Prompts(list / get / 多传输) |
|
|
717
|
+
| `test_defi_chart.py` | 8 | DeFi 历史 APY 图表(ASCII chart / 格式化) |
|
|
718
|
+
| `test_tts_stream.py` | 6 | TTS 流式合成(分块 / 回调 / 失败容错) |
|
|
719
|
+
|
|
720
|
+
### 环境变量
|
|
721
|
+
|
|
722
|
+
| 变量 | 说明 |
|
|
723
|
+
|------|------|
|
|
724
|
+
| `NO_COLOR=1` | 禁用所有 ANSI 颜色输出,适合 CI/管道/日志重定向 |
|
|
725
|
+
| `FR_CLI_DEBUG=1` | 开启调试模式,显示详细 traceback |
|
|
726
|
+
| `FR_CLI_NON_INTERACTIVE=1` | 非交互模式,安全确认默认拒绝 |
|
|
727
|
+
| `FR_CLI_BATCH_CONFIRM=1` | 批量确认模式:跳过所有安全询问(脚本/自动化场景) |
|
|
728
|
+
| `FR_CLI_AUTONOMOUS_MODE` | 自治模式:`manual` / `sandbox_auto` / `full_auto` |
|
|
729
|
+
| `FR_CLI_HERMES_TASK_TIMEOUT` | 单个 Hermes 任务超时秒数(默认 300) |
|
|
730
|
+
|
|
731
|
+
## 📂 项目结构
|
|
732
|
+
|
|
733
|
+
```
|
|
734
|
+
fr_cli/
|
|
735
|
+
├── main.py # 核心入口:REPL 循环与 AI 交互编排
|
|
736
|
+
├── agent/ # Agent 分身 / Master / Hermes / 蜂群系统
|
|
737
|
+
│ ├── master.py # MasterAgent 主类骨架(mixin 组装)
|
|
738
|
+
│ ├── master_storage.py # 配置文件路径 / 默认值 / 错误分类
|
|
739
|
+
│ ├── master_prompt.py # 默认 system prompt 模板
|
|
740
|
+
│ ├── master_prompt_builder.py # Prompt 组装
|
|
741
|
+
│ ├── master_loop.py # ReAct 主循环
|
|
742
|
+
│ ├── master_reflect.py # 反思进化
|
|
743
|
+
│ ├── hermes/ # Hermes 后台自治(engines/managers/models/scheduler)
|
|
744
|
+
│ ├── swarm.py / swarm_resolver.py # 蜂群协作
|
|
745
|
+
│ ├── review_queue.py # 后台产物审核队列
|
|
746
|
+
│ └── builtins/ # 内置 Agent(local/remote/db/spider/rag/stock)
|
|
747
|
+
├── command/ # 统一工具注册表与命令执行引擎
|
|
748
|
+
│ ├── registry.py # 工具注册表(单一真相源)
|
|
749
|
+
│ ├── executor.py # AI 回复解析与调度
|
|
750
|
+
│ ├── security.py # 安全确认中间件
|
|
751
|
+
│ └── registered/ # 按类目拆分的工具实现
|
|
752
|
+
├── core/ # 核心模块
|
|
753
|
+
│ ├── llm.py # LLM 客户端(25 个厂商 + Anthropic 兼容)
|
|
754
|
+
│ ├── core.py # AppState 全局状态(DI 容器)
|
|
755
|
+
│ ├── result.py # 统一 Result 返回风格
|
|
756
|
+
│ ├── store.py # 统一 JSON 持久化抽象
|
|
757
|
+
│ ├── usage.py # Token 用量统计
|
|
758
|
+
│ ├── thinking.py # 思维模式引擎(CoT/ToT/ReAct)
|
|
759
|
+
│ ├── plan/ # Plan 模式独立模块
|
|
760
|
+
│ └── ...
|
|
761
|
+
├── conf/ # 配置与路径管理
|
|
762
|
+
│ ├── config.py # 配置读写 / 首次启动引导
|
|
763
|
+
│ ├── model_wizard.py # 6 步模型配置向导
|
|
764
|
+
│ └── default_models.yaml # 25 个厂商的元数据
|
|
765
|
+
├── dynamic_builder/ # 动态构建系统(按需生成工具)
|
|
766
|
+
├── repl/ # REPL 命令路由
|
|
767
|
+
│ ├── router.py # 命令路由表
|
|
768
|
+
│ └── commands/ # 40+ 命令处理器
|
|
769
|
+
│ ├── config/ # 配置类(model/key/providers/limit/lang)
|
|
770
|
+
│ └── system/ # 系统类(autostart/status/hermes/setup)
|
|
771
|
+
├── weapon/ # 武器库(文件/网络/邮件/云盘/RAG/视觉/OCR/图表)
|
|
772
|
+
├── memory/ # 记忆系统(历史/会话/上下文/压缩)
|
|
773
|
+
├── addon/ # 插件机制
|
|
774
|
+
├── breakthrough/ # 自动更新
|
|
775
|
+
├── gatekeeper/ # Gatekeeper 守护
|
|
776
|
+
├── lang/ # 国际化(zh/en)
|
|
777
|
+
└── security/ # 4 阶安全确认引擎
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
## 📚 文档
|
|
781
|
+
|
|
782
|
+
- [AGENTS.md](AGENTS.md) - 面向 AI 编码助手的项目架构与开发指南
|
|
783
|
+
- [fr_cli/README.md](fr_cli/README.md) - 项目内部说明
|
|
784
|
+
|
|
785
|
+
## 📂 配置目录
|
|
786
|
+
|
|
787
|
+
> 配置统一在 `~/.fr_cli/` 目录下,旧路径(如 `~/.zhipu_cli_config.json`)会在首次启动时自动迁移。
|
|
788
|
+
|
|
789
|
+
| 路径 | 说明 |
|
|
790
|
+
|------|------|
|
|
791
|
+
| `~/.fr_cli/config.json` | 主配置文件(scheme v3,含 default_provider / backup_provider / autostart_on_launch) |
|
|
792
|
+
| `~/.fr_cli/config.json.bak` | 配置自动备份 |
|
|
793
|
+
| `~/.fr_cli/history/` | 会话历史记录 |
|
|
794
|
+
| `~/.fr_cli/sessions/manual/` | 手动保存的会话 |
|
|
795
|
+
| `~/.fr_cli/sessions/auto/` | 按日期自动存档的会话 |
|
|
796
|
+
| `~/.fr_cli/context.json` | 上下文记忆摘要 |
|
|
797
|
+
| `~/.fr_cli/usage.json` | LLM 用量统计(文件权限 0o600) |
|
|
798
|
+
| `~/.fr_cli/plugins/` | 用户插件目录 |
|
|
799
|
+
| `~/.fr_cli/agents/<name>/` | Agent 分身目录 |
|
|
800
|
+
| `~/.fr_cli/master/` | MasterAgent 记忆与进化记录 |
|
|
801
|
+
| `~/.fr_cli/dynamic_tools/` | 动态构建生成的工具目录 |
|
|
802
|
+
| `~/.fr_cli/hermes/` | Hermes 任务 / 目标 / 审核队列 / 日志 |
|
|
803
|
+
| `~/.fr_cli/daemon/` | Gatekeeper 守护进程配置 |
|
|
804
|
+
| `~/.fr_cli/cron.json` | 定时任务配置 |
|
|
805
|
+
| `~/.fr_cli/remotes.json` | 远程主机配置 |
|
|
806
|
+
| `~/.fr_cli/databases.json` | 数据库连接配置 |
|
|
807
|
+
| `~/.fr_cli/rag_db/` | RAG 向量库(ChromaDB) |
|
|
808
|
+
| `~/.fr_cli/rag/` | RAG 监控日志 |
|
|
809
|
+
| `~/.fr_cli/m365.json` | Microsoft 365 OAuth Token 缓存(0o600) |
|
|
810
|
+
| `~/.fr_cli/stock.json` | 股票数据源与模拟交易记录 |
|
|
811
|
+
|
|
812
|
+
## ❓ 常见问题
|
|
813
|
+
|
|
814
|
+
**Q: 如何切换思维模式?**
|
|
815
|
+
```bash
|
|
816
|
+
/mode direct # 直接回复
|
|
817
|
+
/mode cot # 思维链
|
|
818
|
+
/mode tot # 思维树
|
|
819
|
+
/mode react # ReAct
|
|
820
|
+
/mode plan # 计划模式(独立模块)
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
**Q: 如何配置模型?**
|
|
824
|
+
```bash
|
|
825
|
+
# 推荐:6 步配置向导
|
|
826
|
+
/model config
|
|
827
|
+
# 或
|
|
828
|
+
/providers setup
|
|
829
|
+
|
|
830
|
+
# 启动时按 default → backup 自动降级,可通过 /status json 查看当前激活来源
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
**Q: 切换的模型重启后失效?**
|
|
834
|
+
使用 `/model config` 配置后会持久化到 `~/.fr_cli/config.json`(写入 `default_provider` / `providers.*`)。重启仍然生效。仅 `/model xxx` 临时切换会随会话结束失效。
|
|
835
|
+
|
|
836
|
+
**Q: 如何保存/加载会话?**
|
|
837
|
+
```bash
|
|
838
|
+
/save my-session # 手动保存到 sessions/manual/
|
|
839
|
+
/load # 列出并选择手动保存的会话
|
|
840
|
+
/session_list # 列出按日期自动存档的会话
|
|
841
|
+
/export # 导出当前会话为 Markdown
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
**Q: Token 上下文压缩?**
|
|
845
|
+
会话历史累积超过阈值(默认 4000 token)时自动压缩为摘要,保留最近 N 轮完整对话。压缩摘要注入 system prompt,降低 token 成本。
|
|
846
|
+
```bash
|
|
847
|
+
/context status # 查看当前状态
|
|
848
|
+
/context compress # 手动触发压缩
|
|
849
|
+
/context threshold 8000 # 调整阈值
|
|
850
|
+
/context keep 10 # 调整保留轮数
|
|
851
|
+
```
|
|
852
|
+
配置位于 `~/.fr_cli/config.json` 的 `memory` 命名空间。
|
|
853
|
+
|
|
854
|
+
**Q: MasterAgent 默认开启吗?需要关掉?**
|
|
855
|
+
v2.6+ 默认启用。普通对话自动进入 ReAct 循环(自主调用工具 / 反思)。如想恢复传统流式对话:
|
|
856
|
+
```bash
|
|
857
|
+
/master off
|
|
858
|
+
```
|
|
859
|
+
所有原有 `/`、`!`、`@` 前缀行为不变。
|
|
860
|
+
|
|
861
|
+
**Q: 邮件发送失败?**
|
|
862
|
+
QQ/163 邮箱需使用「授权码」而非登录密码。授权码在邮箱设置 → 账户 → 开启 IMAP/SMTP 服务后生成。
|
|
863
|
+
|
|
864
|
+
**Q: Microsoft 365 / Outlook 邮箱如何使用?**
|
|
865
|
+
Microsoft 365 已禁用基本认证,需使用 OAuth2 现代认证:
|
|
866
|
+
1. 在 Azure AD 注册应用,添加 `Mail.Read`、`Mail.Send`、`User.Read` 委派权限
|
|
867
|
+
2. 复制 Application (client) ID 和 Directory (tenant) ID
|
|
868
|
+
3. 执行 `/m365_config setup`,按向导完成设备码或授权码登录(支持 MFA)
|
|
869
|
+
4. 使用 `/m365_inbox`、`/m365_read <id>`、`/m365_send`
|
|
870
|
+
|
|
871
|
+
Token 缓存于 `~/.fr_cli/m365.json`,文件权限 `0o600`。
|
|
872
|
+
|
|
873
|
+
**Q: OCR 使用?**
|
|
874
|
+
```bash
|
|
875
|
+
/ocr_config setup # 交互式配置(选 vision / paddle 引擎)
|
|
876
|
+
/ocr screenshot.png # 识别图片
|
|
877
|
+
/ocr invoice.pdf # 识别 PDF(需 pip install pymupdf)
|
|
878
|
+
```
|
|
879
|
+
Vision 引擎复用全局 provider 配置(如 `zhipu / glm-4v`);PaddleOCR 为本地引擎,需 `pip install paddleocr paddlepaddle`。
|
|
880
|
+
|
|
881
|
+
**Q: 股票数据源?**
|
|
882
|
+
```bash
|
|
883
|
+
/stock_config setup # 交互式配置向导
|
|
884
|
+
/stock_config source akshare # 切换数据源(akshare / 麦蕊 / tushare)
|
|
885
|
+
/stock_config key mairui <key> # 配置麦蕊 API Key
|
|
886
|
+
/stock 查询茅台股价
|
|
887
|
+
/stock 买入 600519 1500.00 100 # 模拟交易(需先 /stock_config trade)
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
**Q: 搜索功能无法使用?**
|
|
891
|
+
```bash
|
|
892
|
+
pip install requests
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
**Q: 云盘功能无法使用?**
|
|
896
|
+
```bash
|
|
897
|
+
pip install aligo # 阿里云盘
|
|
898
|
+
pip install bypy # 百度网盘
|
|
899
|
+
```
|
|
900
|
+
首次使用需运行 `/disk_setup` 完成扫码登录。
|
|
901
|
+
|
|
902
|
+
**Q: 启动时自动拉起了后台服务,怎么关?**
|
|
903
|
+
```json
|
|
904
|
+
// ~/.fr_cli/config.json
|
|
905
|
+
{
|
|
906
|
+
"autostart_on_launch": false
|
|
907
|
+
}
|
|
908
|
+
```
|
|
909
|
+
或单独控制:
|
|
910
|
+
```bash
|
|
911
|
+
/hermes stop # 停止 Hermes 守护进程
|
|
912
|
+
/gatekeeper stop # 停止 Gatekeeper 守护进程
|
|
913
|
+
/master off # 关闭 MasterAgent 主控
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
## 📄 License
|
|
917
|
+
|
|
918
|
+
MIT
|