graph-agents-cli 0.3.1__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.
- graph_agents_cli/__init__.py +26 -0
- graph_agents_cli/_api_policy.py +2145 -0
- graph_agents_cli/_approvals.py +400 -0
- graph_agents_cli/_build.py +186 -0
- graph_agents_cli/_build_info.json +7 -0
- graph_agents_cli/_chat_client.py +462 -0
- graph_agents_cli/_click.py +157 -0
- graph_agents_cli/_defaults.py +139 -0
- graph_agents_cli/_experiments.py +64 -0
- graph_agents_cli/_http.py +192 -0
- graph_agents_cli/_output.py +83 -0
- graph_agents_cli/_project.py +462 -0
- graph_agents_cli/_remote.py +220 -0
- graph_agents_cli/_response_schema.py +264 -0
- graph_agents_cli/_runner.py +319 -0
- graph_agents_cli/_skills_check.py +274 -0
- graph_agents_cli/_tools.py +189 -0
- graph_agents_cli/_trust.py +66 -0
- graph_agents_cli/api/__init__.py +15 -0
- graph_agents_cli/api/_changes.py +506 -0
- graph_agents_cli/api/_files.py +658 -0
- graph_agents_cli/api/cmd_api.py +2480 -0
- graph_agents_cli/deploy/__init__.py +15 -0
- graph_agents_cli/deploy/_config.py +171 -0
- graph_agents_cli/deploy/_image.py +128 -0
- graph_agents_cli/deploy/_kube.py +286 -0
- graph_agents_cli/deploy/_modes.py +234 -0
- graph_agents_cli/deploy/_preflight.py +370 -0
- graph_agents_cli/deploy/_values.py +168 -0
- graph_agents_cli/deploy/cmd_deploy.py +1866 -0
- graph_agents_cli/deploy/gitops.py +562 -0
- graph_agents_cli/deploy/local_load.py +273 -0
- graph_agents_cli/dev/__init__.py +13 -0
- graph_agents_cli/dev/cmd_build.py +131 -0
- graph_agents_cli/dev/cmd_install.py +78 -0
- graph_agents_cli/dev/cmd_lint.py +119 -0
- graph_agents_cli/dev/cmd_playground.py +297 -0
- graph_agents_cli/dev/policy_check.py +1287 -0
- graph_agents_cli/eval/__init__.py +22 -0
- graph_agents_cli/eval/_client.py +670 -0
- graph_agents_cli/eval/_common.py +177 -0
- graph_agents_cli/eval/_judge.py +168 -0
- graph_agents_cli/eval/_judge_runner.py +238 -0
- graph_agents_cli/eval/_paths.py +212 -0
- graph_agents_cli/eval/checks.py +581 -0
- graph_agents_cli/eval/cmd_analyze.py +278 -0
- graph_agents_cli/eval/cmd_compare.py +284 -0
- graph_agents_cli/eval/cmd_eval_group.py +80 -0
- graph_agents_cli/eval/cmd_generate.py +558 -0
- graph_agents_cli/eval/cmd_grade.py +466 -0
- graph_agents_cli/eval/cmd_metric.py +156 -0
- graph_agents_cli/eval/cmd_run.py +370 -0
- graph_agents_cli/eval/cmd_submit.py +400 -0
- graph_agents_cli/eval/config.py +435 -0
- graph_agents_cli/eval/dataset.py +350 -0
- graph_agents_cli/eval/gate.py +420 -0
- graph_agents_cli/eval/transcript.py +192 -0
- graph_agents_cli/extension/__init__.py +13 -0
- graph_agents_cli/extension/_compat.py +86 -0
- graph_agents_cli/extension/_loader.py +293 -0
- graph_agents_cli/extension/_manifest.py +135 -0
- graph_agents_cli/extension/_overrides.py +195 -0
- graph_agents_cli/extension/_paths.py +91 -0
- graph_agents_cli/extension/_refs.py +193 -0
- graph_agents_cli/extension/_resolver.py +453 -0
- graph_agents_cli/extension/_schema.py +106 -0
- graph_agents_cli/extension/_spec.py +253 -0
- graph_agents_cli/extension/_sync.py +102 -0
- graph_agents_cli/extension/_trust.py +58 -0
- graph_agents_cli/extension/cmd_extension_add.py +259 -0
- graph_agents_cli/extension/cmd_extension_group.py +57 -0
- graph_agents_cli/extension/cmd_extension_list.py +56 -0
- graph_agents_cli/extension/cmd_extension_remove.py +61 -0
- graph_agents_cli/extension/cmd_extension_update.py +195 -0
- graph_agents_cli/info/__init__.py +13 -0
- graph_agents_cli/info/cmd_info.py +222 -0
- graph_agents_cli/infra/__init__.py +15 -0
- graph_agents_cli/infra/checks.py +1169 -0
- graph_agents_cli/infra/cmd_infra.py +103 -0
- graph_agents_cli/main.py +591 -0
- graph_agents_cli/peer/__init__.py +15 -0
- graph_agents_cli/peer/_generate.py +254 -0
- graph_agents_cli/peer/cmd_peer.py +1151 -0
- graph_agents_cli/run/__init__.py +13 -0
- graph_agents_cli/run/_local_server.py +1157 -0
- graph_agents_cli/run/_signals.py +141 -0
- graph_agents_cli/run/cmd_approvals.py +530 -0
- graph_agents_cli/run/cmd_run.py +1421 -0
- graph_agents_cli/scaffold/__init__.py +19 -0
- graph_agents_cli/scaffold/agents/README.md +24 -0
- graph_agents_cli/scaffold/agents/empty_py/.template/templateconfig.yaml +22 -0
- graph_agents_cli/scaffold/agents/langgraph/.env.example +292 -0
- graph_agents_cli/scaffold/agents/langgraph/.template/templateconfig.yaml +28 -0
- graph_agents_cli/scaffold/agents/langgraph/Dockerfile +59 -0
- graph_agents_cli/scaffold/agents/langgraph/Dockerfile.langgraph-server +59 -0
- graph_agents_cli/scaffold/agents/langgraph/README.md +571 -0
- graph_agents_cli/scaffold/agents/langgraph/api-policy.yaml +60 -0
- graph_agents_cli/scaffold/agents/langgraph/app/__init__.py +20 -0
- graph_agents_cli/scaffold/agents/langgraph/app/agent.py +174 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/__init__.py +15 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a.py +2162 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a_client.py +1167 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/api_client.py +4220 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/approvals.py +1349 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/auth.py +1986 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/chat.py +2962 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/checkpointer.py +432 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/content.py +569 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/db.py +580 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/limits.py +203 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/metrics.py +231 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/middleware.py +361 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/model.py +611 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/playground.py +230 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/run_locks.py +459 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/structured.py +755 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/telemetry.py +681 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/threads.py +493 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/token_exchange.py +959 -0
- graph_agents_cli/scaffold/agents/langgraph/app/fast_api_app.py +770 -0
- graph_agents_cli/scaffold/agents/langgraph/app/policies/__init__.py +55 -0
- graph_agents_cli/scaffold/agents/langgraph/app/policies/custom.py +97 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/__init__.py +46 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/example_api.py +92 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/weather.py +33 -0
- graph_agents_cli/scaffold/agents/langgraph/langgraph.json +14 -0
- graph_agents_cli/scaffold/agents/langgraph/pyproject.toml +78 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/conftest.py +376 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/eval/datasets/basic-dataset.json +53 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/eval/eval_config.yaml +32 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/approval_graph.py +137 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_issuer.py +216 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_openai.py +357 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_outcomes.py +569 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_relay.py +479 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_api_surface.py +812 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals.py +1367 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals_server.py +794 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor.py +497 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor_server.py +247 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_history_repair.py +278 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_model_apis.py +242 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_postgres.py +637 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_resilience_postgres.py +770 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_runtime_guardrails.py +854 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_e2e.py +340 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_runtime.py +989 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_answers.py +584 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_server.py +222 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_token_exchange_issuer.py +650 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/.results/.placeholder +0 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/README.md +22 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/conftest.py +21 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/load_test.py +81 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_client.py +824 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_scoping.py +724 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client.py +1214 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client_hardening.py +716 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_policy_rpc.py +767 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_approval_ledger.py +1536 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_fake_model.py +115 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_jwt_policy.py +991 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_limits.py +310 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging.py +148 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging_hardening.py +271 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_policy.py +378 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_resilience.py +610 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_server_auth.py +702 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_structured.py +673 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_telemetry.py +404 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_thread_listing.py +255 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_threads.py +268 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_token_exchange.py +1320 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_untrusted_content.py +393 -0
- graph_agents_cli/scaffold/agents/langgraph/uv-fastapi.lock +2084 -0
- graph_agents_cli/scaffold/agents/langgraph/uv-langgraph-server.lock +2106 -0
- graph_agents_cli/scaffold/agents/langgraph/{{cookiecutter.agent_guidance_filename}} +129 -0
- graph_agents_cli/scaffold/base_templates/_shared/graph-agents-cli-manifest.yaml +36 -0
- graph_agents_cli/scaffold/base_templates/python/.dockerignore +32 -0
- graph_agents_cli/scaffold/base_templates/python/.github/CODEOWNERS +30 -0
- graph_agents_cli/scaffold/base_templates/python/.github/agent.env +7 -0
- graph_agents_cli/scaffold/base_templates/python/.github/workflows/pr_checks.yaml +214 -0
- graph_agents_cli/scaffold/base_templates/python/.gitignore +209 -0
- graph_agents_cli/scaffold/base_templates/python/tests/unit/test_dummy.py +23 -0
- graph_agents_cli/scaffold/base_templates/python/{{cookiecutter.agent_guidance_filename}} +35 -0
- graph_agents_cli/scaffold/cmd_scaffold_group.py +49 -0
- graph_agents_cli/scaffold/commands/__init__.py +13 -0
- graph_agents_cli/scaffold/commands/create.py +1424 -0
- graph_agents_cli/scaffold/commands/enhance.py +1652 -0
- graph_agents_cli/scaffold/commands/upgrade.py +570 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/agent.env +12 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/promote-to-prod.yaml +371 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/staging.yaml +450 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-dev.yaml +43 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-prod.yaml +41 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-staging.yaml +43 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/.helmignore +14 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/Chart.yaml +21 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/examples/networkpolicy.yaml +103 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/NOTES.txt +48 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/_helpers.tpl +189 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/certificate.yaml +15 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/configmap.yaml +10 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/deployment.yaml +199 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/hpa.yaml +22 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/httproute.yaml +30 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/ingress.yaml +39 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/networkpolicy.yaml +48 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/pdb.yaml +13 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/postgresql-secret.yaml +37 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/service.yaml +15 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/serviceaccount.yaml +13 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/servicemonitor.yaml +42 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-dev.yaml +22 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-prod.yaml +45 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-staging.yaml +29 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values.yaml +396 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/tests/integration/test_chart.py +269 -0
- graph_agents_cli/scaffold/deployment_targets/none/README.md +5 -0
- graph_agents_cli/scaffold/deployment_targets/none/python/README.md +6 -0
- graph_agents_cli/scaffold/utils/__init__.py +13 -0
- graph_agents_cli/scaffold/utils/backup.py +212 -0
- graph_agents_cli/scaffold/utils/build_record.py +257 -0
- graph_agents_cli/scaffold/utils/cli_options.py +184 -0
- graph_agents_cli/scaffold/utils/fs.py +83 -0
- graph_agents_cli/scaffold/utils/generate_locks.py +214 -0
- graph_agents_cli/scaffold/utils/generation_metadata.py +88 -0
- graph_agents_cli/scaffold/utils/keyedit.py +768 -0
- graph_agents_cli/scaffold/utils/keymerge.py +537 -0
- graph_agents_cli/scaffold/utils/language.py +138 -0
- graph_agents_cli/scaffold/utils/lock_utils.py +94 -0
- graph_agents_cli/scaffold/utils/logging.py +77 -0
- graph_agents_cli/scaffold/utils/manifest.py +292 -0
- graph_agents_cli/scaffold/utils/merge.py +970 -0
- graph_agents_cli/scaffold/utils/merge3.py +216 -0
- graph_agents_cli/scaffold/utils/openapi_seed.py +199 -0
- graph_agents_cli/scaffold/utils/remote_template.py +376 -0
- graph_agents_cli/scaffold/utils/template.py +1352 -0
- graph_agents_cli/scaffold/utils/upgrade.py +894 -0
- graph_agents_cli/scaffold/utils/version.py +438 -0
- graph_agents_cli/secrets/__init__.py +15 -0
- graph_agents_cli/secrets/_apply.py +954 -0
- graph_agents_cli/secrets/_required.py +188 -0
- graph_agents_cli/secrets/cmd_secrets.py +211 -0
- graph_agents_cli/setup/__init__.py +13 -0
- graph_agents_cli/setup/_antigravity.py +221 -0
- graph_agents_cli/setup/cmd_auth.py +1030 -0
- graph_agents_cli/setup/cmd_dev_token.py +513 -0
- graph_agents_cli/setup/cmd_setup.py +428 -0
- graph_agents_cli/setup/cmd_update.py +140 -0
- graph_agents_cli/skills/__init__.py +13 -0
- graph_agents_cli/skills/_bundle.py +65 -0
- graph_agents_cli/skills/data/README.md +19 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/SKILL.md +357 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/github-settings.md +113 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/gitops.md +137 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/kubernetes.md +315 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/secrets.md +160 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/SKILL.md +303 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/references/dataset_schema.md +282 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/references/metrics-guide.md +143 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/SKILL.md +659 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langchain-models.md +124 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langgraph.md +235 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/template-contract.md +477 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/SKILL.md +231 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/references/langsmith.md +46 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/references/otel.md +59 -0
- graph_agents_cli/skills/data/graph-agents-cli-scaffold/SKILL.md +414 -0
- graph_agents_cli/skills/data/graph-agents-cli-scaffold/references/flags.md +134 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/SKILL.md +478 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/brainstorming.md +118 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/commands.md +419 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/extension.md +156 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/internals.md +67 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/spec-template.md +56 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/terminology.md +119 -0
- graph_agents_cli/system/__init__.py +15 -0
- graph_agents_cli/system/_apply.py +519 -0
- graph_agents_cli/system/_checks.py +1023 -0
- graph_agents_cli/system/_deploy.py +215 -0
- graph_agents_cli/system/_model.py +363 -0
- graph_agents_cli/system/_system.py +664 -0
- graph_agents_cli/system/_views.py +208 -0
- graph_agents_cli/system/cmd_system.py +423 -0
- graph_agents_cli-0.3.1.dist-info/METADATA +162 -0
- graph_agents_cli-0.3.1.dist-info/RECORD +291 -0
- graph_agents_cli-0.3.1.dist-info/WHEEL +4 -0
- graph_agents_cli-0.3.1.dist-info/entry_points.txt +2 -0
- graph_agents_cli-0.3.1.dist-info/licenses/LICENSE +201 -0
- graph_agents_cli-0.3.1.dist-info/licenses/NOTICE +19 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
# Command reference
|
|
2
|
+
|
|
3
|
+
Every `graph-agents-cli` command with its flags, as `graph-agents-cli <command> --help` prints
|
|
4
|
+
them. The help is authoritative and ends with a `Source:` line pointing at the implementing file.
|
|
5
|
+
Commands are loaded lazily; nothing imports a model SDK, LangGraph, or a Kubernetes client at
|
|
6
|
+
startup.
|
|
7
|
+
|
|
8
|
+
| Phase | Commands |
|
|
9
|
+
|---|---|
|
|
10
|
+
| Setup | `setup` · `update` · `login` · `auth dev-token` |
|
|
11
|
+
| Scaffold | `create` (alias of `scaffold create`) · `scaffold enhance` · `scaffold upgrade` |
|
|
12
|
+
| Develop | `playground` · `run` · `install` · `lint` · `build` |
|
|
13
|
+
| Evaluate | `eval run` · `eval generate` · `eval grade` · `eval compare` · `eval analyze` · `eval submit` · `eval metric list` |
|
|
14
|
+
| Deploy | `infra check` · `secrets apply` · `secrets status` · `deploy` |
|
|
15
|
+
| Extend / inspect | `extension add\|list\|remove\|update` · `info` |
|
|
16
|
+
|
|
17
|
+
Exit codes, for every command: `0` ok; `1` refused by policy or mode, a declined confirmation,
|
|
18
|
+
or a failed gate (a lint violation, an agent that answered with an error, `scaffold enhance`
|
|
19
|
+
with required steps left); `2` tool failure (helm/kubectl/docker/git/gh non-zero or missing from
|
|
20
|
+
`PATH`, a local server that cannot start, an agent that cannot be reached, `uvx` missing or unable
|
|
21
|
+
to fetch the prior build for `scaffold upgrade` or a version-locked `scaffold enhance`, an
|
|
22
|
+
unexpected crash); `3` configuration error (not in a project, an invalid manifest, including a
|
|
23
|
+
missing or unreleased `cli_version` for `scaffold upgrade`, env file, policy, port or kube
|
|
24
|
+
context, an unusable `GRAPH_AGENTS_CLI_INSTALL_SPEC`, a `scaffold upgrade --baseline-ref` that
|
|
25
|
+
names no build or a build of another version). A signal ends a command with 128+N (130 for Ctrl-C, 143 for SIGTERM) after the local
|
|
26
|
+
server it started is stopped. `secrets status` exits `1` when the Secret or a *required* key is
|
|
27
|
+
missing (`--strict`: any allow-listed key). `eval` exit codes are in `/graph-agents-cli-eval`.
|
|
28
|
+
`GRAPH_AGENTS_CLI_DEBUG=1` shows the traceback behind a one-line network, file or parse error.
|
|
29
|
+
|
|
30
|
+
## Setup
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
graph-agents-cli setup [--workspace] [--dry-run] [--dev] [--skills-source TEXT] [--agent TEXT]...
|
|
34
|
+
graph-agents-cli update [--workspace] [-i/--interactive] [-y/--yes]
|
|
35
|
+
graph-agents-cli login [--profile default|disconnected] [--cluster] [--write-env] [--env-file FILE] [--status] [--json]
|
|
36
|
+
graph-agents-cli auth dev-token --sub TEXT [--roles TEXT] [--ttl TEXT]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `setup` installs the CLI (`uv tool install <install spec>`: the running version's git tag, or
|
|
40
|
+
`GRAPH_AGENTS_CLI_INSTALL_SPEC`) and the six `graph-agents-cli-*` skills into detected coding
|
|
41
|
+
agents through `npx skills add` from this repository at the running release's tag
|
|
42
|
+
(`https://github.com/ss7172/graph-agents-cli#v<version>`; the default branch for a development
|
|
43
|
+
build), falling back to the wheel-bundled copy, then to a direct copy into `~/.agents/skills`
|
|
44
|
+
(`./.agents/skills` with `--workspace`). `--agent` is repeatable (`claude-code`, `cursor`, ...
|
|
45
|
+
or `all`); `--dev` installs the CLI editable from the checkout and the skills from it;
|
|
46
|
+
`--skills-source` picks another source (no fallback). It performs no authentication.
|
|
47
|
+
- `update` refreshes the skills (`npx skills update`), then reinstalls the CLI from the latest
|
|
48
|
+
GitHub release (`uv tool install --force <install spec>`; skipped when there is no newer
|
|
49
|
+
release; a failure is a warning, a malformed `GRAPH_AGENTS_CLI_INSTALL_SPEC` is exit 3) and
|
|
50
|
+
installs that release's skills from its tag.
|
|
51
|
+
- `login` is a preflight check, not an authentication: the provider key for `MODEL_PROVIDER`
|
|
52
|
+
(`OPENAI_BASE_URL` for `openai-compatible`), the judge key, `LANGSMITH_API_KEY` or an OTLP
|
|
53
|
+
endpoint when `TRACING_ENABLED=true`, the kube context (`--cluster` also runs
|
|
54
|
+
`kubectl cluster-info`). Provider precedence: `MODEL_PROVIDER` from the environment or `.env`
|
|
55
|
+
(the value the app reads at runtime) > the manifest's `create_params.model_provider` > `openai`;
|
|
56
|
+
`MODEL_PROVIDER=fake` is accepted as the test-only provider (warning, no key check, allowed
|
|
57
|
+
under the disconnected profile) and `JUDGE_MODEL_PROVIDER=fake` is ok. `--write-env` prompts for
|
|
58
|
+
missing keys without echoing and writes them to `.env` (default `<project>/.env`, or
|
|
59
|
+
`--env-file`): a blank `KEY=` line (also `export KEY=` and `KEY=""`) is filled in place, other
|
|
60
|
+
keys are appended, the file is written atomically and kept at mode 0600 (an existing `.env` is
|
|
61
|
+
made 0600 even when nothing is missing; plain `login` warns about one other users can read).
|
|
62
|
+
Under the `shared-bearer` auth policy it also generates a missing `API_KEY` (an unset one is a
|
|
63
|
+
warning, since the local server answers 503 without it). Under `jwt` it warns when no
|
|
64
|
+
verification key is set (`AUTH_JWT_JWKS_URL` or `AUTH_JWT_PUBLIC_KEY`) and when
|
|
65
|
+
`GRAPH_AGENTS_CLI_API_KEY` holds no token for `run` and `eval`, pointing at `auth dev-token`.
|
|
66
|
+
With stdin closed it writes what it has and names the keys left unset. Exit `1` when any check fails; `--status` prints the report and
|
|
67
|
+
exits `0`; `--json` emits the report. `--profile disconnected` fails on any hosted dependency. The CLI stores no
|
|
68
|
+
credentials.
|
|
69
|
+
- `auth dev-token` makes local runs of a `jwt` project work without an identity provider: it
|
|
70
|
+
creates an RSA key pair in `.graph-agents-cli/dev-jwt/` (git ignored, private key 0600) with
|
|
71
|
+
the project's Python (`uv run`, so `install` first), fills blank `AUTH_JWT_PUBLIC_KEY`,
|
|
72
|
+
`AUTH_JWT_ISSUER` (`graph-agents-cli-dev`) and `AUTH_JWT_AUDIENCE` (the project name) in
|
|
73
|
+
`.env` (values already set are used), and prints only the token on stdout, with the principal
|
|
74
|
+
in `AUTH_JWT_PRINCIPAL_CLAIM` and `--roles` in `AUTH_JWT_ROLES_CLAIM` (dotted paths nested);
|
|
75
|
+
`--ttl` defaults to `12h` (at most `7d`). Use it as
|
|
76
|
+
`export GRAPH_AGENTS_CLI_API_KEY="$(graph-agents-cli auth dev-token --sub alice --roles user)"`.
|
|
77
|
+
Exit 3 unless the effective policy is `jwt` and `APP_ENV` is exactly `dev`, or when
|
|
78
|
+
`AUTH_JWT_JWKS_URL` is set, `AUTH_JWT_ALGORITHMS` excludes RS256 or `AUTH_JWT_PUBLIC_KEY`
|
|
79
|
+
holds another key; exit 2 when the project's environment cannot sign. Restart a kept local
|
|
80
|
+
server afterwards (`run --stop-server`). Never deploy the dev key.
|
|
81
|
+
|
|
82
|
+
## Scaffold
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
graph-agents-cli create [PROJECT_NAME]
|
|
86
|
+
-a/--agent TEXT langgraph (default) | local@<path> | <org>/<repo>/<path>@<ref> | https://github.com/org/repo/tree/main/path
|
|
87
|
+
-o/--output-dir PATH parent directory (default: current directory)
|
|
88
|
+
--runtime fastapi | langgraph-server (default: fastapi)
|
|
89
|
+
--model-provider openai | anthropic | gemini | openai-compatible (default: openai; prompted with -i)
|
|
90
|
+
--model TEXT (provider default if omitted)
|
|
91
|
+
--checkpointer memory | postgres (default: postgres for kubernetes, memory for none)
|
|
92
|
+
-d/--deployment-target kubernetes | none (default: kubernetes)
|
|
93
|
+
--registry TEXT (default: ghcr.io/<git origin owner>)
|
|
94
|
+
--cd argocd | helm-push | skip (default: skip; requires --deployment-target kubernetes)
|
|
95
|
+
--auth-policy shared-bearer | jwt | custom (default: shared-bearer)
|
|
96
|
+
--api-policy FILE (validated, then seeds api-policy.yaml; optional)
|
|
97
|
+
--process TEXT (path or string recorded as process: and rendered into the guidance file)
|
|
98
|
+
-p/--prototype (target defaults to none unless given; CD forced to skip)
|
|
99
|
+
-dir/--agent-directory TEXT --agent-guidance-filename TEXT (default AGENTS.md) -bt/--base-template TEXT (remote templates only)
|
|
100
|
+
-i/--interactive -y/--auto-approve/--yes -s/--skip-checks (skips only the uv-on-PATH preflight) --debug
|
|
101
|
+
graph-agents-cli scaffold create [PROJECT_NAME] ... (same command)
|
|
102
|
+
graph-agents-cli scaffold enhance [TEMPLATE_PATH]
|
|
103
|
+
-n/--name TEXT plus the create flags above except --api-policy (--runtime, --model-provider,
|
|
104
|
+
--model, --checkpointer, -d/--deployment-target, --registry, --cd, --auth-policy, --process, -p,
|
|
105
|
+
-dir, --agent-guidance-filename, -bt, -i, -y, -s, --debug) and
|
|
106
|
+
--force --dry-run/--dryrun --prefer-new
|
|
107
|
+
(api-policy.yaml belongs to the project: enhance never touches it; use graph-agents-cli api)
|
|
108
|
+
graph-agents-cli scaffold upgrade [PROJECT_PATH] [--dry-run/--dryrun] [-y/--auto-approve/--yes] [-i/--interactive]
|
|
109
|
+
[--baseline authentic|current] [--baseline-ref REF] [--debug]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`enhance` always enhances the current directory; `TEMPLATE_PATH` names the template to apply and
|
|
113
|
+
is ignored when the manifest records one. A runtime or model-provider change is applied to every
|
|
114
|
+
file it shapes (chart values and `.github/agent.env` merged key by key around your edits) and ends
|
|
115
|
+
with a "Left for you" list; steps marked `(required)` make `enhance` exit 1. Backups go to
|
|
116
|
+
`~/.graph-agents-cli/backups/<dir>_<project id>_<timestamp>` (private; the newest 5 per project are
|
|
117
|
+
kept). Full flag tables and the valid combinations: the `flags.md` reference of
|
|
118
|
+
`/graph-agents-cli-scaffold`.
|
|
119
|
+
|
|
120
|
+
## Develop
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
graph-agents-cli playground [--port INTEGER] [--graph] [--no-open]
|
|
124
|
+
graph-agents-cli run MESSAGE [--mode chat|a2a] [--url TEXT] [--thread-id TEXT]
|
|
125
|
+
[-H/--header 'Key: Value']... [--cookie name=value]... [-f/--file FILE]...
|
|
126
|
+
[--start-server] [--stop-server] [--port INTEGER] [-v/--verbose]
|
|
127
|
+
graph-agents-cli approvals list [--thread-id TEXT] [--all] [--json] [--url TEXT] [-H]... [--cookie]...
|
|
128
|
+
graph-agents-cli approvals approve|reject APPROVAL_ID [--thread-id TEXT] [--comment TEXT] [-v]
|
|
129
|
+
[--url TEXT] [-H]... [--cookie]...
|
|
130
|
+
graph-agents-cli install [--clean] [--locked]
|
|
131
|
+
graph-agents-cli lint [--fix] [--policy-only]
|
|
132
|
+
graph-agents-cli build [--tag TEXT] [--registry TEXT] [--push] [--dry-run]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- `playground`: the selected application with reload and the `/playground` page (`APP_ENV=dev`),
|
|
136
|
+
default port 8000 (a port in use is refused with exit 3 and a free one suggested), browser
|
|
137
|
+
opened unless `--no-open`. Ctrl-C, SIGTERM or SIGHUP stops the whole server tree. `--graph` runs `langgraph dev` under
|
|
138
|
+
either runtime for LangGraph Studio; it bypasses the auth policy and the chat API.
|
|
139
|
+
- `run`: default `--mode chat` against the local server it starts (tracked in
|
|
140
|
+
`.graph-agents-cli/run_server.json`) on the first free port of 18080-18089, or on `--port` /
|
|
141
|
+
`GRAPH_AGENTS_CLI_RUN_PORT` (exit 3 when that port is taken), or against `--url`. Credentials per auth policy,
|
|
142
|
+
locally and with `--url`: a bearer credential goes in `GRAPH_AGENTS_CLI_API_KEY`, sent as
|
|
143
|
+
`Authorization: Bearer <value>` and kept out of argv and shell history (`shared-bearer`: the
|
|
144
|
+
`API_KEY`, and a local run falls back to the one in `.env`; `jwt`: a token, locally from
|
|
145
|
+
`auth dev-token`); `--header` or `--cookie` for `custom`. An explicit `--header
|
|
146
|
+
'Authorization: ...'` wins over the variable. The 401 and 503 hints name what the project's
|
|
147
|
+
policy needs. `--file` attaches UTF-8 text files as extra context. `--start-server` keeps
|
|
148
|
+
the local server for later runs (idle timeout 30 minutes: the next run restarts it, or reuses it
|
|
149
|
+
with a warning when the OS refuses to stop it); `--stop-server` stops it, or exits 2
|
|
150
|
+
naming the processes still running when the OS refuses the signal (a sandbox may let a command
|
|
151
|
+
signal only what it started itself), keeping the record so later runs reuse that server. `-v` adds
|
|
152
|
+
one compact line per SSE event (a run of text deltas is one counted line). The footer (thread
|
|
153
|
+
id and resume command) is printed after an `error` event too, with the run id; a stream that
|
|
154
|
+
drops after the run started is reported as such (not as "could not reach"), with the thread
|
|
155
|
+
to continue. The footer's "Resume with" line prints credential flags redacted
|
|
156
|
+
(`--header 'Authorization: <redacted>'`, `--cookie name=<redacted>`);
|
|
157
|
+
re-supply them. A turn silent for 600 s is reported as "no event from the agent" and leaves the
|
|
158
|
+
server running (a one-off server is still stopped). `--mode a2a` dials the endpoint the agent
|
|
159
|
+
card names only on the origin it was asked for (another origin: refused, nothing sent; the
|
|
160
|
+
local server advertises its own address as `APP_URL`) and needs the optional `a2a` extra
|
|
161
|
+
(the hint prints the `uv tool install` command) and fails with a one-line hint before any server
|
|
162
|
+
starts when it is absent. A run that pauses on a gated call (the API's `approval` block)
|
|
163
|
+
prints the call in full (control characters escaped, never cut); on a terminal, when the
|
|
164
|
+
requester is an approver, it asks `Approve? [y/N]` (Enter rejects) and streams the rest;
|
|
165
|
+
otherwise (no terminal, a `role:` gate, `--mode a2a`) it prints the approval id and the exact
|
|
166
|
+
`approvals approve` / `reject` commands and exits 0 with an "Awaiting approval" line, keeping
|
|
167
|
+
a one-off local server with the in-memory checkpointer running. Streamed agent text and tool
|
|
168
|
+
output are printed with terminal control characters escaped. Exit codes: `0` answered or
|
|
169
|
+
awaiting an approval, `1` the agent refused or reported an error, or the server refused a
|
|
170
|
+
decision, `2` the agent could not be reached or went silent (or the local server could not
|
|
171
|
+
start), `3` configuration error. A signal during `run` stops the server it started before
|
|
172
|
+
exiting.
|
|
173
|
+
- `approvals`: the client of the approval routes, for the project's local server (the running
|
|
174
|
+
one, such as the one a paused `run` kept; with none, a temporary one for `fastapi` with a
|
|
175
|
+
postgres checkpointer and for `langgraph-server`, whose `langgraph dev` keeps its threads
|
|
176
|
+
and the approvals in `.langgraph_api/`; not for `fastapi` with the in-memory checkpointer,
|
|
177
|
+
whose paused run ends with its server) or `--url`, with `run`'s credentials. `list` shows a thread's pending approvals (`--all`: decided ones too),
|
|
178
|
+
or, without `--thread-id`, every one the caller may see (`GET /approvals`: its own and the
|
|
179
|
+
ones a role of its may decide; an agent without that route: the caller's own threads);
|
|
180
|
+
`approve` / `reject` show the call, send only the decision and `--comment`, and stream the
|
|
181
|
+
resumed run. Exit `1` when the server refuses: not an approver (403),
|
|
182
|
+
unknown (404), already decided (409), expired (410). Deciding is the approver's act: never
|
|
183
|
+
approve on the user's behalf.
|
|
184
|
+
- `install`: `uv sync` (`--clean` recreates `.venv`; `--locked` asserts `uv.lock` matches
|
|
185
|
+
`pyproject.toml`) plus re-materialising vendored extensions.
|
|
186
|
+
- `lint`: `ruff check` and `ruff format --check` (`--fix` applies both) plus the static
|
|
187
|
+
API-policy check: `api-policy.yaml` passes the strict schema, and every `*.py` under
|
|
188
|
+
`app/tools/` (subpackages included, the top-level `__init__.py` excluded) declares one literal
|
|
189
|
+
`API_CALLS`, read with `ast` by the CLI and checked against the named API's rules and, when set,
|
|
190
|
+
its OpenAPI spec; `API_CALLS` changed anywhere else (`+=`, `.append()`, a conditional) is a
|
|
191
|
+
violation. A leftover `PRODUCT_CALLS` is an error; a
|
|
192
|
+
project still on `product-policy.yaml` stops with migration steps (exit 3).
|
|
193
|
+
`--policy-only` skips ruff. Each refused call is followed by the `graph-agents-cli api`
|
|
194
|
+
command that would allow it (a reviewed change; propose it, do not run it unasked). A
|
|
195
|
+
project with `app/response_schema.json` (structured final answers) has it checked first:
|
|
196
|
+
a schema the agent would not start with is exit 3, and an `agent.py` that does not pass
|
|
197
|
+
`response_format()` to `create_agent`, or has no `StructuredAnswer()` in its middleware, is
|
|
198
|
+
a warning.
|
|
199
|
+
- `build`: `docker build -t <registry>/<name>:<tag> -f Dockerfile .` (default tag `latest`;
|
|
200
|
+
`--registry` overrides the manifest; `--push` pushes; `--dry-run` prints the commands). Exit `2`
|
|
201
|
+
on a docker failure, `3` without a Dockerfile or with a placeholder (`ghcr.io/CHANGE-ME`) or
|
|
202
|
+
invalid image reference (checked before docker runs, `--dry-run` included).
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
## Outbound API policy
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
graph-agents-cli api add NAME --base-url-env ENV --auth none|bearer|forward|exchange [--token-env ENV]
|
|
209
|
+
[--forward-header H] [--audience AUD] [--scope "S ..."] [--resource URI] [--allow-actorless]
|
|
210
|
+
--access read-only|read-write|custom [--methods M,...] [--openapi PATH]
|
|
211
|
+
[--max-calls-per-run N] [--rate-per-minute N] [--connect-timeout-ms N] [--read-timeout-ms N] [--dry-run]
|
|
212
|
+
graph-agents-cli api access NAME read-only|read-write|custom [--methods M,...] [--dry-run]
|
|
213
|
+
graph-agents-cli api allow NAME (OPERATION_ID [--method M --path P] | --method M --path P) [--methods M,...] [--dry-run]
|
|
214
|
+
graph-agents-cli api deny NAME (OPERATION_ID [--method M --path P] | --method M --path P) [--dry-run]
|
|
215
|
+
graph-agents-cli api revoke NAME (OPERATION_ID | --method M --path P) [--from allowed|denied] [--dry-run]
|
|
216
|
+
graph-agents-cli api limits NAME [--max-calls-per-run N|none] [--rate-per-minute N|none] [--dry-run]
|
|
217
|
+
graph-agents-cli api approval NAME [--methods M,...|none] [--operations OP,...|none]
|
|
218
|
+
[--approvers requester,role:NAME,...] [--timeout-s N] [--add-rule | --rule N] [--remove] [--dry-run]
|
|
219
|
+
graph-agents-cli api remove NAME [--dry-run]
|
|
220
|
+
graph-agents-cli api show [NAME] [--json]
|
|
221
|
+
graph-agents-cli api check
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
- `api-policy.yaml` belongs to the project and evolves with the agent; `create --api-policy`
|
|
225
|
+
only seeds it. There is no default access: `--access` is required on `add`; `read-only` writes
|
|
226
|
+
`[GET, HEAD]`, `read-write` writes `[GET, HEAD, POST, PUT, PATCH, DELETE]`, `custom` writes
|
|
227
|
+
`--methods` (case-insensitive, stored upper-case; `"*"` alone for every method). The file never
|
|
228
|
+
stores a preset name.
|
|
229
|
+
- Every mutating command loads and validates the current file, applies one change, validates the
|
|
230
|
+
result, prints a unified diff of each file it touches (the policy, the manifest's `api_policy`
|
|
231
|
+
and `secrets.keys`, `.env.example`, the chart's `values.yaml` `env`), keeps comments and key
|
|
232
|
+
order, and writes atomically; `--dry-run` prints the diff only. It says whether access widens
|
|
233
|
+
(a reviewed change: CODEOWNERS covers `api-policy.yaml`) or narrows, and which declared calls
|
|
234
|
+
become allowed or refused. What it cannot edit safely is listed under "Left for you".
|
|
235
|
+
- `add` creates the file when absent, copies an `--openapi` spec outside the project to
|
|
236
|
+
`openapi/<name>/`, adds a bearer `token_env` to `secrets.keys`, and documents the variables in
|
|
237
|
+
`.env.example` and the chart values (placeholder `http://CHANGE-ME`). `forward` is refused under
|
|
238
|
+
`langgraph-server`.
|
|
239
|
+
- `allow` on an API without `allowed_operations` creates the list, which narrows access from
|
|
240
|
+
every operation within `allowed_methods` to the listed ones: the command says so. With
|
|
241
|
+
`openapi:` recorded, `allow` and `deny` by operation id check that the id exists and fill in its
|
|
242
|
+
method and path.
|
|
243
|
+
- `revoke` removes the entries naming the operation; with `--method` only that method goes (an
|
|
244
|
+
entry pinning several keeps the others, and an entry without `methods` keeps every other
|
|
245
|
+
method, now listed); `--from` picks the list when both match; removing the last
|
|
246
|
+
`allowed_operations` entry is refused (it would allow every operation).
|
|
247
|
+
- `remove` drops the API (and its token from `secrets.keys` when no other API uses it); the last
|
|
248
|
+
one removes `api-policy.yaml` and the manifest's `api_policy`, so every call is refused.
|
|
249
|
+
- `approval` sets the calls that wait for a human before they are sent: `--methods` (every
|
|
250
|
+
call with them; `"*"` for all), `--operations` (operation ids; pinned to their method and
|
|
251
|
+
path from the API's `openapi:` spec), `--approvers` (`requester`, the principal who started
|
|
252
|
+
the run, and/or `role:<name>`, another principal holding it: four-eyes without `requester`,
|
|
253
|
+
which needs the `jwt` or `custom` auth policy), `--timeout-s` (30-86400, default 900),
|
|
254
|
+
`--remove`. Each option given replaces that part of the block; `--approvers` is required for
|
|
255
|
+
a new one. It says which declared calls become gated, and whether the change tightens the
|
|
256
|
+
gate (safe) or loosens it (fewer gated calls, a new approver, a longer timeout, removal: a
|
|
257
|
+
reviewed change, like widening access). Approval never widens access; a gate on a method the
|
|
258
|
+
API does not allow is noted. Propose gates for write tools; never loosen one unasked.
|
|
259
|
+
- Other approvers for other calls of one API: `approval --add-rule` (with `--approvers` and
|
|
260
|
+
`--methods`/`--operations`) appends a rule, turning the block into a list of rules (comments
|
|
261
|
+
kept); it never loosens the gate. A call is gated by the first rule in file order that covers
|
|
262
|
+
it, with that rule's approvers; later rules that also cover it do not apply. A call that an
|
|
263
|
+
earlier rule covers only because it names no operation id (an entry by `operationId` alone),
|
|
264
|
+
and that a later rule with other approvers also covers, is refused at runtime and by `lint`:
|
|
265
|
+
pin path and methods in the earlier rule (with an `openapi:` spec, `--operations` does) and
|
|
266
|
+
name `operation_id` on every call; the command notes such a rule and does not call the change
|
|
267
|
+
safe. `--rule N`
|
|
268
|
+
changes, or with `--remove` removes, rule N (`approval[N]`, from 0, as `show` numbers them);
|
|
269
|
+
on a list of several rules a command without `--add-rule` or `--rule` is refused (exit 2),
|
|
270
|
+
and `--remove` alone removes every rule. It says which declared calls get other approvers,
|
|
271
|
+
and when a rule that now covers more takes calls from a later rule with other approvers (a
|
|
272
|
+
loosening). Replacing a single block's operations and approvers at once also prints the
|
|
273
|
+
`--add-rule` command that would keep the old gate.
|
|
274
|
+
- `show` prints the effective policy per API (auth, methods and preset, allowed and denied
|
|
275
|
+
operations, limits, openapi, timeouts, approval) and every tool's declared calls with their
|
|
276
|
+
status, hint and approvers when gated, and the rule that gates each (`--json`: `approval`
|
|
277
|
+
and `approval_rules` per API, `approval` per call with `rule`, `rule_index` and
|
|
278
|
+
`also_covered_by`, a `gated` count); `check` is `lint --policy-only` (same exit codes; gated
|
|
279
|
+
calls are listed, not violations; calls several rules cover and rules that never apply are
|
|
280
|
+
noted).
|
|
281
|
+
- Exit codes: `0` changed (or nothing to change), `1` `check` found a refused call, `2` usage
|
|
282
|
+
error, `3` an invalid result (nothing written), an invalid current file (`check` and `lint`
|
|
283
|
+
too), or not in a project.
|
|
284
|
+
## Evaluate
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
graph-agents-cli eval run [--dataset TEXT] [--url TEXT] [--concurrency N] [-H/--header]... [--cookie]...
|
|
288
|
+
[--app-name TEXT] [--timeout SECONDS] [--config PATH] [-o/--output TEXT]
|
|
289
|
+
[--judge-provider TEXT] [--judge-model TEXT] [--judge-timeout SECONDS]
|
|
290
|
+
graph-agents-cli eval generate [--dataset TEXT] [-o/--output TEXT] [--url TEXT] [--concurrency N] [-H/--header]... [--cookie]...
|
|
291
|
+
[--app-name TEXT] [--timeout SECONDS]
|
|
292
|
+
graph-agents-cli eval grade [--traces PATH] [--dataset TEXT] [--config PATH] [-o/--output TEXT]
|
|
293
|
+
[--judge-provider TEXT] [--judge-model TEXT] [--judge-timeout SECONDS]
|
|
294
|
+
graph-agents-cli eval compare BASELINE CANDIDATE [--fail-on-regression] [--json]
|
|
295
|
+
graph-agents-cli eval analyze [--results TEXT] [--output TEXT] [--top-k N] [--judge] [--judge-provider TEXT] [--judge-model TEXT]
|
|
296
|
+
graph-agents-cli eval submit [--results TEXT] [--traces TEXT] [--dataset TEXT] [--dataset-name TEXT] [--experiment TEXT] [--endpoint TEXT]
|
|
297
|
+
graph-agents-cli eval metric list [--json]
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Datasets `tests/eval/datasets/*.json` (`--dataset` defaults to `basic-dataset.json`, else every
|
|
301
|
+
file); config `tests/eval/eval_config.yaml`; traces `artifacts/traces/traces_<ts>.json`; results
|
|
302
|
+
`artifacts/grade_results/results_<ts>.json`; analyses `artifacts/analysis_<ts>.json` (a `_2`,
|
|
303
|
+
`_3`, ... suffix is added when two runs land in the same second). `eval run` chains generate and
|
|
304
|
+
grade and returns the worse exit code; it honours extension overrides of both `eval.generate` and
|
|
305
|
+
`eval.grade`. `eval grade` defaults to the newest traces file. `eval submit` uploads the dataset
|
|
306
|
+
and a results file to LangSmith as an experiment (needs `LANGSMITH_API_KEY` and the `langsmith`
|
|
307
|
+
extra; optional, never required). Credentials as for `run`: a bearer credential goes in
|
|
308
|
+
`GRAPH_AGENTS_CLI_API_KEY` (locally a `shared-bearer` project's `API_KEY` from `.env`; a `jwt`
|
|
309
|
+
project needs a token, e.g. from `auth dev-token`); a 401 prints the policy's hint. With `--url`,
|
|
310
|
+
a warning names the target (credentials in the URL shown as `***@`, never stored in traces or
|
|
311
|
+
results) and the write methods `api-policy.yaml` allows: every tool call runs for real there.
|
|
312
|
+
`eval grade` warns when the agent or the judge ran on the fake model (a met gate is then a
|
|
313
|
+
plumbing check only). A case that reaches a gated call decides it with its `approvals`
|
|
314
|
+
instructions (an unmatched gate is a case error): a `requester` gate as the eval identity, a
|
|
315
|
+
`role:` gate as `GRAPH_AGENTS_CLI_APPROVER_API_KEY` when set. Details: `/graph-agents-cli-eval`.
|
|
316
|
+
|
|
317
|
+
## Deploy
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
graph-agents-cli infra check [--env TEXT] [--profile disconnected] [--json]
|
|
321
|
+
graph-agents-cli secrets apply --env TEXT [--env-file TEXT] [--context TEXT] [-y/--yes] [--rotate-api-key] [--dry-run]
|
|
322
|
+
graph-agents-cli secrets status --env TEXT [--context TEXT] [--strict] [--dry-run]
|
|
323
|
+
graph-agents-cli deploy --env TEXT [--image TEXT] [--env-file TEXT] [--context TEXT] [-y/--yes] [--status] [--restart]
|
|
324
|
+
[--force-direct] [--dry-run] [--tag TEXT] [--timeout DURATION] [--atomic/--no-atomic] [--rotate-api-key]
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
- `infra check` is read-only: reports the required tools and the kube context, Gateway API CRDs
|
|
328
|
+
and `GatewayClass`es, `IngressClass`es, cert-manager (only when `tls.certManager.enabled`),
|
|
329
|
+
Argo CD (only when `cd: argocd`), metrics-server (only when `hpa.enabled`), the namespace, the
|
|
330
|
+
image pull secret, the app Secret and its required keys, every `CHANGE-ME` placeholder
|
|
331
|
+
(registry, chart image and env, CODEOWNERS, Argo CD `repoURL`), and, when `gh` is logged in,
|
|
332
|
+
the GitHub `production`/`staging` environments, `main` branch protection and (helm-push) the
|
|
333
|
+
`DEPLOY_KUBECONFIG` environment secrets. `--profile disconnected` adds the
|
|
334
|
+
disconnected-profile checks (no hosted dependency). Never creates anything.
|
|
335
|
+
- Env file and context rules (`deploy` and `secrets apply`): `--env-file`, else `.env.<env>`;
|
|
336
|
+
only `dev` falls back to `.env` (exit 3 otherwise). The kube context is `--context`, else
|
|
337
|
+
`environments.<env>.context`, else the kubeconfig's current one, which outside `dev` needs a
|
|
338
|
+
confirmation prompt or `--yes` (exit 1 without); an explicit context missing from the kubeconfig
|
|
339
|
+
is exit 3. The context and API server are always printed first.
|
|
340
|
+
- `secrets apply` creates the namespace when missing and applies the Opaque Secret
|
|
341
|
+
`<release>-app` from the allow-listed keys (`secrets.keys` in the manifest) of the env file with
|
|
342
|
+
server-side apply (a 0600 temporary `--from-env-file` piped into `kubectl apply --server-side`);
|
|
343
|
+
allow-listed keys the file leaves out are kept from the live Secret. Under `shared-bearer` (the
|
|
344
|
+
only policy that reads `API_KEY`) the live `API_KEY` wins unless the file sets another and
|
|
345
|
+
`--rotate-api-key` is passed, and a missing one is generated and written to the env file (0600),
|
|
346
|
+
never printed; other policies get none. With `METRICS_TOKEN` allow-listed it is also applied
|
|
347
|
+
alone to `<release>-metrics` (the ServiceMonitor's token). It is not refused under CI; keeping application
|
|
348
|
+
secrets out of CI is the documented procedure. `--dry-run` prints the pipeline and a redacted
|
|
349
|
+
manifest. `secrets status` lists present, missing required, missing optional and unexpected
|
|
350
|
+
keys without values: exit `0` all required keys present, `1` the Secret or a required key missing
|
|
351
|
+
(`--strict`: any), `2` kubectl failed, `3` configuration error.
|
|
352
|
+
- `deploy` behaviour depends on `create_params.cd` and the kube context (see the mode table in
|
|
353
|
+
`/graph-agents-cli-deploy`). `--tag` sets the tag of a local build (default: the short git sha,
|
|
354
|
+
plus `-dirty-<time>` for uncommitted changes, else a UTC timestamp); in argocd mode without
|
|
355
|
+
`--image` it is the tag written into the values file. Before building anything, direct mode
|
|
356
|
+
checks that the Secret it would produce holds every required key (exit 1) and that no other helm
|
|
357
|
+
operation holds the release (exit 2). helm runs with `--wait --timeout <--timeout, default 5m>`;
|
|
358
|
+
a failed rollout prints this release's pod diagnostics and, with `--atomic` (default), rolls back
|
|
359
|
+
this run's revision (or uninstalls a first install that never succeeded) and puts the app Secret
|
|
360
|
+
(and `<release>-metrics`) back to its values from before the run, keys this run removed
|
|
361
|
+
included, or deletes it when this run created it; a Secret someone else changed meanwhile is
|
|
362
|
+
left alone and the error says so. `--status` (argocd mode with the `argocd` CLI: `argocd app
|
|
363
|
+
get`) waits at most `--timeout` (default 60s) for the rollout, prints replicas, image, helm
|
|
364
|
+
revision and each pod's state, and exits 1 with diagnostics when it is not ready (or the
|
|
365
|
+
Deployment does not exist), 2 when kubectl fails. `--restart` runs `kubectl rollout restart`
|
|
366
|
+
(after secret rotation) and waits up to `--timeout` (default 5m) for the new pods: exit 2 with
|
|
367
|
+
diagnostics when they never become ready (the old pods keep serving);
|
|
368
|
+
`--force-direct` allows a workstation deploy to staging/prod in `helm-push` mode, which is
|
|
369
|
+
otherwise refused outside CI even with `--image`; `--dry-run` prints the docker, helm, kubectl
|
|
370
|
+
and gh commands and the rendered manifests without running them and never prompts (except
|
|
371
|
+
`helm dependency build`, which is executed when subcharts are missing because the render needs
|
|
372
|
+
them). `deploy --env staging|prod` refuses while the manifest has
|
|
373
|
+
`auth_policy_implemented: false`.
|
|
374
|
+
|
|
375
|
+
## Extensions and info
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
graph-agents-cli extension add REFERENCE [--global] [--ref TEXT] [-i/--interactive] [-y/--yes]
|
|
379
|
+
graph-agents-cli extension list
|
|
380
|
+
graph-agents-cli extension update [NAME] [-i/--interactive] [-y/--yes]
|
|
381
|
+
graph-agents-cli extension remove NAME [-i/--interactive] [-y/--yes]
|
|
382
|
+
graph-agents-cli info [--json]
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
`extension add` takes a git reference (`org/repo`, a URL, `--ref`) or a local path (`/abs`,
|
|
386
|
+
`./rel`, `../rel`, `~/dir`, or `local@<path>`); a local source is recorded relative to the project
|
|
387
|
+
root (absolute with `--global`). A bad local path is exit 3, a git or network failure exit 2.
|
|
388
|
+
`extension update` resolves the tracked ref first and reports "Already up to date" when nothing
|
|
389
|
+
changed, without a trust prompt; new third-party code needs a prompt or `-y`. Without a terminal
|
|
390
|
+
(CI, a pipe) the trust gate never prompts: `add` and `update` of untrusted code exit 1 with a hint
|
|
391
|
+
to pass `-y`, and `update` keeps the old pin.
|
|
392
|
+
|
|
393
|
+
`info` prints the CLI version, its build (`CLI build:` the id `--version` prints, `0.2.0` for
|
|
394
|
+
a release and `0.2.0+g<commit>` for a build between releases, with the full commit; `--json`:
|
|
395
|
+
`cli_build`), install path and installed skills (from `npx skills list`, which is not run with
|
|
396
|
+
`GRAPH_AGENTS_CLI_NO_UPDATE_CHECK=1` or in CI: "not listed", `--json`:
|
|
397
|
+
`installed_skills_skipped`) plus, inside a project: the version and build that scaffolded it
|
|
398
|
+
(`Scaffolded with:`, from the manifest's `cli_build`), name, base template,
|
|
399
|
+
agent directory, runtime, model provider and model, checkpointer, deployment target, registry,
|
|
400
|
+
CD mode, auth policy, the API policy file (or none), `process`, the environments with their
|
|
401
|
+
namespaces, and active extensions with their sources and conflicts.
|
|
402
|
+
|
|
403
|
+
## Environment variables (CLI side)
|
|
404
|
+
|
|
405
|
+
| Variable | Effect |
|
|
406
|
+
|---|---|
|
|
407
|
+
| `GRAPH_AGENTS_CLI_NO_UPDATE_CHECK=1` | disables the GitHub release check, the skills-version check and `info`'s skills listing (`npx skills list`; `info` says "not listed") (disconnected profile; CI markers do the same) |
|
|
408
|
+
| `GRAPH_AGENTS_CLI_INSTALL_SPEC` | where `setup`, `update`, the `scaffold upgrade` baseline and generated projects' CI install the CLI from (a mirror, a wheel); `{version}` is replaced by the version needed, a release number, so it cannot name a build between releases (`scaffold upgrade --baseline-ref` does); control characters and whitespace are refused (exit 3), except the spaces of `name @ url` |
|
|
409
|
+
| `GRAPH_AGENTS_CLI_RUN_PORT` | port of the local server `run` and `eval generate` start |
|
|
410
|
+
| `GRAPH_AGENTS_CLI_DEBUG=1` | print the traceback behind a one-line network, file or parse error |
|
|
411
|
+
| `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY` (SOCKS too), `NO_PROXY` | used for `--url` agents and other remote requests; the local server (`run`, `approvals`, `eval`) is never reached through a proxy; a proxy the CLI cannot use is a one-line error (exit 3) |
|
|
412
|
+
| `GRAPH_AGENTS_CLI_API_KEY` | bearer credential `run` and `eval` send (locally and with `--url`) when no `Authorization` header is given: the `API_KEY` (`shared-bearer`) or a JWT (`jwt`; locally from `auth dev-token`); keeps it out of argv |
|
|
413
|
+
| `GRAPH_AGENTS_CLI_E2E=1` | opts the CLI repository's slow end-to-end test suite in (contributors only) |
|
|
414
|
+
| `GRAPH_AGENTS_CLI_DISABLE_OVERRIDES=1` | bypass extension overrides (set automatically inside an override) |
|
|
415
|
+
| `GRAPH_AGENTS_CLI_EXTENSION_DIR` | set for an override's process: the extension's directory |
|
|
416
|
+
| `GRAPH_AGENTS_CLI_EXPERIMENTS` | JSON map of experiment toggles (empty mechanism today) |
|
|
417
|
+
| `GRAPH_AGENTS_CLI_SKIP_VERSION_LOCK` | skip the CLI-version mismatch guard on a project |
|
|
418
|
+
| `GH_HOST` (or `GITHUB_HOST`, `GITHUB_SERVER_URL`) | GitHub Enterprise Server host for argocd-mode pull requests and the disconnected-profile CI check |
|
|
419
|
+
| `GITHUB_TOKEN`, `GH_TOKEN`, `GH_ENTERPRISE_TOKEN` | token for the REST fallback when `gh` is not installed (argocd mode) |
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Extensions: override or extend graph-agents-cli
|
|
2
|
+
|
|
3
|
+
An extension overrides or adds a built-in command. It is a directory containing a
|
|
4
|
+
`graph-agents-cli-extension.yaml`, so any git repo can serve as a registry.
|
|
5
|
+
|
|
6
|
+
Two things you can do: **author** an extension (start ad-hoc in the current repo, publish it
|
|
7
|
+
later), or **adopt** an existing one. Extensions change commands; they cannot add a deployment
|
|
8
|
+
target or a framework.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Author an ad-hoc extension (no separate repo)
|
|
13
|
+
|
|
14
|
+
Drop a single file, `graph-agents-cli-extension.yaml`, at the project root (next to
|
|
15
|
+
`graph-agents-cli-manifest.yaml`). It is auto-loaded at project scope, so no `extension add` is
|
|
16
|
+
needed. Commit it and teammates and CI get the same overrides.
|
|
17
|
+
|
|
18
|
+
Only one, at that exact path, and always project scope. For a second one, or to install a local
|
|
19
|
+
extension globally, move it into its own directory and
|
|
20
|
+
`graph-agents-cli extension add local@./path --global`; `#name` picks one out of a directory
|
|
21
|
+
holding several.
|
|
22
|
+
|
|
23
|
+
**Publish it for other repos:** move the same file (and its scripts) into its own git repo and tag
|
|
24
|
+
it; others then `graph-agents-cli extension add <org>/<repo>#<name> --ref v1.0.0`. The file does
|
|
25
|
+
not change; ad-hoc and shared are the same format.
|
|
26
|
+
|
|
27
|
+
### Schema by example (`graph-agents-cli-extension/v1alpha1`)
|
|
28
|
+
|
|
29
|
+
Everything below is optional except `run` on a command (a non-empty list). Unknown keys are
|
|
30
|
+
rejected, so a typo fails loudly.
|
|
31
|
+
|
|
32
|
+
Machine-readable equivalent: `schemas/graph-agents-cli-extension-v1alpha1.schema.json` in the
|
|
33
|
+
graph-agents-cli repo, generated from the models the loader uses. Point a `yaml-language-server`
|
|
34
|
+
modeline at it for editor validation.
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
schema: graph-agents-cli-extension/v1alpha1
|
|
38
|
+
name: my-extension
|
|
39
|
+
description: What this extension does.
|
|
40
|
+
requires:
|
|
41
|
+
agents_cli: ">=0.2,<0.3" # derive from `graph-agents-cli --version`, see below
|
|
42
|
+
on_incompatible: warn # warn (install + warn) | error (refuse at add/update, block its commands if the CLI drifts out)
|
|
43
|
+
|
|
44
|
+
commands:
|
|
45
|
+
override: # replace a built-in; user argv passes through verbatim
|
|
46
|
+
deploy:
|
|
47
|
+
run: ["uv", "run", "scripts/custom_deploy.py"]
|
|
48
|
+
description: SBOM upload and a change-ticket check, then the built-in deploy.
|
|
49
|
+
eval.generate: # dotted name = a subcommand (group.sub)
|
|
50
|
+
run: ["uv", "run", "scripts/eval_generate.py"]
|
|
51
|
+
description: Drive a different chat transport for traces.
|
|
52
|
+
add: # a brand-new command
|
|
53
|
+
compliance-report:
|
|
54
|
+
run: ["python", "scripts/compliance_report.py"]
|
|
55
|
+
description: Generate the quarterly compliance report.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Rules that matter
|
|
59
|
+
|
|
60
|
+
- **`run:` is a command vector** executed with **no shell**; user argv is appended verbatim. Paths
|
|
61
|
+
relative to the extension dir resolve to absolute, and `$GRAPH_AGENTS_CLI_EXTENSION_DIR` locates
|
|
62
|
+
sibling scripts and templates.
|
|
63
|
+
- **You cannot override a command group** (`eval`, `scaffold`, `secrets`, `infra`); override a
|
|
64
|
+
specific subcommand (`eval.generate`, `scaffold.create`, `secrets.apply`, `infra.check`). Peers
|
|
65
|
+
keep their built-in behaviour. `install` and `extension` can never be overridden.
|
|
66
|
+
- **`eval run` honours both stage overrides.** Overriding `eval.generate` or `eval.grade` changes
|
|
67
|
+
the composite `eval run` exactly as it changes the standalone command.
|
|
68
|
+
- **`create` and `scaffold create` are one command:** overriding `scaffold.create` takes over the
|
|
69
|
+
`create` alias too.
|
|
70
|
+
- **Re-invoke the built-in safely.** An override runs with `GRAPH_AGENTS_CLI_DISABLE_OVERRIDES=1`,
|
|
71
|
+
so calling `graph-agents-cli deploy` inside your wrapper hits the built-in (no recursion).
|
|
72
|
+
- **Chaining is done in a wrapper script**, since `run:` is a single vector:
|
|
73
|
+
```bash
|
|
74
|
+
#!/usr/bin/env bash
|
|
75
|
+
set -e
|
|
76
|
+
"$GRAPH_AGENTS_CLI_EXTENSION_DIR/scripts/change_ticket_check.sh" # non-zero here aborts
|
|
77
|
+
graph-agents-cli deploy "$@" # hits the built-in
|
|
78
|
+
```
|
|
79
|
+
- **Start `run:` with a program, not a script.** `["python", "scripts/x.py"]` or
|
|
80
|
+
`["uv", "run", "python", "scripts/x.py"]` works everywhere; a bare `["scripts/x.py"]` relies on a
|
|
81
|
+
shebang and never runs on Windows (the CLI warns).
|
|
82
|
+
- **Conflicts** (same scope, shown in `extension list` and `info`): two extensions claiming one
|
|
83
|
+
command is first-wins. Cross-scope is fine; project wins over user (`--global`).
|
|
84
|
+
- **Declare a compatibility range** with `requires`, always. Run `graph-agents-cli --version` and
|
|
85
|
+
set the lower bound to that `major.minor`. The upper bound is the next minor while the CLI is
|
|
86
|
+
0.x (a 0.x minor release may break compatibility: `>=0.2,<0.3`), the next major from 1.0 on. Let the user pick
|
|
87
|
+
`on_incompatible`; default `warn`.
|
|
88
|
+
- `warn`: installs, runs, warns when out of range.
|
|
89
|
+
- `error`: `extension add`/`update` refuse an out-of-range install, and if a later CLI upgrade
|
|
90
|
+
moves you out of range the extension's commands fail with the range and the fix rather than
|
|
91
|
+
silently running the built-in. The recovery commands (`install`, `extension *`) keep working.
|
|
92
|
+
- `schema` tracks the manifest format, not the CLI version.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Adopt an existing extension
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
graph-agents-cli extension add <ref> [--global] [--ref <branch|tag|sha>] [--yes]
|
|
100
|
+
graph-agents-cli extension list # what's active, its scope, and its commands
|
|
101
|
+
graph-agents-cli extension update [<name>] # advance the pin (re-resolve the tracked ref)
|
|
102
|
+
graph-agents-cli extension remove <name> # drop it and delete its vendored copy
|
|
103
|
+
graph-agents-cli info # active extensions + sources + conflicts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Reference forms
|
|
107
|
+
|
|
108
|
+
| Form | Meaning |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| `acme/gacli-extensions` | any `org/repo` on github.com |
|
|
111
|
+
| `acme/gacli-extensions#soc2-deploy` | select one extension from a multi-extension repo |
|
|
112
|
+
| `https://git.example.com/acme/gacli-extensions` | any git host: `https://`, `http://`, or `ssh://` |
|
|
113
|
+
| `git@git.example.com:acme/gacli-extensions` | the same host, scp form |
|
|
114
|
+
| `../my-extension`, `./ext`, `/abs/path`, `~/ext`, `C:\ext`, or `local@<path>` | a local directory (for development); recorded relative to the project root (absolute with `--global`) and resolved from there by `install` and `update`. A bad local path is exit 3; a git or network failure resolving a repository is exit 2 |
|
|
115
|
+
| `<name>` | first-party shorthand (resolves to the graph-agents-cli repository) |
|
|
116
|
+
| `--ref <branch\|tag\|sha>` | pin a branch, tag, or commit SHA |
|
|
117
|
+
|
|
118
|
+
A URL is cloned with your ambient git configuration; graph-agents-cli neither asks for nor stores
|
|
119
|
+
credentials. On a disconnected network, extensions come from an on-network git host or
|
|
120
|
+
`local@` paths.
|
|
121
|
+
|
|
122
|
+
### Scopes
|
|
123
|
+
|
|
124
|
+
- **Project scope (default):** recorded in `graph-agents-cli-extensions.yaml`, working copy
|
|
125
|
+
vendored under `extensions/`. Commit both so it works offline (`install` re-fetches if missing).
|
|
126
|
+
- **User scope (`--global`):** `~/.config/graph-agents-cli/`. Applies to every project on the
|
|
127
|
+
machine. Prefer project scope unless you truly want it machine-wide.
|
|
128
|
+
- When both scopes define the same command, **project wins**; `info` shows the source.
|
|
129
|
+
|
|
130
|
+
### Trust
|
|
131
|
+
|
|
132
|
+
- First-party extensions added via the shorthand form are trusted automatically.
|
|
133
|
+
- Every other reference prompts before install (its commands run arbitrary code when invoked).
|
|
134
|
+
`--yes` skips the prompt; use it only for automation.
|
|
135
|
+
|
|
136
|
+
### Pinning and updates
|
|
137
|
+
|
|
138
|
+
- `extension add` resolves the ref to an exact commit SHA and records `source` / `ref` / `sha`
|
|
139
|
+
under `extensions:` in `graph-agents-cli-extensions.yaml`, vendoring a working copy under
|
|
140
|
+
`extensions/`.
|
|
141
|
+
- `graph-agents-cli install` re-materializes any missing or stale vendored copy from the pinned
|
|
142
|
+
SHA. It never advances a pin.
|
|
143
|
+
- `extension update [name]` advances the pin to the latest commit of the same tracked ref. A pinned
|
|
144
|
+
tag or SHA re-resolves to itself; to move to a different tag, re-run `extension add <ref>
|
|
145
|
+
--ref <new-tag>`.
|
|
146
|
+
- `extension remove <name>` removes from one scope per call (project before user).
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
graph-agents-cli extension add acme/gacli-extensions#soc2 --ref v1.2.0 # pin a tag (recommended)
|
|
150
|
+
graph-agents-cli extension add acme/gacli-extensions#soc2 --ref main # follow a branch
|
|
151
|
+
graph-agents-cli extension update soc2 # advance within the tracked ref
|
|
152
|
+
graph-agents-cli extension add acme/gacli-extensions#soc2 --ref v1.3.0 # move to another tag: re-add
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
A failed re-`add` rolls back to nothing rather than to the previous pin, so re-add the old ref to
|
|
156
|
+
restore it.
|