agent-cli-sdk 0.0.1a1__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 (58) hide show
  1. agent_cli_sdk-0.0.1a1/.gitattributes +33 -0
  2. agent_cli_sdk-0.0.1a1/.github/CODEOWNERS +18 -0
  3. agent_cli_sdk-0.0.1a1/.github/ISSUE_TEMPLATE/bug_report.yml +63 -0
  4. agent_cli_sdk-0.0.1a1/.github/ISSUE_TEMPLATE/config.yml +5 -0
  5. agent_cli_sdk-0.0.1a1/.github/ISSUE_TEMPLATE/feature_request.yml +43 -0
  6. agent_cli_sdk-0.0.1a1/.github/pull_request_template.md +19 -0
  7. agent_cli_sdk-0.0.1a1/.github/workflows/ci.yml +40 -0
  8. agent_cli_sdk-0.0.1a1/.github/workflows/publish.yml +45 -0
  9. agent_cli_sdk-0.0.1a1/.gitignore +141 -0
  10. agent_cli_sdk-0.0.1a1/.pre-commit-config.yaml +26 -0
  11. agent_cli_sdk-0.0.1a1/CHANGELOG.md +17 -0
  12. agent_cli_sdk-0.0.1a1/CODE_OF_CONDUCT.md +77 -0
  13. agent_cli_sdk-0.0.1a1/CONTRIBUTING.md +72 -0
  14. agent_cli_sdk-0.0.1a1/LICENSE +21 -0
  15. agent_cli_sdk-0.0.1a1/PKG-INFO +157 -0
  16. agent_cli_sdk-0.0.1a1/README.md +105 -0
  17. agent_cli_sdk-0.0.1a1/SECURITY.md +30 -0
  18. agent_cli_sdk-0.0.1a1/docs/copilot_integration_analysis.md +61 -0
  19. agent_cli_sdk-0.0.1a1/docs/copilot_standard_flow.md +36 -0
  20. agent_cli_sdk-0.0.1a1/docs/feasibility_and_plan.md +92 -0
  21. agent_cli_sdk-0.0.1a1/docs/universal_sdk_proposal.md +68 -0
  22. agent_cli_sdk-0.0.1a1/examples/demo_launcher.py +82 -0
  23. agent_cli_sdk-0.0.1a1/examples/tasks/custom_tools.py +43 -0
  24. agent_cli_sdk-0.0.1a1/examples/tasks/error_handling.py +45 -0
  25. agent_cli_sdk-0.0.1a1/examples/tasks/file_management.py +59 -0
  26. agent_cli_sdk-0.0.1a1/examples/tasks/hello_world.py +38 -0
  27. agent_cli_sdk-0.0.1a1/examples/tasks/multiple_sessions.py +40 -0
  28. agent_cli_sdk-0.0.1a1/examples/tasks/persistence.py +40 -0
  29. agent_cli_sdk-0.0.1a1/examples/tasks/pr_visualization.py +66 -0
  30. agent_cli_sdk-0.0.1a1/examples/utils.py +17 -0
  31. agent_cli_sdk-0.0.1a1/pyproject.toml +74 -0
  32. agent_cli_sdk-0.0.1a1/src/agent_sdk/__init__.py +24 -0
  33. agent_cli_sdk-0.0.1a1/src/agent_sdk/core/agent.py +124 -0
  34. agent_cli_sdk-0.0.1a1/src/agent_sdk/core/driver.py +46 -0
  35. agent_cli_sdk-0.0.1a1/src/agent_sdk/core/types.py +46 -0
  36. agent_cli_sdk-0.0.1a1/src/agent_sdk/drivers/cli_json_driver.py +116 -0
  37. agent_cli_sdk-0.0.1a1/src/agent_sdk/drivers/copilot_driver.py +281 -0
  38. agent_cli_sdk-0.0.1a1/src/agent_sdk/drivers/gemini_driver.py +77 -0
  39. agent_cli_sdk-0.0.1a1/src/agent_sdk/drivers/mock_driver.py +80 -0
  40. agent_cli_sdk-0.0.1a1/src/agent_sdk/utils/jsonrpc.py +178 -0
  41. agent_cli_sdk-0.0.1a1/src/agent_sdk/utils/schema.py +48 -0
  42. agent_cli_sdk-0.0.1a1/tests/e2e/__init__.py +0 -0
  43. agent_cli_sdk-0.0.1a1/tests/e2e/test_copilot_e2e.py +41 -0
  44. agent_cli_sdk-0.0.1a1/tests/e2e/test_copilot_session_advanced.py +51 -0
  45. agent_cli_sdk-0.0.1a1/tests/e2e/test_copilot_tools_advanced.py +54 -0
  46. agent_cli_sdk-0.0.1a1/tests/e2e/test_gemini_e2e.py +36 -0
  47. agent_cli_sdk-0.0.1a1/tests/e2e/test_session.py +24 -0
  48. agent_cli_sdk-0.0.1a1/tests/e2e/testharness.py +63 -0
  49. agent_cli_sdk-0.0.1a1/tests/test_agent.py +62 -0
  50. agent_cli_sdk-0.0.1a1/tests/test_cleanup.py +84 -0
  51. agent_cli_sdk-0.0.1a1/tests/test_copilot_driver.py +184 -0
  52. agent_cli_sdk-0.0.1a1/tests/test_driver_config.py +26 -0
  53. agent_cli_sdk-0.0.1a1/tests/test_event_handling.py +24 -0
  54. agent_cli_sdk-0.0.1a1/tests/test_gemini_driver.py +134 -0
  55. agent_cli_sdk-0.0.1a1/tests/test_jsonrpc.py +116 -0
  56. agent_cli_sdk-0.0.1a1/tests/test_schema.py +26 -0
  57. agent_cli_sdk-0.0.1a1/tests/test_tool_handling.py +24 -0
  58. agent_cli_sdk-0.0.1a1/tests/test_tools_unit.py +29 -0
@@ -0,0 +1,33 @@
1
+ # Git attributes for consistent line endings and diff behavior
2
+ * text=auto
3
+
4
+ # Python files
5
+ *.py text eol=lf diff=python
6
+
7
+ # Markdown and documentation
8
+ *.md text eol=lf
9
+ *.txt text eol=lf
10
+
11
+ # YAML and config files
12
+ *.yml text eol=lf
13
+ *.yaml text eol=lf
14
+ *.toml text eol=lf
15
+ *.ini text eol=lf
16
+
17
+ # Shell scripts
18
+ *.sh text eol=lf
19
+
20
+ # Binary files
21
+ *.png binary
22
+ *.jpg binary
23
+ *.jpeg binary
24
+ *.gif binary
25
+ *.ico binary
26
+ *.pdf binary
27
+ *.whl binary
28
+ *.egg binary
29
+
30
+ # Archive files
31
+ *.zip binary
32
+ *.tar binary
33
+ *.gz binary
@@ -0,0 +1,18 @@
1
+ # CODEOWNERS - Define who reviews PRs by default
2
+ # More info: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3
+
4
+ # Default ownership - all files
5
+ * @rbbtsn0w
6
+
7
+ # Core SDK components
8
+ /src/agent_sdk/core/ @rbbtsn0w
9
+ /src/agent_sdk/drivers/ @rbbtsn0w
10
+
11
+ # Tests and quality
12
+ /tests/ @rbbtsn0w
13
+ /.github/workflows/ @rbbtsn0w
14
+
15
+ # Documentation
16
+ /docs/ @rbbtsn0w
17
+ /README.md @rbbtsn0w
18
+ /CONTRIBUTING.md @rbbtsn0w
@@ -0,0 +1,63 @@
1
+ name: Bug report
2
+ description: Create a report to help us improve.
3
+ labels: [bug]
4
+ title: "[Bug]: "
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for taking the time to fill out a bug report!
10
+ - type: textarea
11
+ id: summary
12
+ attributes:
13
+ label: Summary
14
+ description: What happened, and what did you expect instead?
15
+ placeholder: Clear and concise description of the issue.
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ id: reproduction
20
+ attributes:
21
+ label: Steps to reproduce
22
+ description: Provide minimal steps or a code snippet to reproduce the issue.
23
+ placeholder: |
24
+ 1. ...
25
+ 2. ...
26
+ 3. ...
27
+ validations:
28
+ required: true
29
+ - type: textarea
30
+ id: environment
31
+ attributes:
32
+ label: Environment
33
+ description: OS, Python version, driver/CLI version, and any notable configuration.
34
+ placeholder: |
35
+ - OS: macOS 14
36
+ - Python: 3.11
37
+ - Driver: copilot / gemini (version)
38
+ - CLI version: ...
39
+ validations:
40
+ required: true
41
+ - type: textarea
42
+ id: logs
43
+ attributes:
44
+ label: Logs / stack traces
45
+ description: Paste relevant logs or stack traces (redact secrets).
46
+ render: text
47
+ validations:
48
+ required: false
49
+ - type: dropdown
50
+ id: regression
51
+ attributes:
52
+ label: Is this a regression?
53
+ options:
54
+ - Unknown
55
+ - Yes
56
+ - No
57
+ validations:
58
+ required: true
59
+ - type: textarea
60
+ id: additional
61
+ attributes:
62
+ label: Additional context
63
+ description: Anything else we should know?
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security reports
4
+ url: https://github.com/rbbtsn0w/agent-cli-sdk/security/policy
5
+ about: Please report security vulnerabilities via the Security Policy.
@@ -0,0 +1,43 @@
1
+ name: Feature request
2
+ description: Suggest an idea or improvement for the project.
3
+ labels: [enhancement]
4
+ title: "[Feature]: "
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for suggesting a feature! Please provide as much detail as possible.
10
+ - type: textarea
11
+ id: summary
12
+ attributes:
13
+ label: Summary
14
+ description: What would you like to see added or improved?
15
+ placeholder: A clear and concise description of the feature.
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ id: motivation
20
+ attributes:
21
+ label: Motivation / use case
22
+ description: Why is this feature important? What problem does it solve?
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: proposal
27
+ attributes:
28
+ label: Proposed solution
29
+ description: Describe the solution you'd like, or implementation ideas.
30
+ validations:
31
+ required: false
32
+ - type: textarea
33
+ id: alternatives
34
+ attributes:
35
+ label: Alternatives considered
36
+ description: Have you considered any alternative solutions or workarounds?
37
+ validations:
38
+ required: false
39
+ - type: textarea
40
+ id: additional
41
+ attributes:
42
+ label: Additional context
43
+ description: Screenshots, references, or related issues.
@@ -0,0 +1,19 @@
1
+ ## Summary
2
+ - [ ] Closes <!-- issue number, if applicable -->
3
+ - [ ] This PR is ready for review
4
+
5
+ ## Changes
6
+ -
7
+
8
+ ## Testing
9
+ - [ ] `pytest --ignore=tests/e2e`
10
+ - [ ] Added/updated tests
11
+ - [ ] Manual verification (describe below)
12
+
13
+ ## Checklist
14
+ - [ ] Documentation updated (README, docs/, or inline)
15
+ - [ ] Changelog updated (CHANGELOG.md)
16
+ - [ ] No sensitive data added
17
+
18
+ ## Notes for reviewers
19
+ -
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: "pip"
24
+ cache-dependency-path: "pyproject.toml"
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install -e .[test]
30
+
31
+ - name: Run tests (pytest)
32
+ run: |
33
+ pytest --cov=src/agent_sdk --cov-report=term-missing --ignore=tests/e2e
34
+
35
+ - name: Upload coverage report
36
+ if: always()
37
+ uses: actions/upload-artifact@v4
38
+ with:
39
+ name: coverage-${{ matrix.python-version }}
40
+ path: ./.coverage*
@@ -0,0 +1,45 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*" # Trigger on tags like v0.1.0, v0.0.1-pre
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ name: Build and publish to PyPI
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ id-token: write
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Check for PyPI Token Secret
21
+ run: |
22
+ if [ -z "${{ secrets.PYPI_API_TOKEN }}" ]; then
23
+ echo "::error::PYPI_API_TOKEN secret is NOT set or empty!"
24
+ else
25
+ echo "PYPI_API_TOKEN secret is detected (masked)."
26
+ fi
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.11"
32
+
33
+ - name: Install build dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ pip install build
37
+
38
+ - name: Build package
39
+ run: python -m build
40
+
41
+ - name: Publish to PyPI
42
+ uses: pypa/gh-action-pypi-publish@release/v1
43
+ with:
44
+ user: __token__
45
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,141 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .webassets-cache
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder Project Settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope Project Settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # pytype static type analyzer
132
+ .pytype/
133
+
134
+ # Cython debug symbols
135
+ cython_debug/
136
+
137
+ # IDEs
138
+ .vscode/
139
+ .idea/
140
+ *.swp
141
+ .DS_Store
@@ -0,0 +1,26 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.1.11
12
+ hooks:
13
+ - id: ruff
14
+ args: [ --fix ]
15
+
16
+ - repo: https://github.com/jendrikseipp/vulture
17
+ rev: v2.11
18
+ hooks:
19
+ - id: vulture
20
+ name: vulture (dead code)
21
+ description: Run vulture to find unused code
22
+ entry: vulture
23
+ language: python
24
+ types: [python]
25
+ require_serial: true
26
+ args: ["src"] # Limit to src to avoid false positives in tests for now
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.0.1a1] - 2026-01-23
6
+
7
+ ### Added
8
+ - Initial technical preview release.
9
+ - **Core:** `UniversalAgent` with ReAct loop implementation.
10
+ - **Drivers:**
11
+ - `CopilotDriver`: Support for GitHub Copilot CLI (JSON-RPC over stdio).
12
+ - `GeminiDriver`: Support for Google Gemini CLI (streaming JSON).
13
+ - `MockDriver`: For testing and simulation.
14
+ - **Features:**
15
+ - Session persistence support.
16
+ - Customizable tool registration.
17
+ - Cross-platform support (macOS/Linux).
@@ -0,0 +1,77 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team at **conduct@github.com**. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
76
+
77
+ For answers to common questions about this code of conduct, see the FAQ at <https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.
@@ -0,0 +1,72 @@
1
+ # Contributing to Agent CLI SDK
2
+
3
+ First off, thank you for considering contributing to the Agent CLI SDK! It's people like you who make this a great tool for the AI community.
4
+
5
+ ## ๐Ÿš€ Getting Started
6
+
7
+ ### Development Setup
8
+
9
+ 1. **Clone the repository**:
10
+ ```bash
11
+ git clone https://github.com/rbbtsn0w/agent-cli-sdk.git
12
+ cd agent-cli-sdk
13
+ ```
14
+
15
+ 2. **Create a virtual environment**:
16
+ ```bash
17
+ python3 -m venv .venv
18
+ source .venv/bin/activate
19
+ ```
20
+
21
+ 3. **Install dependencies**:
22
+ ```bash
23
+ pip install -e .[test]
24
+ ```
25
+
26
+ ## ๐Ÿ›  Adding a New Driver
27
+
28
+ One of the best ways to contribute is by adding support for a new AI CLI (e.g., ChatGPT CLI, Claude CLI).
29
+
30
+ ### Steps to Implement a Driver:
31
+
32
+ 1. **Inherit from `AgentDriver`**: Create a new file in `src/agent_sdk/drivers/`.
33
+ 2. **Choose a pattern**:
34
+ - **LSP/JSON-RPC**: If the CLI supports a long-running server mode, use `JsonRpcClient`.
35
+ - **CLI Wrapper**: If the CLI is turn-based, inherit from `CliJsonDriver`.
36
+ 3. **Implement required methods**:
37
+ - `start()`: Initialize the process or handshake.
38
+ - `chat(messages)`: An async generator yielding `StreamEvent`.
39
+ - `stop()`: Clean up resources.
40
+ 4. **Register events**: Map the CLI's specific JSON output to `AgentEvent` types (CONTENT, THOUGHT, TOOL_CALL, etc.).
41
+
42
+ ## ๐Ÿงช Testing
43
+
44
+ We use `pytest` for testing. High code coverage is expected for all PRs.
45
+
46
+ ```bash
47
+ # Run unit and integration tests
48
+ pytest tests/ --ignore=tests/e2e
49
+
50
+ # Run tests with coverage report
51
+ pytest --cov=src/agent_sdk tests/ --ignore=tests/e2e --cov-report=term-missing
52
+ ```
53
+
54
+ ### E2E Tests
55
+ E2E tests require the actual CLI tools to be installed and authenticated on your system.
56
+
57
+ ```bash
58
+ # Run Gemini E2E
59
+ pytest tests/e2e/test_gemini_e2e.py
60
+ ```
61
+
62
+ ## ๐Ÿ“œ Pull Request Process
63
+
64
+ 1. **Fork** the repo and create your branch from `main`.
65
+ 2. **Add tests** for your changes.
66
+ 3. **Ensure CI passes**.
67
+ 4. **Update documentation** (including this file if you're adding major features).
68
+ 5. **Submit** your PR with a clear description of the changes.
69
+
70
+ ## โš–๏ธ License
71
+
72
+ By contributing, you agree that your contributions will be licensed under its MIT License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agent CLI SDK Contributors
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.