agentic-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.
Files changed (47) hide show
  1. agentic_cli-0.1.0/.gitignore +45 -0
  2. agentic_cli-0.1.0/LICENSE +21 -0
  3. agentic_cli-0.1.0/PKG-INFO +72 -0
  4. agentic_cli-0.1.0/README.md +40 -0
  5. agentic_cli-0.1.0/environment.yml +10 -0
  6. agentic_cli-0.1.0/examples/hello_agent/__init__.py +6 -0
  7. agentic_cli-0.1.0/examples/hello_agent/__main__.py +13 -0
  8. agentic_cli-0.1.0/examples/hello_agent/app.py +159 -0
  9. agentic_cli-0.1.0/pyproject.toml +57 -0
  10. agentic_cli-0.1.0/requirements-dev.txt +6 -0
  11. agentic_cli-0.1.0/requirements.txt +13 -0
  12. agentic_cli-0.1.0/src/agentic_cli/__init__.py +55 -0
  13. agentic_cli-0.1.0/src/agentic_cli/cli/__init__.py +22 -0
  14. agentic_cli-0.1.0/src/agentic_cli/cli/app.py +487 -0
  15. agentic_cli-0.1.0/src/agentic_cli/cli/builtin_commands.py +453 -0
  16. agentic_cli-0.1.0/src/agentic_cli/cli/commands.py +444 -0
  17. agentic_cli-0.1.0/src/agentic_cli/config.py +453 -0
  18. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/__init__.py +51 -0
  19. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/embeddings.py +246 -0
  20. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/manager.py +404 -0
  21. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/models.py +234 -0
  22. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/sources.py +352 -0
  23. agentic_cli-0.1.0/src/agentic_cli/knowledge_base/vector_store.py +291 -0
  24. agentic_cli-0.1.0/src/agentic_cli/llm/__init__.py +5 -0
  25. agentic_cli-0.1.0/src/agentic_cli/llm/thinking.py +54 -0
  26. agentic_cli-0.1.0/src/agentic_cli/logging.py +152 -0
  27. agentic_cli-0.1.0/src/agentic_cli/persistence/__init__.py +19 -0
  28. agentic_cli-0.1.0/src/agentic_cli/persistence/artifacts.py +244 -0
  29. agentic_cli-0.1.0/src/agentic_cli/persistence/session.py +388 -0
  30. agentic_cli-0.1.0/src/agentic_cli/tools/__init__.py +75 -0
  31. agentic_cli-0.1.0/src/agentic_cli/tools/executor.py +396 -0
  32. agentic_cli-0.1.0/src/agentic_cli/tools/registry.py +345 -0
  33. agentic_cli-0.1.0/src/agentic_cli/tools/resilience.py +447 -0
  34. agentic_cli-0.1.0/src/agentic_cli/tools/search.py +196 -0
  35. agentic_cli-0.1.0/src/agentic_cli/tools/standard.py +203 -0
  36. agentic_cli-0.1.0/src/agentic_cli/workflow/__init__.py +12 -0
  37. agentic_cli-0.1.0/src/agentic_cli/workflow/config.py +34 -0
  38. agentic_cli-0.1.0/src/agentic_cli/workflow/events.py +191 -0
  39. agentic_cli-0.1.0/src/agentic_cli/workflow/manager.py +495 -0
  40. agentic_cli-0.1.0/tests/__init__.py +1 -0
  41. agentic_cli-0.1.0/tests/conftest.py +203 -0
  42. agentic_cli-0.1.0/tests/test_commands.py +441 -0
  43. agentic_cli-0.1.0/tests/test_config.py +409 -0
  44. agentic_cli-0.1.0/tests/test_knowledge_base.py +806 -0
  45. agentic_cli-0.1.0/tests/test_persistence.py +546 -0
  46. agentic_cli-0.1.0/tests/test_tools.py +874 -0
  47. agentic_cli-0.1.0/tests/test_workflow.py +549 -0
@@ -0,0 +1,45 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.egg
11
+ .eggs/
12
+
13
+ # Virtual environments
14
+ .venv/
15
+ venv/
16
+ ENV/
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+ *.swp
22
+ *.swo
23
+
24
+ # Testing
25
+ .pytest_cache/
26
+ .coverage
27
+ htmlcov/
28
+ .tox/
29
+
30
+ # Type checking
31
+ .mypy_cache/
32
+
33
+ # Environment files
34
+ .env
35
+ *.env.local
36
+
37
+ # OS files
38
+ .DS_Store
39
+ Thumbs.db
40
+
41
+ # Logs
42
+ *.log
43
+
44
+ CLAUDE.md
45
+ .claude/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-cli
3
+ Version: 0.1.0
4
+ Summary: A framework for building domain-specific agentic CLI applications
5
+ Project-URL: Homepage, https://github.com/shoom1/agentic-cli
6
+ Project-URL: Repository, https://github.com/shoom1/agentic-cli
7
+ Author: Andrey Shiryaev
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: >=3.12
17
+ Requires-Dist: feedparser>=6.0.0
18
+ Requires-Dist: google-adk[genai]>=0.4.0
19
+ Requires-Dist: httpx>=0.27.0
20
+ Requires-Dist: numpy>=1.26.0
21
+ Requires-Dist: prompt-toolkit>=3.0.0
22
+ Requires-Dist: pydantic-settings>=2.0.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: rich>=13.0.0
25
+ Requires-Dist: structlog>=24.0.0
26
+ Requires-Dist: thinking-prompt>=0.1.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Agentic CLI
34
+
35
+ A framework for building domain-specific agentic CLI applications powered by LLM agents.
36
+
37
+ ## Features
38
+
39
+ - **CLI Framework**: Rich terminal UI with thinking boxes and markdown support
40
+ - **Workflow Management**: Agent orchestration using Google ADK
41
+ - **Generic Tools**: Web search, Python execution, knowledge base
42
+ - **Session Persistence**: Save and restore conversation sessions
43
+ - **Configuration**: Type-safe settings with pydantic-settings
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install agentic-cli
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ Create a domain-specific CLI application by extending the base classes:
54
+
55
+ ```python
56
+ from agentic_cli import BaseCLIApp, WorkflowManager
57
+ from thinking_prompt import AppInfo
58
+
59
+ class MyApp(BaseCLIApp):
60
+ def get_app_info(self) -> AppInfo:
61
+ return AppInfo(name="MyApp", version="0.1.0")
62
+
63
+ def get_settings(self):
64
+ return MySettings()
65
+
66
+ def create_workflow_manager(self):
67
+ return MyWorkflowManager(settings=self.settings)
68
+ ```
69
+
70
+ ## License
71
+
72
+ MIT
@@ -0,0 +1,40 @@
1
+ # Agentic CLI
2
+
3
+ A framework for building domain-specific agentic CLI applications powered by LLM agents.
4
+
5
+ ## Features
6
+
7
+ - **CLI Framework**: Rich terminal UI with thinking boxes and markdown support
8
+ - **Workflow Management**: Agent orchestration using Google ADK
9
+ - **Generic Tools**: Web search, Python execution, knowledge base
10
+ - **Session Persistence**: Save and restore conversation sessions
11
+ - **Configuration**: Type-safe settings with pydantic-settings
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install agentic-cli
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Create a domain-specific CLI application by extending the base classes:
22
+
23
+ ```python
24
+ from agentic_cli import BaseCLIApp, WorkflowManager
25
+ from thinking_prompt import AppInfo
26
+
27
+ class MyApp(BaseCLIApp):
28
+ def get_app_info(self) -> AppInfo:
29
+ return AppInfo(name="MyApp", version="0.1.0")
30
+
31
+ def get_settings(self):
32
+ return MySettings()
33
+
34
+ def create_workflow_manager(self):
35
+ return MyWorkflowManager(settings=self.settings)
36
+ ```
37
+
38
+ ## License
39
+
40
+ MIT
@@ -0,0 +1,10 @@
1
+ name: agenticcli
2
+ channels:
3
+ - conda-forge
4
+ - defaults
5
+ dependencies:
6
+ - python=3.12
7
+ - pip
8
+ - pip:
9
+ - -e .
10
+ - -e .[dev]
@@ -0,0 +1,6 @@
1
+ """Hello Agent - A simple example showcasing the agentic-cli package."""
2
+
3
+ from .app import HelloAgentApp, Settings, get_settings
4
+
5
+ __version__ = "0.1.0"
6
+ __all__ = ["HelloAgentApp", "Settings", "get_settings"]
@@ -0,0 +1,13 @@
1
+ """Entry point: python -m examples.hello_agent"""
2
+
3
+ import asyncio
4
+ from .app import HelloAgentApp
5
+
6
+
7
+ def main():
8
+ app = HelloAgentApp()
9
+ asyncio.run(app.run())
10
+
11
+
12
+ if __name__ == "__main__":
13
+ main()
@@ -0,0 +1,159 @@
1
+ """Hello Agent - A simple example showcasing the agentic-cli package.
2
+
3
+ This single file contains everything needed:
4
+ - Settings configuration
5
+ - Tool definitions
6
+ - Agent configuration
7
+ - CLI application
8
+ """
9
+
10
+ from datetime import datetime
11
+ from functools import lru_cache
12
+ from pathlib import Path
13
+
14
+ from rich.panel import Panel
15
+ from rich.text import Text
16
+ from pydantic import Field
17
+ from pydantic_settings import SettingsConfigDict
18
+
19
+ from agentic_cli import BaseCLIApp, BaseSettings
20
+ from agentic_cli.cli import AppInfo
21
+ from agentic_cli.config import set_settings
22
+ from agentic_cli.workflow import AgentConfig, WorkflowManager
23
+
24
+ __version__ = "0.1.0"
25
+
26
+
27
+ # =============================================================================
28
+ # Settings
29
+ # =============================================================================
30
+
31
+ class Settings(BaseSettings):
32
+ """Hello Agent settings."""
33
+
34
+ model_config = SettingsConfigDict(
35
+ env_prefix="HELLO_",
36
+ env_file=str(Path.home() / ".hello_agent" / ".env"),
37
+ extra="ignore",
38
+ )
39
+
40
+ app_name: str = Field(default="hello_agent")
41
+ workspace_dir: Path = Field(default=Path.home() / ".hello_agent")
42
+
43
+
44
+ @lru_cache
45
+ def get_settings() -> Settings:
46
+ return Settings()
47
+
48
+
49
+ # =============================================================================
50
+ # Tools
51
+ # =============================================================================
52
+
53
+ def get_current_time() -> dict:
54
+ """Get the current date and time."""
55
+ now = datetime.now()
56
+ return {
57
+ "date": now.strftime("%Y-%m-%d"),
58
+ "time": now.strftime("%H:%M:%S"),
59
+ "day_of_week": now.strftime("%A"),
60
+ }
61
+
62
+
63
+ def calculate(expression: str) -> dict:
64
+ """Evaluate a mathematical expression.
65
+
66
+ Args:
67
+ expression: A math expression like "2 + 2" or "sqrt(16)"
68
+ """
69
+ import math
70
+
71
+ allowed = {
72
+ "abs": abs, "round": round, "min": min, "max": max, "sum": sum,
73
+ "pow": pow, "sqrt": math.sqrt, "sin": math.sin, "cos": math.cos,
74
+ "tan": math.tan, "pi": math.pi, "e": math.e,
75
+ }
76
+
77
+ try:
78
+ result = eval(expression, {"__builtins__": {}}, allowed)
79
+ return {"expression": expression, "result": result}
80
+ except Exception as e:
81
+ return {"expression": expression, "error": str(e)}
82
+
83
+
84
+ def echo(message: str) -> dict:
85
+ """Echo back a message.
86
+
87
+ Args:
88
+ message: The message to echo back
89
+ """
90
+ return {"echoed": message, "length": len(message)}
91
+
92
+
93
+ # =============================================================================
94
+ # Agent Configuration
95
+ # =============================================================================
96
+
97
+ SYSTEM_PROMPT = """You are a friendly assistant with access to utility tools.
98
+
99
+ Available tools:
100
+ - get_current_time: Get the current date and time
101
+ - calculate: Evaluate math expressions
102
+ - echo: Echo back messages
103
+
104
+ Be helpful and concise in your responses."""
105
+
106
+
107
+ AGENT_CONFIGS = [
108
+ AgentConfig(
109
+ name="assistant",
110
+ prompt=SYSTEM_PROMPT,
111
+ tools=[get_current_time, calculate, echo],
112
+ description="Friendly assistant with utility tools",
113
+ ),
114
+ ]
115
+
116
+
117
+ def create_workflow_manager(settings: Settings) -> WorkflowManager:
118
+ """Create the workflow manager."""
119
+ set_settings(settings)
120
+ return WorkflowManager(agent_configs=AGENT_CONFIGS, settings=settings)
121
+
122
+
123
+ # =============================================================================
124
+ # CLI Application
125
+ # =============================================================================
126
+
127
+ def create_welcome_message() -> Panel:
128
+ """Create the welcome message panel."""
129
+ text = Text()
130
+ text.append("Hello Agent", style="bold cyan")
131
+ text.append(f" v{__version__}\n\n", style="dim")
132
+ text.append("A simple assistant with utility tools.\n\n", style="white")
133
+ text.append("Available tools:\n", style="yellow")
134
+ text.append(" - get_current_time: Get date and time\n", style="dim")
135
+ text.append(" - calculate: Math expressions\n", style="dim")
136
+ text.append(" - echo: Echo messages\n\n", style="dim")
137
+ text.append("Type ", style="white")
138
+ text.append("/help", style="bold green")
139
+ text.append(" for commands, or just start chatting!", style="white")
140
+
141
+ return Panel(text, border_style="cyan", padding=(1, 2))
142
+
143
+
144
+ class HelloAgentApp(BaseCLIApp):
145
+ """Hello Agent CLI application."""
146
+
147
+ def get_app_info(self) -> AppInfo:
148
+ return AppInfo(
149
+ name="Hello Agent",
150
+ version=__version__,
151
+ welcome_message=create_welcome_message,
152
+ echo_thinking=False,
153
+ )
154
+
155
+ def get_settings(self) -> Settings:
156
+ return get_settings()
157
+
158
+ def create_workflow_manager(self) -> WorkflowManager:
159
+ return create_workflow_manager(settings=self._settings)
@@ -0,0 +1,57 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "agentic-cli"
7
+ version = "0.1.0"
8
+ description = "A framework for building domain-specific agentic CLI applications"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.12"
12
+ authors = [
13
+ { name = "Andrey Shiryaev" }
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ ]
23
+ dependencies = [
24
+ "thinking-prompt>=0.1.0",
25
+ "google-adk[genai]>=0.4.0",
26
+ "pydantic>=2.0.0",
27
+ "pydantic-settings>=2.0.0",
28
+ "structlog>=24.0.0",
29
+ "rich>=13.0.0",
30
+ "prompt-toolkit>=3.0.0",
31
+ "httpx>=0.27.0",
32
+ "numpy>=1.26.0",
33
+ "feedparser>=6.0.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.0.0",
39
+ "pytest-asyncio>=0.24.0",
40
+ "pytest-cov>=6.0.0",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/shoom1/agentic-cli"
45
+ Repository = "https://github.com/shoom1/agentic-cli"
46
+
47
+ [tool.hatch.build.targets.wheel]
48
+ packages = ["src/agentic_cli"]
49
+
50
+ [tool.pytest.ini_options]
51
+ testpaths = ["tests"]
52
+ asyncio_mode = "auto"
53
+ asyncio_default_fixture_loop_scope = "function"
54
+
55
+ [tool.ruff]
56
+ line-length = 88
57
+ target-version = "py312"
@@ -0,0 +1,6 @@
1
+ # Development dependencies for agentic-cli
2
+ -r requirements.txt
3
+
4
+ pytest>=8.0.0
5
+ pytest-asyncio>=0.24.0
6
+ pytest-cov>=6.0.0
@@ -0,0 +1,13 @@
1
+ # Core dependencies for agentic-cli
2
+ # Note: thinking-prompt is a local dependency, install separately:
3
+ # pip install -e /path/to/thinking_prompt
4
+
5
+ google-adk[genai]>=0.4.0
6
+ pydantic>=2.0.0
7
+ pydantic-settings>=2.0.0
8
+ structlog>=24.0.0
9
+ rich>=13.0.0
10
+ prompt-toolkit>=3.0.0
11
+ httpx>=0.27.0
12
+ numpy>=1.26.0
13
+ feedparser>=6.0.0
@@ -0,0 +1,55 @@
1
+ """Agentic CLI - A framework for building domain-specific agentic CLI applications.
2
+
3
+ This package provides the core infrastructure for building CLI applications
4
+ powered by LLM agents, including:
5
+
6
+ - CLI framework with thinking boxes and rich output
7
+ - Workflow management for agent orchestration
8
+ - Generic tools (search, code execution, document generation)
9
+ - Knowledge base with vector search
10
+ - Session persistence
11
+
12
+ Domain-specific applications extend the base classes to provide their own
13
+ agents, prompts, and configuration.
14
+ """
15
+
16
+ from agentic_cli.cli.app import BaseCLIApp
17
+ from agentic_cli.cli.commands import Command, CommandRegistry
18
+ from agentic_cli.workflow.manager import WorkflowManager
19
+ from agentic_cli.workflow.config import AgentConfig
20
+ from agentic_cli.workflow.events import WorkflowEvent, EventType
21
+ from agentic_cli.config import (
22
+ BaseSettings,
23
+ SettingsContext,
24
+ SettingsValidationError,
25
+ get_settings,
26
+ set_settings,
27
+ set_context_settings,
28
+ get_context_settings,
29
+ validate_settings,
30
+ reload_settings,
31
+ )
32
+
33
+ __all__ = [
34
+ # CLI
35
+ "BaseCLIApp",
36
+ "Command",
37
+ "CommandRegistry",
38
+ # Workflow
39
+ "WorkflowManager",
40
+ "AgentConfig",
41
+ "WorkflowEvent",
42
+ "EventType",
43
+ # Settings
44
+ "BaseSettings",
45
+ "SettingsContext",
46
+ "SettingsValidationError",
47
+ "get_settings",
48
+ "set_settings",
49
+ "set_context_settings",
50
+ "get_context_settings",
51
+ "validate_settings",
52
+ "reload_settings",
53
+ ]
54
+
55
+ __version__ = "0.1.0"
@@ -0,0 +1,22 @@
1
+ """CLI framework for agentic applications."""
2
+
3
+ from thinking_prompt import AppInfo
4
+
5
+ from agentic_cli.cli.commands import (
6
+ Command,
7
+ CommandCategory,
8
+ CommandRegistry,
9
+ ParsedArgs,
10
+ create_simple_command,
11
+ )
12
+ from agentic_cli.cli.app import BaseCLIApp
13
+
14
+ __all__ = [
15
+ "AppInfo",
16
+ "BaseCLIApp",
17
+ "Command",
18
+ "CommandCategory",
19
+ "CommandRegistry",
20
+ "ParsedArgs",
21
+ "create_simple_command",
22
+ ]