henosis-cli 0.6.3__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.
- henosis_cli-0.6.3/PKG-INFO +105 -0
- henosis_cli-0.6.3/README.md +82 -0
- henosis_cli-0.6.3/cli.py +9363 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/PKG-INFO +105 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/SOURCES.txt +22 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/dependency_links.txt +1 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/entry_points.txt +3 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/requires.txt +5 -0
- henosis_cli-0.6.3/henosis_cli.egg-info/top_level.txt +3 -0
- henosis_cli-0.6.3/henosis_cli_tools/__init__.py +47 -0
- henosis_cli-0.6.3/henosis_cli_tools/cli_entry.py +53 -0
- henosis_cli-0.6.3/henosis_cli_tools/input_engine.py +369 -0
- henosis_cli-0.6.3/henosis_cli_tools/settings_ui.py +539 -0
- henosis_cli-0.6.3/henosis_cli_tools/tool_impl.py +926 -0
- henosis_cli-0.6.3/pyproject.toml +55 -0
- henosis_cli-0.6.3/setup.cfg +4 -0
- henosis_cli-0.6.3/tests/test_auth_stay_logged_in.py +125 -0
- henosis_cli-0.6.3/tests/test_cli_urls.py +35 -0
- henosis_cli-0.6.3/tests/test_cost_compute.py +118 -0
- henosis_cli-0.6.3/tests/test_sse_parser.py +61 -0
- henosis_cli-0.6.3/tests/test_string_replace_tool.py +68 -0
- henosis_cli-0.6.3/tests/test_token_estimator_gemini.py +105 -0
- henosis_cli-0.6.3/tests/test_tonext_settings.py +15 -0
- henosis_cli-0.6.3/tests/test_websearch_openai.py +282 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: henosis-cli
|
|
3
|
+
Version: 0.6.3
|
|
4
|
+
Summary: henosis-cli — interactive CLI for the Henosis multi-provider streaming chat backend, with optional local tools.
|
|
5
|
+
Author-email: henosis <henosis@henosis.us>
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Project-URL: Homepage, https://henosis.us
|
|
8
|
+
Project-URL: Contact, https://henosis.us/contact
|
|
9
|
+
Keywords: henosis,tools,filesystem,sandbox,patch,subprocess,cli
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: httpx>=0.28.1
|
|
19
|
+
Requires-Dist: packaging>=24.0
|
|
20
|
+
Requires-Dist: rich>=14.1.0
|
|
21
|
+
Requires-Dist: prompt_toolkit>=3.0.52
|
|
22
|
+
Requires-Dist: websockets>=11.0.0
|
|
23
|
+
|
|
24
|
+
# Henosis CLI
|
|
25
|
+
|
|
26
|
+
the BEST terminal agent designed for uncompromising performance
|
|
27
|
+
|
|
28
|
+
Henosis CLI is a streamlined, professional terminal client for the Henosis multi-provider streaming chat backend. It supports OpenAI, Gemini, Anthropic, xAI (Grok), DeepSeek, and Moonshot Kimi via the Henosis server, and includes optional client-executed file/shell tools with approvals and sandboxing.
|
|
29
|
+
|
|
30
|
+
Key features
|
|
31
|
+
- Interactive chat over SSE with usage/cost summaries
|
|
32
|
+
- Model picker and per-turn controls (tools on/off, control level, reasoning effort)
|
|
33
|
+
- Client approvals at Level 2 for write/exec operations (approve once/session/always)
|
|
34
|
+
- Agent scope (safe host directory) when enabling tools in host mode
|
|
35
|
+
- Optional web search controls for OpenAI models (domain allow-list, include sources, location hints)
|
|
36
|
+
- Saves conversations to server threads and commits usage for billing where enabled
|
|
37
|
+
|
|
38
|
+
Troubleshooting
|
|
39
|
+
- If a provider streams deltas but never sends a final message.completed, the CLI now prints a Diagnostics block with:
|
|
40
|
+
- stream stats (events/deltas/bytes), last events tail, and response x-* headers
|
|
41
|
+
- It also writes the same data to logs/session-*.jsonl as event=diagnostics.no_completed
|
|
42
|
+
- Make the tail longer with HENOSIS_CLI_SSE_TAIL (default 40). Example: HENOSIS_CLI_SSE_TAIL=80 henosis-cli
|
|
43
|
+
- For raw debugging: use --debug-sse and/or --debug-req
|
|
44
|
+
- Minimal harness: python test_stream.py (override with HENOSIS_TEST_URL, HENOSIS_TEST_MODEL, HENOSIS_TEST_PROMPT)
|
|
45
|
+
|
|
46
|
+
Install
|
|
47
|
+
- pip: pip install henosis-cli
|
|
48
|
+
- pipx (recommended): pipx install henosis-cli
|
|
49
|
+
|
|
50
|
+
Quick start
|
|
51
|
+
- Run the CLI: henosis-cli
|
|
52
|
+
- Default server: https://henosis.us/api_v2 (override with HENOSIS_SERVER or --server)
|
|
53
|
+
- Dev server: henosis-cli --dev (uses HENOSIS_DEV_SERVER or http://127.0.0.1:8000)
|
|
54
|
+
- Authenticate when prompted. Use /model to pick a model and /tools on to enable tools.
|
|
55
|
+
|
|
56
|
+
Common commands
|
|
57
|
+
- /menu or /settings: Open settings menu
|
|
58
|
+
- /model: Open settings model picker (or '/model <name>' to set directly)
|
|
59
|
+
- /tools on|off|default: Toggle per-request tool availability
|
|
60
|
+
- /fs workspace|host|default: Set filesystem scope (workspace = sandbox; host = Agent scope)
|
|
61
|
+
- /hostbase <abs path>: Set Agent scope root directory when fs=host
|
|
62
|
+
- /level 1|2|3: Control level (1 read-only; 2 write/exec with approval; 3 no approvals)
|
|
63
|
+
- /map on|off: Inject CODEBASE_MAP.md into your first message
|
|
64
|
+
- /websearch on|off|domains|sources|location: Configure OpenAI web search options
|
|
65
|
+
- /title <name>: Name the current chat thread
|
|
66
|
+
- /clear: Reset chat history
|
|
67
|
+
- /login, /logout, /whoami: Auth helpers
|
|
68
|
+
|
|
69
|
+
Configuration
|
|
70
|
+
- Server base URL
|
|
71
|
+
- Env: HENOSIS_SERVER (default https://henosis.us/api_v2)
|
|
72
|
+
- Flag: --server https://your-server
|
|
73
|
+
- Dev shortcut: --dev (env HENOSIS_DEV_SERVER or http://127.0.0.1:8000)
|
|
74
|
+
- Optional Agent Mode (developer WebSocket bridge): --agent-mode
|
|
75
|
+
|
|
76
|
+
Local tools and sandboxing (optional)
|
|
77
|
+
- The CLI can execute a safe subset of tools locally when the server requests client-side execution.
|
|
78
|
+
- Tools include read_file, write_file, append_file, list_dir, apply_patch, run_command.
|
|
79
|
+
- At Level 2, destructive tools and command executions prompt for approval (once/session/always).
|
|
80
|
+
- Workspace root: by default, the workspace scope is the current working directory at the moment you launch the CLI. No dedicated per-terminal sandbox is created unless you override it.
|
|
81
|
+
- Override root: set --workspace-dir /path/to/root (or HENOSIS_WORKSPACE_DIR) to operate in a different directory for the session.
|
|
82
|
+
- Host scope can be constrained to an Agent scope directory (set via /hostbase) when fs=host.
|
|
83
|
+
|
|
84
|
+
Notes
|
|
85
|
+
- Requires Python 3.9+
|
|
86
|
+
- The CLI ships with rich and prompt_toolkit for a nicer UI by default.
|
|
87
|
+
- The reusable local tools library is available as a module (henosis_cli_tools).
|
|
88
|
+
|
|
89
|
+
Anthropic-only context handoff tool (server owners)
|
|
90
|
+
- The server can expose a lightweight, provider-scoped function tool to Anthropic models only that lets the model signal a handoff to the next turn and carry an optional JSON payload.
|
|
91
|
+
- Enable by setting on the API server (not the CLI):
|
|
92
|
+
- ANTHROPIC_ENABLE_TONEXT_TOOL=true
|
|
93
|
+
- Optional: ANTHROPIC_TONEXT_TOOL_NAME=context (default) or to_next (legacy)
|
|
94
|
+
- Optional: ANTHROPIC_TONEXT_ATTACH_BETA=true and ANTHROPIC_TONEXT_BETA_HEADER=context-management-2025-06-27
|
|
95
|
+
- When enabled, clients will see normal tool.call/tool.result SSE events. The tool.result includes {"to_next": true} and echoes the provided payload.
|
|
96
|
+
- No client-side tool execution is required; the server handles this tool inline.
|
|
97
|
+
|
|
98
|
+
Support
|
|
99
|
+
- Email: henosis@henosis.us
|
|
100
|
+
|
|
101
|
+
Build and publish (maintainers)
|
|
102
|
+
- Bump version in pyproject.toml
|
|
103
|
+
- Build: python -m pip install build twine && python -m build
|
|
104
|
+
- Upload to PyPI: python -m twine upload dist/*
|
|
105
|
+
- Or to TestPyPI: python -m twine upload --repository testpypi dist/*
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Henosis CLI
|
|
2
|
+
|
|
3
|
+
the BEST terminal agent designed for uncompromising performance
|
|
4
|
+
|
|
5
|
+
Henosis CLI is a streamlined, professional terminal client for the Henosis multi-provider streaming chat backend. It supports OpenAI, Gemini, Anthropic, xAI (Grok), DeepSeek, and Moonshot Kimi via the Henosis server, and includes optional client-executed file/shell tools with approvals and sandboxing.
|
|
6
|
+
|
|
7
|
+
Key features
|
|
8
|
+
- Interactive chat over SSE with usage/cost summaries
|
|
9
|
+
- Model picker and per-turn controls (tools on/off, control level, reasoning effort)
|
|
10
|
+
- Client approvals at Level 2 for write/exec operations (approve once/session/always)
|
|
11
|
+
- Agent scope (safe host directory) when enabling tools in host mode
|
|
12
|
+
- Optional web search controls for OpenAI models (domain allow-list, include sources, location hints)
|
|
13
|
+
- Saves conversations to server threads and commits usage for billing where enabled
|
|
14
|
+
|
|
15
|
+
Troubleshooting
|
|
16
|
+
- If a provider streams deltas but never sends a final message.completed, the CLI now prints a Diagnostics block with:
|
|
17
|
+
- stream stats (events/deltas/bytes), last events tail, and response x-* headers
|
|
18
|
+
- It also writes the same data to logs/session-*.jsonl as event=diagnostics.no_completed
|
|
19
|
+
- Make the tail longer with HENOSIS_CLI_SSE_TAIL (default 40). Example: HENOSIS_CLI_SSE_TAIL=80 henosis-cli
|
|
20
|
+
- For raw debugging: use --debug-sse and/or --debug-req
|
|
21
|
+
- Minimal harness: python test_stream.py (override with HENOSIS_TEST_URL, HENOSIS_TEST_MODEL, HENOSIS_TEST_PROMPT)
|
|
22
|
+
|
|
23
|
+
Install
|
|
24
|
+
- pip: pip install henosis-cli
|
|
25
|
+
- pipx (recommended): pipx install henosis-cli
|
|
26
|
+
|
|
27
|
+
Quick start
|
|
28
|
+
- Run the CLI: henosis-cli
|
|
29
|
+
- Default server: https://henosis.us/api_v2 (override with HENOSIS_SERVER or --server)
|
|
30
|
+
- Dev server: henosis-cli --dev (uses HENOSIS_DEV_SERVER or http://127.0.0.1:8000)
|
|
31
|
+
- Authenticate when prompted. Use /model to pick a model and /tools on to enable tools.
|
|
32
|
+
|
|
33
|
+
Common commands
|
|
34
|
+
- /menu or /settings: Open settings menu
|
|
35
|
+
- /model: Open settings model picker (or '/model <name>' to set directly)
|
|
36
|
+
- /tools on|off|default: Toggle per-request tool availability
|
|
37
|
+
- /fs workspace|host|default: Set filesystem scope (workspace = sandbox; host = Agent scope)
|
|
38
|
+
- /hostbase <abs path>: Set Agent scope root directory when fs=host
|
|
39
|
+
- /level 1|2|3: Control level (1 read-only; 2 write/exec with approval; 3 no approvals)
|
|
40
|
+
- /map on|off: Inject CODEBASE_MAP.md into your first message
|
|
41
|
+
- /websearch on|off|domains|sources|location: Configure OpenAI web search options
|
|
42
|
+
- /title <name>: Name the current chat thread
|
|
43
|
+
- /clear: Reset chat history
|
|
44
|
+
- /login, /logout, /whoami: Auth helpers
|
|
45
|
+
|
|
46
|
+
Configuration
|
|
47
|
+
- Server base URL
|
|
48
|
+
- Env: HENOSIS_SERVER (default https://henosis.us/api_v2)
|
|
49
|
+
- Flag: --server https://your-server
|
|
50
|
+
- Dev shortcut: --dev (env HENOSIS_DEV_SERVER or http://127.0.0.1:8000)
|
|
51
|
+
- Optional Agent Mode (developer WebSocket bridge): --agent-mode
|
|
52
|
+
|
|
53
|
+
Local tools and sandboxing (optional)
|
|
54
|
+
- The CLI can execute a safe subset of tools locally when the server requests client-side execution.
|
|
55
|
+
- Tools include read_file, write_file, append_file, list_dir, apply_patch, run_command.
|
|
56
|
+
- At Level 2, destructive tools and command executions prompt for approval (once/session/always).
|
|
57
|
+
- Workspace root: by default, the workspace scope is the current working directory at the moment you launch the CLI. No dedicated per-terminal sandbox is created unless you override it.
|
|
58
|
+
- Override root: set --workspace-dir /path/to/root (or HENOSIS_WORKSPACE_DIR) to operate in a different directory for the session.
|
|
59
|
+
- Host scope can be constrained to an Agent scope directory (set via /hostbase) when fs=host.
|
|
60
|
+
|
|
61
|
+
Notes
|
|
62
|
+
- Requires Python 3.9+
|
|
63
|
+
- The CLI ships with rich and prompt_toolkit for a nicer UI by default.
|
|
64
|
+
- The reusable local tools library is available as a module (henosis_cli_tools).
|
|
65
|
+
|
|
66
|
+
Anthropic-only context handoff tool (server owners)
|
|
67
|
+
- The server can expose a lightweight, provider-scoped function tool to Anthropic models only that lets the model signal a handoff to the next turn and carry an optional JSON payload.
|
|
68
|
+
- Enable by setting on the API server (not the CLI):
|
|
69
|
+
- ANTHROPIC_ENABLE_TONEXT_TOOL=true
|
|
70
|
+
- Optional: ANTHROPIC_TONEXT_TOOL_NAME=context (default) or to_next (legacy)
|
|
71
|
+
- Optional: ANTHROPIC_TONEXT_ATTACH_BETA=true and ANTHROPIC_TONEXT_BETA_HEADER=context-management-2025-06-27
|
|
72
|
+
- When enabled, clients will see normal tool.call/tool.result SSE events. The tool.result includes {"to_next": true} and echoes the provided payload.
|
|
73
|
+
- No client-side tool execution is required; the server handles this tool inline.
|
|
74
|
+
|
|
75
|
+
Support
|
|
76
|
+
- Email: henosis@henosis.us
|
|
77
|
+
|
|
78
|
+
Build and publish (maintainers)
|
|
79
|
+
- Bump version in pyproject.toml
|
|
80
|
+
- Build: python -m pip install build twine && python -m build
|
|
81
|
+
- Upload to PyPI: python -m twine upload dist/*
|
|
82
|
+
- Or to TestPyPI: python -m twine upload --repository testpypi dist/*
|