PraisonAI 3.0.0__py3-none-any.whl
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.
- praisonai/__init__.py +54 -0
- praisonai/__main__.py +15 -0
- praisonai/acp/__init__.py +54 -0
- praisonai/acp/config.py +159 -0
- praisonai/acp/server.py +587 -0
- praisonai/acp/session.py +219 -0
- praisonai/adapters/__init__.py +50 -0
- praisonai/adapters/readers.py +395 -0
- praisonai/adapters/rerankers.py +315 -0
- praisonai/adapters/retrievers.py +394 -0
- praisonai/adapters/vector_stores.py +409 -0
- praisonai/agent_scheduler.py +337 -0
- praisonai/agents_generator.py +903 -0
- praisonai/api/call.py +292 -0
- praisonai/auto.py +1197 -0
- praisonai/capabilities/__init__.py +275 -0
- praisonai/capabilities/a2a.py +140 -0
- praisonai/capabilities/assistants.py +283 -0
- praisonai/capabilities/audio.py +320 -0
- praisonai/capabilities/batches.py +469 -0
- praisonai/capabilities/completions.py +336 -0
- praisonai/capabilities/container_files.py +155 -0
- praisonai/capabilities/containers.py +93 -0
- praisonai/capabilities/embeddings.py +158 -0
- praisonai/capabilities/files.py +467 -0
- praisonai/capabilities/fine_tuning.py +293 -0
- praisonai/capabilities/guardrails.py +182 -0
- praisonai/capabilities/images.py +330 -0
- praisonai/capabilities/mcp.py +190 -0
- praisonai/capabilities/messages.py +270 -0
- praisonai/capabilities/moderations.py +154 -0
- praisonai/capabilities/ocr.py +217 -0
- praisonai/capabilities/passthrough.py +204 -0
- praisonai/capabilities/rag.py +207 -0
- praisonai/capabilities/realtime.py +160 -0
- praisonai/capabilities/rerank.py +165 -0
- praisonai/capabilities/responses.py +266 -0
- praisonai/capabilities/search.py +109 -0
- praisonai/capabilities/skills.py +133 -0
- praisonai/capabilities/vector_store_files.py +334 -0
- praisonai/capabilities/vector_stores.py +304 -0
- praisonai/capabilities/videos.py +141 -0
- praisonai/chainlit_ui.py +304 -0
- praisonai/chat/__init__.py +106 -0
- praisonai/chat/app.py +125 -0
- praisonai/cli/__init__.py +26 -0
- praisonai/cli/app.py +213 -0
- praisonai/cli/commands/__init__.py +75 -0
- praisonai/cli/commands/acp.py +70 -0
- praisonai/cli/commands/completion.py +333 -0
- praisonai/cli/commands/config.py +166 -0
- praisonai/cli/commands/debug.py +142 -0
- praisonai/cli/commands/diag.py +55 -0
- praisonai/cli/commands/doctor.py +166 -0
- praisonai/cli/commands/environment.py +179 -0
- praisonai/cli/commands/lsp.py +112 -0
- praisonai/cli/commands/mcp.py +210 -0
- praisonai/cli/commands/profile.py +457 -0
- praisonai/cli/commands/run.py +228 -0
- praisonai/cli/commands/schedule.py +150 -0
- praisonai/cli/commands/serve.py +97 -0
- praisonai/cli/commands/session.py +212 -0
- praisonai/cli/commands/traces.py +145 -0
- praisonai/cli/commands/version.py +101 -0
- praisonai/cli/configuration/__init__.py +18 -0
- praisonai/cli/configuration/loader.py +353 -0
- praisonai/cli/configuration/paths.py +114 -0
- praisonai/cli/configuration/schema.py +164 -0
- praisonai/cli/features/__init__.py +268 -0
- praisonai/cli/features/acp.py +236 -0
- praisonai/cli/features/action_orchestrator.py +546 -0
- praisonai/cli/features/agent_scheduler.py +773 -0
- praisonai/cli/features/agent_tools.py +474 -0
- praisonai/cli/features/agents.py +375 -0
- praisonai/cli/features/at_mentions.py +471 -0
- praisonai/cli/features/auto_memory.py +182 -0
- praisonai/cli/features/autonomy_mode.py +490 -0
- praisonai/cli/features/background.py +356 -0
- praisonai/cli/features/base.py +168 -0
- praisonai/cli/features/capabilities.py +1326 -0
- praisonai/cli/features/checkpoints.py +338 -0
- praisonai/cli/features/code_intelligence.py +652 -0
- praisonai/cli/features/compaction.py +294 -0
- praisonai/cli/features/compare.py +534 -0
- praisonai/cli/features/cost_tracker.py +514 -0
- praisonai/cli/features/debug.py +810 -0
- praisonai/cli/features/deploy.py +517 -0
- praisonai/cli/features/diag.py +289 -0
- praisonai/cli/features/doctor/__init__.py +63 -0
- praisonai/cli/features/doctor/checks/__init__.py +24 -0
- praisonai/cli/features/doctor/checks/acp_checks.py +240 -0
- praisonai/cli/features/doctor/checks/config_checks.py +366 -0
- praisonai/cli/features/doctor/checks/db_checks.py +366 -0
- praisonai/cli/features/doctor/checks/env_checks.py +543 -0
- praisonai/cli/features/doctor/checks/lsp_checks.py +199 -0
- praisonai/cli/features/doctor/checks/mcp_checks.py +349 -0
- praisonai/cli/features/doctor/checks/memory_checks.py +268 -0
- praisonai/cli/features/doctor/checks/network_checks.py +251 -0
- praisonai/cli/features/doctor/checks/obs_checks.py +328 -0
- praisonai/cli/features/doctor/checks/performance_checks.py +235 -0
- praisonai/cli/features/doctor/checks/permissions_checks.py +259 -0
- praisonai/cli/features/doctor/checks/selftest_checks.py +322 -0
- praisonai/cli/features/doctor/checks/serve_checks.py +426 -0
- praisonai/cli/features/doctor/checks/skills_checks.py +231 -0
- praisonai/cli/features/doctor/checks/tools_checks.py +371 -0
- praisonai/cli/features/doctor/engine.py +266 -0
- praisonai/cli/features/doctor/formatters.py +310 -0
- praisonai/cli/features/doctor/handler.py +397 -0
- praisonai/cli/features/doctor/models.py +264 -0
- praisonai/cli/features/doctor/registry.py +239 -0
- praisonai/cli/features/endpoints.py +1019 -0
- praisonai/cli/features/eval.py +560 -0
- praisonai/cli/features/external_agents.py +231 -0
- praisonai/cli/features/fast_context.py +410 -0
- praisonai/cli/features/flow_display.py +566 -0
- praisonai/cli/features/git_integration.py +651 -0
- praisonai/cli/features/guardrail.py +171 -0
- praisonai/cli/features/handoff.py +185 -0
- praisonai/cli/features/hooks.py +583 -0
- praisonai/cli/features/image.py +384 -0
- praisonai/cli/features/interactive_runtime.py +585 -0
- praisonai/cli/features/interactive_tools.py +380 -0
- praisonai/cli/features/interactive_tui.py +603 -0
- praisonai/cli/features/jobs.py +632 -0
- praisonai/cli/features/knowledge.py +531 -0
- praisonai/cli/features/lite.py +244 -0
- praisonai/cli/features/lsp_cli.py +225 -0
- praisonai/cli/features/mcp.py +169 -0
- praisonai/cli/features/message_queue.py +587 -0
- praisonai/cli/features/metrics.py +211 -0
- praisonai/cli/features/n8n.py +673 -0
- praisonai/cli/features/observability.py +293 -0
- praisonai/cli/features/ollama.py +361 -0
- praisonai/cli/features/output_style.py +273 -0
- praisonai/cli/features/package.py +631 -0
- praisonai/cli/features/performance.py +308 -0
- praisonai/cli/features/persistence.py +636 -0
- praisonai/cli/features/profile.py +226 -0
- praisonai/cli/features/profiler/__init__.py +81 -0
- praisonai/cli/features/profiler/core.py +558 -0
- praisonai/cli/features/profiler/optimizations.py +652 -0
- praisonai/cli/features/profiler/suite.py +386 -0
- praisonai/cli/features/profiling.py +350 -0
- praisonai/cli/features/queue/__init__.py +73 -0
- praisonai/cli/features/queue/manager.py +395 -0
- praisonai/cli/features/queue/models.py +286 -0
- praisonai/cli/features/queue/persistence.py +564 -0
- praisonai/cli/features/queue/scheduler.py +484 -0
- praisonai/cli/features/queue/worker.py +372 -0
- praisonai/cli/features/recipe.py +1723 -0
- praisonai/cli/features/recipes.py +449 -0
- praisonai/cli/features/registry.py +229 -0
- praisonai/cli/features/repo_map.py +860 -0
- praisonai/cli/features/router.py +466 -0
- praisonai/cli/features/sandbox_executor.py +515 -0
- praisonai/cli/features/serve.py +829 -0
- praisonai/cli/features/session.py +222 -0
- praisonai/cli/features/skills.py +856 -0
- praisonai/cli/features/slash_commands.py +650 -0
- praisonai/cli/features/telemetry.py +179 -0
- praisonai/cli/features/templates.py +1384 -0
- praisonai/cli/features/thinking.py +305 -0
- praisonai/cli/features/todo.py +334 -0
- praisonai/cli/features/tools.py +680 -0
- praisonai/cli/features/tui/__init__.py +83 -0
- praisonai/cli/features/tui/app.py +580 -0
- praisonai/cli/features/tui/cli.py +566 -0
- praisonai/cli/features/tui/debug.py +511 -0
- praisonai/cli/features/tui/events.py +99 -0
- praisonai/cli/features/tui/mock_provider.py +328 -0
- praisonai/cli/features/tui/orchestrator.py +652 -0
- praisonai/cli/features/tui/screens/__init__.py +50 -0
- praisonai/cli/features/tui/screens/main.py +245 -0
- praisonai/cli/features/tui/screens/queue.py +174 -0
- praisonai/cli/features/tui/screens/session.py +124 -0
- praisonai/cli/features/tui/screens/settings.py +148 -0
- praisonai/cli/features/tui/widgets/__init__.py +56 -0
- praisonai/cli/features/tui/widgets/chat.py +261 -0
- praisonai/cli/features/tui/widgets/composer.py +224 -0
- praisonai/cli/features/tui/widgets/queue_panel.py +200 -0
- praisonai/cli/features/tui/widgets/status.py +167 -0
- praisonai/cli/features/tui/widgets/tool_panel.py +248 -0
- praisonai/cli/features/workflow.py +720 -0
- praisonai/cli/legacy.py +236 -0
- praisonai/cli/main.py +5559 -0
- praisonai/cli/schedule_cli.py +54 -0
- praisonai/cli/state/__init__.py +31 -0
- praisonai/cli/state/identifiers.py +161 -0
- praisonai/cli/state/sessions.py +313 -0
- praisonai/code/__init__.py +93 -0
- praisonai/code/agent_tools.py +344 -0
- praisonai/code/diff/__init__.py +21 -0
- praisonai/code/diff/diff_strategy.py +432 -0
- praisonai/code/tools/__init__.py +27 -0
- praisonai/code/tools/apply_diff.py +221 -0
- praisonai/code/tools/execute_command.py +275 -0
- praisonai/code/tools/list_files.py +274 -0
- praisonai/code/tools/read_file.py +206 -0
- praisonai/code/tools/search_replace.py +248 -0
- praisonai/code/tools/write_file.py +217 -0
- praisonai/code/utils/__init__.py +46 -0
- praisonai/code/utils/file_utils.py +307 -0
- praisonai/code/utils/ignore_utils.py +308 -0
- praisonai/code/utils/text_utils.py +276 -0
- praisonai/db/__init__.py +64 -0
- praisonai/db/adapter.py +531 -0
- praisonai/deploy/__init__.py +62 -0
- praisonai/deploy/api.py +231 -0
- praisonai/deploy/docker.py +454 -0
- praisonai/deploy/doctor.py +367 -0
- praisonai/deploy/main.py +327 -0
- praisonai/deploy/models.py +179 -0
- praisonai/deploy/providers/__init__.py +33 -0
- praisonai/deploy/providers/aws.py +331 -0
- praisonai/deploy/providers/azure.py +358 -0
- praisonai/deploy/providers/base.py +101 -0
- praisonai/deploy/providers/gcp.py +314 -0
- praisonai/deploy/schema.py +208 -0
- praisonai/deploy.py +185 -0
- praisonai/endpoints/__init__.py +53 -0
- praisonai/endpoints/a2u_server.py +410 -0
- praisonai/endpoints/discovery.py +165 -0
- praisonai/endpoints/providers/__init__.py +28 -0
- praisonai/endpoints/providers/a2a.py +253 -0
- praisonai/endpoints/providers/a2u.py +208 -0
- praisonai/endpoints/providers/agents_api.py +171 -0
- praisonai/endpoints/providers/base.py +231 -0
- praisonai/endpoints/providers/mcp.py +263 -0
- praisonai/endpoints/providers/recipe.py +206 -0
- praisonai/endpoints/providers/tools_mcp.py +150 -0
- praisonai/endpoints/registry.py +131 -0
- praisonai/endpoints/server.py +161 -0
- praisonai/inbuilt_tools/__init__.py +24 -0
- praisonai/inbuilt_tools/autogen_tools.py +117 -0
- praisonai/inc/__init__.py +2 -0
- praisonai/inc/config.py +96 -0
- praisonai/inc/models.py +155 -0
- praisonai/integrations/__init__.py +56 -0
- praisonai/integrations/base.py +303 -0
- praisonai/integrations/claude_code.py +270 -0
- praisonai/integrations/codex_cli.py +255 -0
- praisonai/integrations/cursor_cli.py +195 -0
- praisonai/integrations/gemini_cli.py +222 -0
- praisonai/jobs/__init__.py +67 -0
- praisonai/jobs/executor.py +425 -0
- praisonai/jobs/models.py +230 -0
- praisonai/jobs/router.py +314 -0
- praisonai/jobs/server.py +186 -0
- praisonai/jobs/store.py +203 -0
- praisonai/llm/__init__.py +66 -0
- praisonai/llm/registry.py +382 -0
- praisonai/mcp_server/__init__.py +152 -0
- praisonai/mcp_server/adapters/__init__.py +74 -0
- praisonai/mcp_server/adapters/agents.py +128 -0
- praisonai/mcp_server/adapters/capabilities.py +168 -0
- praisonai/mcp_server/adapters/cli_tools.py +568 -0
- praisonai/mcp_server/adapters/extended_capabilities.py +462 -0
- praisonai/mcp_server/adapters/knowledge.py +93 -0
- praisonai/mcp_server/adapters/memory.py +104 -0
- praisonai/mcp_server/adapters/prompts.py +306 -0
- praisonai/mcp_server/adapters/resources.py +124 -0
- praisonai/mcp_server/adapters/tools_bridge.py +280 -0
- praisonai/mcp_server/auth/__init__.py +48 -0
- praisonai/mcp_server/auth/api_key.py +291 -0
- praisonai/mcp_server/auth/oauth.py +460 -0
- praisonai/mcp_server/auth/oidc.py +289 -0
- praisonai/mcp_server/auth/scopes.py +260 -0
- praisonai/mcp_server/cli.py +852 -0
- praisonai/mcp_server/elicitation.py +445 -0
- praisonai/mcp_server/icons.py +302 -0
- praisonai/mcp_server/recipe_adapter.py +573 -0
- praisonai/mcp_server/recipe_cli.py +824 -0
- praisonai/mcp_server/registry.py +703 -0
- praisonai/mcp_server/sampling.py +422 -0
- praisonai/mcp_server/server.py +490 -0
- praisonai/mcp_server/tasks.py +443 -0
- praisonai/mcp_server/transports/__init__.py +18 -0
- praisonai/mcp_server/transports/http_stream.py +376 -0
- praisonai/mcp_server/transports/stdio.py +132 -0
- praisonai/persistence/__init__.py +84 -0
- praisonai/persistence/config.py +238 -0
- praisonai/persistence/conversation/__init__.py +25 -0
- praisonai/persistence/conversation/async_mysql.py +427 -0
- praisonai/persistence/conversation/async_postgres.py +410 -0
- praisonai/persistence/conversation/async_sqlite.py +371 -0
- praisonai/persistence/conversation/base.py +151 -0
- praisonai/persistence/conversation/json_store.py +250 -0
- praisonai/persistence/conversation/mysql.py +387 -0
- praisonai/persistence/conversation/postgres.py +401 -0
- praisonai/persistence/conversation/singlestore.py +240 -0
- praisonai/persistence/conversation/sqlite.py +341 -0
- praisonai/persistence/conversation/supabase.py +203 -0
- praisonai/persistence/conversation/surrealdb.py +287 -0
- praisonai/persistence/factory.py +301 -0
- praisonai/persistence/hooks/__init__.py +18 -0
- praisonai/persistence/hooks/agent_hooks.py +297 -0
- praisonai/persistence/knowledge/__init__.py +26 -0
- praisonai/persistence/knowledge/base.py +144 -0
- praisonai/persistence/knowledge/cassandra.py +232 -0
- praisonai/persistence/knowledge/chroma.py +295 -0
- praisonai/persistence/knowledge/clickhouse.py +242 -0
- praisonai/persistence/knowledge/cosmosdb_vector.py +438 -0
- praisonai/persistence/knowledge/couchbase.py +286 -0
- praisonai/persistence/knowledge/lancedb.py +216 -0
- praisonai/persistence/knowledge/langchain_adapter.py +291 -0
- praisonai/persistence/knowledge/lightrag_adapter.py +212 -0
- praisonai/persistence/knowledge/llamaindex_adapter.py +256 -0
- praisonai/persistence/knowledge/milvus.py +277 -0
- praisonai/persistence/knowledge/mongodb_vector.py +306 -0
- praisonai/persistence/knowledge/pgvector.py +335 -0
- praisonai/persistence/knowledge/pinecone.py +253 -0
- praisonai/persistence/knowledge/qdrant.py +301 -0
- praisonai/persistence/knowledge/redis_vector.py +291 -0
- praisonai/persistence/knowledge/singlestore_vector.py +299 -0
- praisonai/persistence/knowledge/surrealdb_vector.py +309 -0
- praisonai/persistence/knowledge/upstash_vector.py +266 -0
- praisonai/persistence/knowledge/weaviate.py +223 -0
- praisonai/persistence/migrations/__init__.py +10 -0
- praisonai/persistence/migrations/manager.py +251 -0
- praisonai/persistence/orchestrator.py +406 -0
- praisonai/persistence/state/__init__.py +21 -0
- praisonai/persistence/state/async_mongodb.py +200 -0
- praisonai/persistence/state/base.py +107 -0
- praisonai/persistence/state/dynamodb.py +226 -0
- praisonai/persistence/state/firestore.py +175 -0
- praisonai/persistence/state/gcs.py +155 -0
- praisonai/persistence/state/memory.py +245 -0
- praisonai/persistence/state/mongodb.py +158 -0
- praisonai/persistence/state/redis.py +190 -0
- praisonai/persistence/state/upstash.py +144 -0
- praisonai/persistence/tests/__init__.py +3 -0
- praisonai/persistence/tests/test_all_backends.py +633 -0
- praisonai/profiler.py +1214 -0
- praisonai/recipe/__init__.py +134 -0
- praisonai/recipe/bridge.py +278 -0
- praisonai/recipe/core.py +893 -0
- praisonai/recipe/exceptions.py +54 -0
- praisonai/recipe/history.py +402 -0
- praisonai/recipe/models.py +266 -0
- praisonai/recipe/operations.py +440 -0
- praisonai/recipe/policy.py +422 -0
- praisonai/recipe/registry.py +849 -0
- praisonai/recipe/runtime.py +214 -0
- praisonai/recipe/security.py +711 -0
- praisonai/recipe/serve.py +859 -0
- praisonai/recipe/server.py +613 -0
- praisonai/scheduler/__init__.py +45 -0
- praisonai/scheduler/agent_scheduler.py +552 -0
- praisonai/scheduler/base.py +124 -0
- praisonai/scheduler/daemon_manager.py +225 -0
- praisonai/scheduler/state_manager.py +155 -0
- praisonai/scheduler/yaml_loader.py +193 -0
- praisonai/scheduler.py +194 -0
- praisonai/setup/__init__.py +1 -0
- praisonai/setup/build.py +21 -0
- praisonai/setup/post_install.py +23 -0
- praisonai/setup/setup_conda_env.py +25 -0
- praisonai/setup.py +16 -0
- praisonai/templates/__init__.py +116 -0
- praisonai/templates/cache.py +364 -0
- praisonai/templates/dependency_checker.py +358 -0
- praisonai/templates/discovery.py +391 -0
- praisonai/templates/loader.py +564 -0
- praisonai/templates/registry.py +511 -0
- praisonai/templates/resolver.py +206 -0
- praisonai/templates/security.py +327 -0
- praisonai/templates/tool_override.py +498 -0
- praisonai/templates/tools_doctor.py +256 -0
- praisonai/test.py +105 -0
- praisonai/train.py +562 -0
- praisonai/train_vision.py +306 -0
- praisonai/ui/agents.py +824 -0
- praisonai/ui/callbacks.py +57 -0
- praisonai/ui/chainlit_compat.py +246 -0
- praisonai/ui/chat.py +532 -0
- praisonai/ui/code.py +717 -0
- praisonai/ui/colab.py +474 -0
- praisonai/ui/colab_chainlit.py +81 -0
- praisonai/ui/components/aicoder.py +284 -0
- praisonai/ui/context.py +283 -0
- praisonai/ui/database_config.py +56 -0
- praisonai/ui/db.py +294 -0
- praisonai/ui/realtime.py +488 -0
- praisonai/ui/realtimeclient/__init__.py +756 -0
- praisonai/ui/realtimeclient/tools.py +242 -0
- praisonai/ui/sql_alchemy.py +710 -0
- praisonai/upload_vision.py +140 -0
- praisonai/version.py +1 -0
- praisonai-3.0.0.dist-info/METADATA +3493 -0
- praisonai-3.0.0.dist-info/RECORD +393 -0
- praisonai-3.0.0.dist-info/WHEEL +5 -0
- praisonai-3.0.0.dist-info/entry_points.txt +4 -0
- praisonai-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Completion command group for PraisonAI CLI.
|
|
3
|
+
|
|
4
|
+
Provides shell completion script generation:
|
|
5
|
+
- completion bash: Generate bash completions
|
|
6
|
+
- completion zsh: Generate zsh completions
|
|
7
|
+
- completion fish: Generate fish completions
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
from ..output.console import get_output_controller
|
|
13
|
+
|
|
14
|
+
app = typer.Typer(help="Shell completion scripts")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
BASH_COMPLETION = '''
|
|
18
|
+
# PraisonAI bash completion
|
|
19
|
+
_praisonai_completion() {
|
|
20
|
+
local cur prev opts
|
|
21
|
+
COMPREPLY=()
|
|
22
|
+
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
23
|
+
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
24
|
+
|
|
25
|
+
# Top-level commands
|
|
26
|
+
opts="run config traces env session schedule serve completion version debug lsp diag doctor acp mcp chat code call realtime train ui context research memory rules workflow hooks knowledge tools todo docs commit skills profile eval templates recipe endpoints agents thinking compaction output deploy registry package install uninstall"
|
|
27
|
+
|
|
28
|
+
# Subcommands for specific commands
|
|
29
|
+
case "${prev}" in
|
|
30
|
+
config)
|
|
31
|
+
COMPREPLY=( $(compgen -W "list get set reset path" -- ${cur}) )
|
|
32
|
+
return 0
|
|
33
|
+
;;
|
|
34
|
+
traces)
|
|
35
|
+
COMPREPLY=( $(compgen -W "enable disable status list" -- ${cur}) )
|
|
36
|
+
return 0
|
|
37
|
+
;;
|
|
38
|
+
env)
|
|
39
|
+
COMPREPLY=( $(compgen -W "view check doctor" -- ${cur}) )
|
|
40
|
+
return 0
|
|
41
|
+
;;
|
|
42
|
+
session)
|
|
43
|
+
COMPREPLY=( $(compgen -W "list resume delete export show" -- ${cur}) )
|
|
44
|
+
return 0
|
|
45
|
+
;;
|
|
46
|
+
schedule)
|
|
47
|
+
COMPREPLY=( $(compgen -W "start stop list logs restart delete describe save stop-all stats" -- ${cur}) )
|
|
48
|
+
return 0
|
|
49
|
+
;;
|
|
50
|
+
serve)
|
|
51
|
+
COMPREPLY=( $(compgen -W "start stop status" -- ${cur}) )
|
|
52
|
+
return 0
|
|
53
|
+
;;
|
|
54
|
+
completion)
|
|
55
|
+
COMPREPLY=( $(compgen -W "bash zsh fish" -- ${cur}) )
|
|
56
|
+
return 0
|
|
57
|
+
;;
|
|
58
|
+
debug)
|
|
59
|
+
COMPREPLY=( $(compgen -W "interactive lsp acp trace" -- ${cur}) )
|
|
60
|
+
return 0
|
|
61
|
+
;;
|
|
62
|
+
lsp)
|
|
63
|
+
COMPREPLY=( $(compgen -W "start stop status logs" -- ${cur}) )
|
|
64
|
+
return 0
|
|
65
|
+
;;
|
|
66
|
+
diag)
|
|
67
|
+
COMPREPLY=( $(compgen -W "export" -- ${cur}) )
|
|
68
|
+
return 0
|
|
69
|
+
;;
|
|
70
|
+
doctor)
|
|
71
|
+
COMPREPLY=( $(compgen -W "env config tools db mcp obs skills memory permissions network performance ci selftest" -- ${cur}) )
|
|
72
|
+
return 0
|
|
73
|
+
;;
|
|
74
|
+
mcp)
|
|
75
|
+
COMPREPLY=( $(compgen -W "list add remove test" -- ${cur}) )
|
|
76
|
+
return 0
|
|
77
|
+
;;
|
|
78
|
+
*)
|
|
79
|
+
;;
|
|
80
|
+
esac
|
|
81
|
+
|
|
82
|
+
# Global options
|
|
83
|
+
if [[ ${cur} == -* ]] ; then
|
|
84
|
+
COMPREPLY=( $(compgen -W "--help --version --output-format --json --no-color --quiet --verbose --screen-reader" -- ${cur}) )
|
|
85
|
+
return 0
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
89
|
+
return 0
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
complete -F _praisonai_completion praisonai
|
|
93
|
+
'''
|
|
94
|
+
|
|
95
|
+
ZSH_COMPLETION = '''
|
|
96
|
+
#compdef praisonai
|
|
97
|
+
|
|
98
|
+
_praisonai() {
|
|
99
|
+
local -a commands
|
|
100
|
+
local -a subcommands
|
|
101
|
+
|
|
102
|
+
commands=(
|
|
103
|
+
'run:Run agents'
|
|
104
|
+
'config:Configuration management'
|
|
105
|
+
'traces:Trace collection management'
|
|
106
|
+
'env:Environment and diagnostics'
|
|
107
|
+
'session:Session management'
|
|
108
|
+
'schedule:Scheduler management'
|
|
109
|
+
'serve:API server management'
|
|
110
|
+
'completion:Shell completion scripts'
|
|
111
|
+
'version:Version information'
|
|
112
|
+
'debug:Debug and test interactive flows'
|
|
113
|
+
'lsp:LSP service lifecycle'
|
|
114
|
+
'diag:Diagnostics export'
|
|
115
|
+
'doctor:Health checks and diagnostics'
|
|
116
|
+
'acp:Agent Client Protocol server'
|
|
117
|
+
'mcp:MCP server management'
|
|
118
|
+
'chat:Start chat UI'
|
|
119
|
+
'code:Start code UI'
|
|
120
|
+
'call:Start call server'
|
|
121
|
+
'realtime:Start realtime interface'
|
|
122
|
+
'train:Training commands'
|
|
123
|
+
'ui:Start UI'
|
|
124
|
+
'context:Context engineering'
|
|
125
|
+
'research:Deep research'
|
|
126
|
+
'memory:Memory management'
|
|
127
|
+
'rules:Rules management'
|
|
128
|
+
'workflow:Workflow management'
|
|
129
|
+
'hooks:Hooks management'
|
|
130
|
+
'knowledge:Knowledge management'
|
|
131
|
+
'tools:Tools management'
|
|
132
|
+
'todo:Todo management'
|
|
133
|
+
'docs:Documentation'
|
|
134
|
+
'commit:Git commit'
|
|
135
|
+
'skills:Skills management'
|
|
136
|
+
'profile:Profile management'
|
|
137
|
+
'eval:Evaluation'
|
|
138
|
+
'templates:Templates'
|
|
139
|
+
'recipe:Recipe management'
|
|
140
|
+
'endpoints:Endpoints'
|
|
141
|
+
'agents:Agents management'
|
|
142
|
+
'deploy:Deployment'
|
|
143
|
+
'registry:Registry'
|
|
144
|
+
'package:Package management'
|
|
145
|
+
'install:Install packages'
|
|
146
|
+
'uninstall:Uninstall packages'
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
_arguments -C \\
|
|
150
|
+
'--help[Show help]' \\
|
|
151
|
+
'--version[Show version]' \\
|
|
152
|
+
'--output-format[Output format]:format:(text json stream-json)' \\
|
|
153
|
+
'--json[JSON output]' \\
|
|
154
|
+
'--no-color[Disable colors]' \\
|
|
155
|
+
'--quiet[Minimal output]' \\
|
|
156
|
+
'--verbose[Verbose output]' \\
|
|
157
|
+
'--screen-reader[Screen reader mode]' \\
|
|
158
|
+
'1: :->command' \\
|
|
159
|
+
'*::arg:->args'
|
|
160
|
+
|
|
161
|
+
case $state in
|
|
162
|
+
command)
|
|
163
|
+
_describe 'command' commands
|
|
164
|
+
;;
|
|
165
|
+
args)
|
|
166
|
+
case $words[1] in
|
|
167
|
+
config)
|
|
168
|
+
subcommands=('list:List config' 'get:Get value' 'set:Set value' 'reset:Reset config' 'path:Show path')
|
|
169
|
+
_describe 'subcommand' subcommands
|
|
170
|
+
;;
|
|
171
|
+
traces)
|
|
172
|
+
subcommands=('enable:Enable traces' 'disable:Disable traces' 'status:Show status' 'list:List traces')
|
|
173
|
+
_describe 'subcommand' subcommands
|
|
174
|
+
;;
|
|
175
|
+
env)
|
|
176
|
+
subcommands=('view:View env vars' 'check:Check API keys' 'doctor:Run diagnostics')
|
|
177
|
+
_describe 'subcommand' subcommands
|
|
178
|
+
;;
|
|
179
|
+
session)
|
|
180
|
+
subcommands=('list:List sessions' 'resume:Resume session' 'delete:Delete session' 'export:Export session' 'show:Show session')
|
|
181
|
+
_describe 'subcommand' subcommands
|
|
182
|
+
;;
|
|
183
|
+
schedule)
|
|
184
|
+
subcommands=('start:Start scheduler' 'stop:Stop scheduler' 'list:List jobs' 'logs:View logs' 'restart:Restart' 'delete:Delete job' 'describe:Describe job' 'save:Save config' 'stop-all:Stop all' 'stats:Show stats')
|
|
185
|
+
_describe 'subcommand' subcommands
|
|
186
|
+
;;
|
|
187
|
+
serve)
|
|
188
|
+
subcommands=('start:Start server' 'stop:Stop server' 'status:Show status')
|
|
189
|
+
_describe 'subcommand' subcommands
|
|
190
|
+
;;
|
|
191
|
+
completion)
|
|
192
|
+
subcommands=('bash:Bash completion' 'zsh:Zsh completion' 'fish:Fish completion')
|
|
193
|
+
_describe 'subcommand' subcommands
|
|
194
|
+
;;
|
|
195
|
+
debug)
|
|
196
|
+
subcommands=('interactive:Interactive debug' 'lsp:LSP debug' 'acp:ACP debug' 'trace:Trace debug')
|
|
197
|
+
_describe 'subcommand' subcommands
|
|
198
|
+
;;
|
|
199
|
+
lsp)
|
|
200
|
+
subcommands=('start:Start LSP' 'stop:Stop LSP' 'status:LSP status' 'logs:LSP logs')
|
|
201
|
+
_describe 'subcommand' subcommands
|
|
202
|
+
;;
|
|
203
|
+
diag)
|
|
204
|
+
subcommands=('export:Export diagnostics')
|
|
205
|
+
_describe 'subcommand' subcommands
|
|
206
|
+
;;
|
|
207
|
+
doctor)
|
|
208
|
+
subcommands=('env:Check env' 'config:Check config' 'tools:Check tools' 'db:Check DB' 'mcp:Check MCP' 'obs:Check observability' 'skills:Check skills' 'memory:Check memory' 'permissions:Check permissions' 'network:Check network' 'performance:Check performance' 'ci:CI checks' 'selftest:Self test')
|
|
209
|
+
_describe 'subcommand' subcommands
|
|
210
|
+
;;
|
|
211
|
+
mcp)
|
|
212
|
+
subcommands=('list:List servers' 'add:Add server' 'remove:Remove server' 'test:Test server')
|
|
213
|
+
_describe 'subcommand' subcommands
|
|
214
|
+
;;
|
|
215
|
+
esac
|
|
216
|
+
;;
|
|
217
|
+
esac
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
_praisonai "$@"
|
|
221
|
+
'''
|
|
222
|
+
|
|
223
|
+
FISH_COMPLETION = '''
|
|
224
|
+
# PraisonAI fish completion
|
|
225
|
+
|
|
226
|
+
# Top-level commands
|
|
227
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "run" -d "Run agents"
|
|
228
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "config" -d "Configuration management"
|
|
229
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "traces" -d "Trace collection management"
|
|
230
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "env" -d "Environment and diagnostics"
|
|
231
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "session" -d "Session management"
|
|
232
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "schedule" -d "Scheduler management"
|
|
233
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "serve" -d "API server management"
|
|
234
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "completion" -d "Shell completion scripts"
|
|
235
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "version" -d "Version information"
|
|
236
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "debug" -d "Debug and test interactive flows"
|
|
237
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "lsp" -d "LSP service lifecycle"
|
|
238
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "diag" -d "Diagnostics export"
|
|
239
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "doctor" -d "Health checks and diagnostics"
|
|
240
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "acp" -d "Agent Client Protocol server"
|
|
241
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "mcp" -d "MCP server management"
|
|
242
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "chat" -d "Start chat UI"
|
|
243
|
+
complete -c praisonai -f -n "__fish_use_subcommand" -a "code" -d "Start code UI"
|
|
244
|
+
|
|
245
|
+
# Global options
|
|
246
|
+
complete -c praisonai -l help -d "Show help"
|
|
247
|
+
complete -c praisonai -l version -d "Show version"
|
|
248
|
+
complete -c praisonai -l output-format -x -a "text json stream-json" -d "Output format"
|
|
249
|
+
complete -c praisonai -l json -d "JSON output"
|
|
250
|
+
complete -c praisonai -l no-color -d "Disable colors"
|
|
251
|
+
complete -c praisonai -l quiet -s q -d "Minimal output"
|
|
252
|
+
complete -c praisonai -l verbose -s v -d "Verbose output"
|
|
253
|
+
complete -c praisonai -l screen-reader -d "Screen reader mode"
|
|
254
|
+
|
|
255
|
+
# config subcommands
|
|
256
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from config" -a "list" -d "List config"
|
|
257
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from config" -a "get" -d "Get value"
|
|
258
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from config" -a "set" -d "Set value"
|
|
259
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from config" -a "reset" -d "Reset config"
|
|
260
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from config" -a "path" -d "Show path"
|
|
261
|
+
|
|
262
|
+
# traces subcommands
|
|
263
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from traces" -a "enable" -d "Enable traces"
|
|
264
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from traces" -a "disable" -d "Disable traces"
|
|
265
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from traces" -a "status" -d "Show status"
|
|
266
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from traces" -a "list" -d "List traces"
|
|
267
|
+
|
|
268
|
+
# env subcommands
|
|
269
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from env" -a "view" -d "View env vars"
|
|
270
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from env" -a "check" -d "Check API keys"
|
|
271
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from env" -a "doctor" -d "Run diagnostics"
|
|
272
|
+
|
|
273
|
+
# session subcommands
|
|
274
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from session" -a "list" -d "List sessions"
|
|
275
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from session" -a "resume" -d "Resume session"
|
|
276
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from session" -a "delete" -d "Delete session"
|
|
277
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from session" -a "export" -d "Export session"
|
|
278
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from session" -a "show" -d "Show session"
|
|
279
|
+
|
|
280
|
+
# completion subcommands
|
|
281
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from completion" -a "bash" -d "Bash completion"
|
|
282
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from completion" -a "zsh" -d "Zsh completion"
|
|
283
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from completion" -a "fish" -d "Fish completion"
|
|
284
|
+
|
|
285
|
+
# debug subcommands
|
|
286
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from debug" -a "interactive" -d "Interactive debug"
|
|
287
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from debug" -a "lsp" -d "LSP debug"
|
|
288
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from debug" -a "acp" -d "ACP debug"
|
|
289
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from debug" -a "trace" -d "Trace debug"
|
|
290
|
+
|
|
291
|
+
# doctor subcommands
|
|
292
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from doctor" -a "env" -d "Check env"
|
|
293
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from doctor" -a "config" -d "Check config"
|
|
294
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from doctor" -a "tools" -d "Check tools"
|
|
295
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from doctor" -a "db" -d "Check DB"
|
|
296
|
+
complete -c praisonai -f -n "__fish_seen_subcommand_from doctor" -a "mcp" -d "Check MCP"
|
|
297
|
+
'''
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
@app.command("bash")
|
|
301
|
+
def completion_bash():
|
|
302
|
+
"""Generate bash completion script."""
|
|
303
|
+
print(BASH_COMPLETION.strip())
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
@app.command("zsh")
|
|
307
|
+
def completion_zsh():
|
|
308
|
+
"""Generate zsh completion script."""
|
|
309
|
+
print(ZSH_COMPLETION.strip())
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
@app.command("fish")
|
|
313
|
+
def completion_fish():
|
|
314
|
+
"""Generate fish completion script."""
|
|
315
|
+
print(FISH_COMPLETION.strip())
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
@app.callback(invoke_without_command=True)
|
|
319
|
+
def completion_callback(ctx: typer.Context):
|
|
320
|
+
"""Show completion installation instructions."""
|
|
321
|
+
if ctx.invoked_subcommand is None:
|
|
322
|
+
output = get_output_controller()
|
|
323
|
+
output.print_panel(
|
|
324
|
+
"Generate shell completion scripts.\n\n"
|
|
325
|
+
"Usage:\n"
|
|
326
|
+
" # Bash\n"
|
|
327
|
+
" praisonai completion bash >> ~/.bashrc\n\n"
|
|
328
|
+
" # Zsh\n"
|
|
329
|
+
" praisonai completion zsh > ~/.zsh/completions/_praisonai\n\n"
|
|
330
|
+
" # Fish\n"
|
|
331
|
+
" praisonai completion fish > ~/.config/fish/completions/praisonai.fish",
|
|
332
|
+
title="Shell Completions"
|
|
333
|
+
)
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Config command group for PraisonAI CLI.
|
|
3
|
+
|
|
4
|
+
Provides configuration management commands:
|
|
5
|
+
- config list: Show all configuration
|
|
6
|
+
- config get: Get a specific value
|
|
7
|
+
- config set: Set a configuration value
|
|
8
|
+
- config reset: Reset to defaults
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import Optional
|
|
12
|
+
|
|
13
|
+
import typer
|
|
14
|
+
|
|
15
|
+
from ..configuration.loader import get_config_loader
|
|
16
|
+
from ..output.console import get_output_controller
|
|
17
|
+
|
|
18
|
+
app = typer.Typer(help="Configuration management")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@app.command("list")
|
|
22
|
+
def config_list(
|
|
23
|
+
scope: str = typer.Option(
|
|
24
|
+
"all",
|
|
25
|
+
"--scope",
|
|
26
|
+
"-s",
|
|
27
|
+
help="Scope to list: all, user, project",
|
|
28
|
+
),
|
|
29
|
+
):
|
|
30
|
+
"""List all configuration values."""
|
|
31
|
+
output = get_output_controller()
|
|
32
|
+
loader = get_config_loader()
|
|
33
|
+
|
|
34
|
+
config = loader.list_all()
|
|
35
|
+
|
|
36
|
+
if output.is_json_mode:
|
|
37
|
+
output.print_json(config)
|
|
38
|
+
return
|
|
39
|
+
|
|
40
|
+
output.print_panel("Configuration", title="PraisonAI Config")
|
|
41
|
+
|
|
42
|
+
def print_dict(d, prefix=""):
|
|
43
|
+
for key, value in d.items():
|
|
44
|
+
full_key = f"{prefix}.{key}" if prefix else key
|
|
45
|
+
if isinstance(value, dict):
|
|
46
|
+
print_dict(value, full_key)
|
|
47
|
+
else:
|
|
48
|
+
output.print(f" {full_key} = {value}")
|
|
49
|
+
|
|
50
|
+
print_dict(config)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@app.command("get")
|
|
54
|
+
def config_get(
|
|
55
|
+
key: str = typer.Argument(..., help="Configuration key (dotted notation, e.g., output.format)"),
|
|
56
|
+
):
|
|
57
|
+
"""Get a configuration value."""
|
|
58
|
+
output = get_output_controller()
|
|
59
|
+
loader = get_config_loader()
|
|
60
|
+
|
|
61
|
+
value = loader.get(key)
|
|
62
|
+
|
|
63
|
+
if value is None:
|
|
64
|
+
output.print_error(f"Key not found: {key}")
|
|
65
|
+
raise typer.Exit(1)
|
|
66
|
+
|
|
67
|
+
if output.is_json_mode:
|
|
68
|
+
output.print_json({"key": key, "value": value})
|
|
69
|
+
else:
|
|
70
|
+
output.print(f"{key} = {value}")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@app.command("set")
|
|
74
|
+
def config_set(
|
|
75
|
+
key: str = typer.Argument(..., help="Configuration key (dotted notation)"),
|
|
76
|
+
value: str = typer.Argument(..., help="Value to set"),
|
|
77
|
+
scope: str = typer.Option(
|
|
78
|
+
"user",
|
|
79
|
+
"--scope",
|
|
80
|
+
"-s",
|
|
81
|
+
help="Scope: user or project",
|
|
82
|
+
),
|
|
83
|
+
):
|
|
84
|
+
"""Set a configuration value."""
|
|
85
|
+
output = get_output_controller()
|
|
86
|
+
loader = get_config_loader()
|
|
87
|
+
|
|
88
|
+
# Parse value
|
|
89
|
+
if value.lower() == "true":
|
|
90
|
+
parsed_value = True
|
|
91
|
+
elif value.lower() == "false":
|
|
92
|
+
parsed_value = False
|
|
93
|
+
else:
|
|
94
|
+
try:
|
|
95
|
+
parsed_value = int(value)
|
|
96
|
+
except ValueError:
|
|
97
|
+
try:
|
|
98
|
+
parsed_value = float(value)
|
|
99
|
+
except ValueError:
|
|
100
|
+
parsed_value = value
|
|
101
|
+
|
|
102
|
+
loader.set(key, parsed_value, scope=scope)
|
|
103
|
+
|
|
104
|
+
if output.is_json_mode:
|
|
105
|
+
output.print_json({"key": key, "value": parsed_value, "scope": scope})
|
|
106
|
+
else:
|
|
107
|
+
output.print_success(f"Set {key} = {parsed_value} ({scope})")
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@app.command("reset")
|
|
111
|
+
def config_reset(
|
|
112
|
+
scope: str = typer.Option(
|
|
113
|
+
"user",
|
|
114
|
+
"--scope",
|
|
115
|
+
"-s",
|
|
116
|
+
help="Scope to reset: user or project",
|
|
117
|
+
),
|
|
118
|
+
confirm: bool = typer.Option(
|
|
119
|
+
False,
|
|
120
|
+
"--yes",
|
|
121
|
+
"-y",
|
|
122
|
+
help="Skip confirmation",
|
|
123
|
+
),
|
|
124
|
+
):
|
|
125
|
+
"""Reset configuration to defaults."""
|
|
126
|
+
output = get_output_controller()
|
|
127
|
+
|
|
128
|
+
if not confirm:
|
|
129
|
+
confirmed = typer.confirm(f"Reset {scope} configuration to defaults?")
|
|
130
|
+
if not confirmed:
|
|
131
|
+
output.print_info("Cancelled")
|
|
132
|
+
raise typer.Exit(0)
|
|
133
|
+
|
|
134
|
+
loader = get_config_loader()
|
|
135
|
+
loader.reset(scope=scope)
|
|
136
|
+
|
|
137
|
+
if output.is_json_mode:
|
|
138
|
+
output.print_json({"reset": True, "scope": scope})
|
|
139
|
+
else:
|
|
140
|
+
output.print_success(f"Reset {scope} configuration to defaults")
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
@app.command("path")
|
|
144
|
+
def config_path(
|
|
145
|
+
scope: str = typer.Option(
|
|
146
|
+
"user",
|
|
147
|
+
"--scope",
|
|
148
|
+
"-s",
|
|
149
|
+
help="Scope: user or project",
|
|
150
|
+
),
|
|
151
|
+
):
|
|
152
|
+
"""Show configuration file path."""
|
|
153
|
+
output = get_output_controller()
|
|
154
|
+
|
|
155
|
+
from ..configuration.paths import get_user_config_path, get_project_config_path
|
|
156
|
+
|
|
157
|
+
if scope == "project":
|
|
158
|
+
path = get_project_config_path()
|
|
159
|
+
else:
|
|
160
|
+
path = get_user_config_path()
|
|
161
|
+
|
|
162
|
+
if output.is_json_mode:
|
|
163
|
+
output.print_json({"path": str(path), "exists": path.exists()})
|
|
164
|
+
else:
|
|
165
|
+
exists = "✓" if path.exists() else "✗"
|
|
166
|
+
output.print(f"{path} [{exists}]")
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Debug command group for PraisonAI CLI.
|
|
3
|
+
|
|
4
|
+
Wraps existing debug functionality from features/debug.py.
|
|
5
|
+
Provides debug commands for testing interactive flows.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import sys
|
|
9
|
+
from typing import List, Optional
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
from ..output.console import get_output_controller
|
|
14
|
+
|
|
15
|
+
app = typer.Typer(help="Debug and test interactive flows")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@app.command("interactive")
|
|
19
|
+
def debug_interactive(
|
|
20
|
+
prompt: str = typer.Option(..., "--prompt", "-p", help="Prompt to execute"),
|
|
21
|
+
workspace: str = typer.Option(".", "--workspace", "-w", help="Workspace root directory"),
|
|
22
|
+
lsp: bool = typer.Option(True, "--lsp/--no-lsp", help="Enable/disable LSP"),
|
|
23
|
+
acp: bool = typer.Option(True, "--acp/--no-acp", help="Enable/disable ACP"),
|
|
24
|
+
approval: str = typer.Option("auto", "--approval", help="Approval mode: manual, auto, scoped"),
|
|
25
|
+
json_output: bool = typer.Option(False, "--json", help="Output JSON trace"),
|
|
26
|
+
trace_file: Optional[str] = typer.Option(None, "--trace-file", help="Save trace to file"),
|
|
27
|
+
timeout: float = typer.Option(60.0, "--timeout", help="Timeout in seconds"),
|
|
28
|
+
model: Optional[str] = typer.Option(None, "--model", "-m", help="LLM model to use"),
|
|
29
|
+
):
|
|
30
|
+
"""Run single interactive turn non-interactively."""
|
|
31
|
+
output = get_output_controller()
|
|
32
|
+
|
|
33
|
+
# Build args for existing handler
|
|
34
|
+
args = [
|
|
35
|
+
"interactive",
|
|
36
|
+
"--prompt", prompt,
|
|
37
|
+
"--workspace", workspace,
|
|
38
|
+
"--approval", approval,
|
|
39
|
+
"--timeout", str(timeout),
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
if not lsp:
|
|
43
|
+
args.append("--no-lsp")
|
|
44
|
+
if not acp:
|
|
45
|
+
args.append("--no-acp")
|
|
46
|
+
if json_output:
|
|
47
|
+
args.append("--json")
|
|
48
|
+
if trace_file:
|
|
49
|
+
args.extend(["--trace-file", trace_file])
|
|
50
|
+
if model:
|
|
51
|
+
args.extend(["--model", model])
|
|
52
|
+
|
|
53
|
+
# Delegate to existing handler
|
|
54
|
+
try:
|
|
55
|
+
from ..features.debug import run_debug_command
|
|
56
|
+
exit_code = run_debug_command(args)
|
|
57
|
+
raise typer.Exit(exit_code)
|
|
58
|
+
except ImportError as e:
|
|
59
|
+
output.print_error(f"Debug module not available: {e}")
|
|
60
|
+
raise typer.Exit(4)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@app.command("lsp")
|
|
64
|
+
def debug_lsp(
|
|
65
|
+
workspace: str = typer.Option(".", "--workspace", "-w", help="Workspace root directory"),
|
|
66
|
+
language: Optional[str] = typer.Option(None, "--language", "-l", help="Language to probe"),
|
|
67
|
+
json_output: bool = typer.Option(False, "--json", help="Output JSON"),
|
|
68
|
+
):
|
|
69
|
+
"""Direct LSP probes."""
|
|
70
|
+
args = ["lsp", "--workspace", workspace]
|
|
71
|
+
if language:
|
|
72
|
+
args.extend(["--language", language])
|
|
73
|
+
if json_output:
|
|
74
|
+
args.append("--json")
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
from ..features.debug import run_debug_command
|
|
78
|
+
exit_code = run_debug_command(args)
|
|
79
|
+
raise typer.Exit(exit_code)
|
|
80
|
+
except ImportError as e:
|
|
81
|
+
output = get_output_controller()
|
|
82
|
+
output.print_error(f"Debug module not available: {e}")
|
|
83
|
+
raise typer.Exit(4)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@app.command("acp")
|
|
87
|
+
def debug_acp(
|
|
88
|
+
workspace: str = typer.Option(".", "--workspace", "-w", help="Workspace root directory"),
|
|
89
|
+
json_output: bool = typer.Option(False, "--json", help="Output JSON"),
|
|
90
|
+
):
|
|
91
|
+
"""Direct ACP probes."""
|
|
92
|
+
args = ["acp", "--workspace", workspace]
|
|
93
|
+
if json_output:
|
|
94
|
+
args.append("--json")
|
|
95
|
+
|
|
96
|
+
try:
|
|
97
|
+
from ..features.debug import run_debug_command
|
|
98
|
+
exit_code = run_debug_command(args)
|
|
99
|
+
raise typer.Exit(exit_code)
|
|
100
|
+
except ImportError as e:
|
|
101
|
+
output = get_output_controller()
|
|
102
|
+
output.print_error(f"Debug module not available: {e}")
|
|
103
|
+
raise typer.Exit(4)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@app.command("trace")
|
|
107
|
+
def debug_trace(
|
|
108
|
+
action: str = typer.Argument("list", help="Action: record, replay, diff, list"),
|
|
109
|
+
trace_id: Optional[str] = typer.Option(None, "--trace-id", "-t", help="Trace ID"),
|
|
110
|
+
json_output: bool = typer.Option(False, "--json", help="Output JSON"),
|
|
111
|
+
):
|
|
112
|
+
"""Trace record/replay/diff."""
|
|
113
|
+
args = ["trace", action]
|
|
114
|
+
if trace_id:
|
|
115
|
+
args.extend(["--trace-id", trace_id])
|
|
116
|
+
if json_output:
|
|
117
|
+
args.append("--json")
|
|
118
|
+
|
|
119
|
+
try:
|
|
120
|
+
from ..features.debug import run_debug_command
|
|
121
|
+
exit_code = run_debug_command(args)
|
|
122
|
+
raise typer.Exit(exit_code)
|
|
123
|
+
except ImportError as e:
|
|
124
|
+
output = get_output_controller()
|
|
125
|
+
output.print_error(f"Debug module not available: {e}")
|
|
126
|
+
raise typer.Exit(4)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@app.callback(invoke_without_command=True)
|
|
130
|
+
def debug_callback(ctx: typer.Context):
|
|
131
|
+
"""Show debug help."""
|
|
132
|
+
if ctx.invoked_subcommand is None:
|
|
133
|
+
output = get_output_controller()
|
|
134
|
+
output.print_panel(
|
|
135
|
+
"Debug commands for testing interactive coding assistant flows.\n\n"
|
|
136
|
+
"Commands:\n"
|
|
137
|
+
" interactive Run single interactive turn\n"
|
|
138
|
+
" lsp Direct LSP probes\n"
|
|
139
|
+
" acp Direct ACP probes\n"
|
|
140
|
+
" trace Trace record/replay/diff",
|
|
141
|
+
title="Debug Commands"
|
|
142
|
+
)
|