ai-agent-gateway-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-agent-gateway-cli
3
+ Version: 0.1.0
4
+ Summary: Canonical dev CLI client for ai-agent-gateway
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: httpx>=0.27.0
9
+ Provides-Extra: dev
10
+ Requires-Dist: pytest; extra == "dev"
11
+ Requires-Dist: pytest-asyncio; extra == "dev"
12
+ Requires-Dist: httpx>=0.27.0; extra == "dev"
13
+
14
+ # ai-agent-gateway-cli
15
+
16
+ Canonical Python dev CLI for the `ai-agent-gateway` HTTP/SSE protocol.
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ python -m agent_gateway_cli login
22
+ python -m agent_gateway_cli chat "hello"
23
+ python -m agent_gateway_cli --config-namespace cashnerd login
24
+ python -m agent_gateway_cli --config-namespace cashnerd chat --session default "hello"
25
+ ```
26
+
27
+ The default config namespace is `agent-gateway`, which writes:
28
+
29
+ - `~/.cache/agent-gateway/cli_config.json`
30
+ - `~/.cache/agent-gateway/sessions/<name>.json`
31
+
32
+ `--config-namespace cashnerd` writes under `~/.cache/cashnerd/` instead.
33
+
34
+ ## Contract
35
+
36
+ The CLI sends `context.channel = "cli"` on every chat request. When `user_id`
37
+ is configured, it is sent as a top-level field on both `/api/chat/init` and
38
+ `/api/chat`. Tool approvals post `tool_call_id`, `nonce`, `approved`, and
39
+ `allow_tool_type`.
40
+
41
+ The default `BaseUrlPolicy` is intentionally strict: `http://127.0.0.1` only,
42
+ with no path, query, or fragment. Products that need a wider local policy can
43
+ inject `BaseUrlPolicy(allowed_schemes=..., allowed_hostnames=...)`.
@@ -0,0 +1,30 @@
1
+ # ai-agent-gateway-cli
2
+
3
+ Canonical Python dev CLI for the `ai-agent-gateway` HTTP/SSE protocol.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ python -m agent_gateway_cli login
9
+ python -m agent_gateway_cli chat "hello"
10
+ python -m agent_gateway_cli --config-namespace cashnerd login
11
+ python -m agent_gateway_cli --config-namespace cashnerd chat --session default "hello"
12
+ ```
13
+
14
+ The default config namespace is `agent-gateway`, which writes:
15
+
16
+ - `~/.cache/agent-gateway/cli_config.json`
17
+ - `~/.cache/agent-gateway/sessions/<name>.json`
18
+
19
+ `--config-namespace cashnerd` writes under `~/.cache/cashnerd/` instead.
20
+
21
+ ## Contract
22
+
23
+ The CLI sends `context.channel = "cli"` on every chat request. When `user_id`
24
+ is configured, it is sent as a top-level field on both `/api/chat/init` and
25
+ `/api/chat`. Tool approvals post `tool_call_id`, `nonce`, `approved`, and
26
+ `allow_tool_type`.
27
+
28
+ The default `BaseUrlPolicy` is intentionally strict: `http://127.0.0.1` only,
29
+ with no path, query, or fragment. Products that need a wider local policy can
30
+ inject `BaseUrlPolicy(allowed_schemes=..., allowed_hostnames=...)`.
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from .cli import DevChatCLI, main
4
+ from .config import BaseUrlPolicy, CLIConfig, CLIError
5
+ from .session import SessionState
6
+ from .transport import GatewaySession, GatewayTransport
7
+
8
+
9
+ __all__ = [
10
+ "BaseUrlPolicy",
11
+ "CLIConfig",
12
+ "CLIError",
13
+ "DevChatCLI",
14
+ "GatewaySession",
15
+ "GatewayTransport",
16
+ "SessionState",
17
+ "main",
18
+ ]
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from .cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())