benchling-tools 0.7.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.
- benchling_tools-0.7.0/LICENSE +202 -0
- benchling_tools-0.7.0/NOTICE +2 -0
- benchling_tools-0.7.0/PKG-INFO +152 -0
- benchling_tools-0.7.0/README.md +111 -0
- benchling_tools-0.7.0/SKILL.md +385 -0
- benchling_tools-0.7.0/contracts/list-parameters.json +34 -0
- benchling_tools-0.7.0/contracts/openapi-manifest.json +68 -0
- benchling_tools-0.7.0/pyproject.toml +129 -0
- benchling_tools-0.7.0/schemas/change-spec.schema.json +287 -0
- benchling_tools-0.7.0/schemas/envelope.schema.json +30 -0
- benchling_tools-0.7.0/setup.cfg +4 -0
- benchling_tools-0.7.0/src/benchling_tools/__init__.py +12 -0
- benchling_tools-0.7.0/src/benchling_tools/api.py +221 -0
- benchling_tools-0.7.0/src/benchling_tools/auth.py +133 -0
- benchling_tools-0.7.0/src/benchling_tools/blob_download.py +197 -0
- benchling_tools-0.7.0/src/benchling_tools/change_spec.py +568 -0
- benchling_tools-0.7.0/src/benchling_tools/cli.py +1836 -0
- benchling_tools-0.7.0/src/benchling_tools/commands.py +213 -0
- benchling_tools-0.7.0/src/benchling_tools/config.py +65 -0
- benchling_tools-0.7.0/src/benchling_tools/credentials.py +264 -0
- benchling_tools-0.7.0/src/benchling_tools/environment.py +272 -0
- benchling_tools-0.7.0/src/benchling_tools/errors.py +124 -0
- benchling_tools-0.7.0/src/benchling_tools/export.py +670 -0
- benchling_tools-0.7.0/src/benchling_tools/issues.py +340 -0
- benchling_tools-0.7.0/src/benchling_tools/keychain.py +324 -0
- benchling_tools-0.7.0/src/benchling_tools/listing.py +506 -0
- benchling_tools-0.7.0/src/benchling_tools/mcp_server.py +395 -0
- benchling_tools-0.7.0/src/benchling_tools/models.py +293 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/__init__.py +13 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/base.py +69 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/blobs.py +489 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/containers.py +171 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/document.py +300 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/entry.py +148 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/fields.py +314 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/planner.py +938 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/readback.py +299 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/repository.py +232 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/result_update.py +907 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/results.py +628 -0
- benchling_tools-0.7.0/src/benchling_tools/plans/table.py +242 -0
- benchling_tools-0.7.0/src/benchling_tools/redact.py +73 -0
- benchling_tools-0.7.0/src/benchling_tools/runtime.py +85 -0
- benchling_tools-0.7.0/src/benchling_tools/services.py +2196 -0
- benchling_tools-0.7.0/src/benchling_tools/skill.py +64 -0
- benchling_tools-0.7.0/src/benchling_tools/stale.py +291 -0
- benchling_tools-0.7.0/src/benchling_tools/tls.py +10 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/PKG-INFO +152 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/SOURCES.txt +89 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/dependency_links.txt +1 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/entry_points.txt +2 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/requires.txt +16 -0
- benchling_tools-0.7.0/src/benchling_tools.egg-info/top_level.txt +1 -0
- benchling_tools-0.7.0/tests/test_api_client.py +231 -0
- benchling_tools-0.7.0/tests/test_auth.py +55 -0
- benchling_tools-0.7.0/tests/test_blob_download.py +221 -0
- benchling_tools-0.7.0/tests/test_blobs.py +457 -0
- benchling_tools-0.7.0/tests/test_change_spec.py +220 -0
- benchling_tools-0.7.0/tests/test_cli_commands.py +1113 -0
- benchling_tools-0.7.0/tests/test_commands.py +97 -0
- benchling_tools-0.7.0/tests/test_config_home.py +93 -0
- benchling_tools-0.7.0/tests/test_containers.py +105 -0
- benchling_tools-0.7.0/tests/test_contract_requests.py +351 -0
- benchling_tools-0.7.0/tests/test_credentials.py +1254 -0
- benchling_tools-0.7.0/tests/test_demo.py +22 -0
- benchling_tools-0.7.0/tests/test_environment.py +368 -0
- benchling_tools-0.7.0/tests/test_evaluated_cells.py +173 -0
- benchling_tools-0.7.0/tests/test_examples.py +119 -0
- benchling_tools-0.7.0/tests/test_export.py +1541 -0
- benchling_tools-0.7.0/tests/test_interview_docs.py +109 -0
- benchling_tools-0.7.0/tests/test_issues.py +384 -0
- benchling_tools-0.7.0/tests/test_listing.py +511 -0
- benchling_tools-0.7.0/tests/test_mcp_server.py +1461 -0
- benchling_tools-0.7.0/tests/test_native_keyring.py +29 -0
- benchling_tools-0.7.0/tests/test_openapi_drift.py +482 -0
- benchling_tools-0.7.0/tests/test_planner_safety.py +99 -0
- benchling_tools-0.7.0/tests/test_plans_document.py +370 -0
- benchling_tools-0.7.0/tests/test_plans_entry.py +181 -0
- benchling_tools-0.7.0/tests/test_plans_fields.py +185 -0
- benchling_tools-0.7.0/tests/test_plans_result_update.py +625 -0
- benchling_tools-0.7.0/tests/test_plans_results.py +502 -0
- benchling_tools-0.7.0/tests/test_plans_table.py +222 -0
- benchling_tools-0.7.0/tests/test_protected_env.py +281 -0
- benchling_tools-0.7.0/tests/test_result_ids.py +345 -0
- benchling_tools-0.7.0/tests/test_results_readback.py +740 -0
- benchling_tools-0.7.0/tests/test_results_rows.py +316 -0
- benchling_tools-0.7.0/tests/test_results_stale.py +323 -0
- benchling_tools-0.7.0/tests/test_services.py +674 -0
- benchling_tools-0.7.0/tests/test_skill_md.py +200 -0
- benchling_tools-0.7.0/tests/test_skill_package.py +128 -0
- benchling_tools-0.7.0/tests/test_surface_parity.py +186 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: benchling-tools
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: Safe, auditable tools for AI agents working in Benchling
|
|
5
|
+
Author-email: John Amodeo <120539773+jmamodeo@users.noreply.github.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/jmamodeo/benchling-tools
|
|
8
|
+
Project-URL: Repository, https://github.com/jmamodeo/benchling-tools
|
|
9
|
+
Project-URL: Issues, https://github.com/jmamodeo/benchling-tools/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/jmamodeo/benchling-tools/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: benchling,eln,cli,mcp,model-context-protocol,lab-automation,laboratory-informatics
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
License-File: NOTICE
|
|
25
|
+
Requires-Dist: filelock>=3.16
|
|
26
|
+
Requires-Dist: httpx<1,>=0.27
|
|
27
|
+
Requires-Dist: keyring<26,>=25
|
|
28
|
+
Requires-Dist: mcp<2,>=1.13
|
|
29
|
+
Requires-Dist: pydantic<3,>=2.8
|
|
30
|
+
Requires-Dist: typer<0.29,>=0.12
|
|
31
|
+
Requires-Dist: truststore<1,>=0.10
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: jsonschema<5,>=4.23; extra == "dev"
|
|
34
|
+
Requires-Dist: mypy<2,>=1.11; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest<10,>=8.3; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-asyncio<2,>=0.24; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-cov<8,>=5; extra == "dev"
|
|
38
|
+
Requires-Dist: pyyaml<7,>=6; extra == "dev"
|
|
39
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# benchling-tools
|
|
43
|
+
|
|
44
|
+
A CLI for coding agents and humans, directly mirrored as an MCP server for chat agents.
|
|
45
|
+
|
|
46
|
+
[](https://github.com/jmamodeo/benchling-tools/actions/workflows/ci.yml)
|
|
47
|
+
[](LICENSE)
|
|
48
|
+
[](pyproject.toml)
|
|
49
|
+
|
|
50
|
+
> **Unofficial; not affiliated with or endorsed by Benchling, Inc.** Benchling is a trademark of Benchling, Inc.
|
|
51
|
+
|
|
52
|
+
An electronic lab notebook is a scientific record, so letting an AI agent write to one directly is hard to trust. `benchling-tools` is a JSON-first command-line tool for a [Benchling](https://www.benchling.com) tenant that coding agents and people run directly. Each CLI command is also a tool on a local [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server, so chat agents get the same commands, arguments, and replies. It uses the public Benchling API only and never automates the browser. It covers six change families: template-based entry creation, document text, unstructured tables, entry fields, assay results, and containers. Every change is first previewed as an immutable, checksummed plan, and a separate, explicit step applies it. You can keep several environments, each saved with `benchling-tools auth login` with its client secret in the OS keychain. Both interfaces return one versioned JSON envelope and stable exit codes.
|
|
53
|
+
|
|
54
|
+
**No public Python API.** benchling-tools has no public Python API. Its Python modules are internal and may change in any release. To script Benchling from Python, use the official [Benchling SDK](https://docs.benchling.com/docs/getting-started-with-the-sdk). A public Python API may be added if there is enough interest; [open a GitHub issue](https://github.com/jmamodeo/benchling-tools/issues) to say you want one.
|
|
55
|
+
|
|
56
|
+
## Demo
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
A scripted playback of the offline fixture demo (no credentials, no network). The [demo page](docs/demo.md) has the full transcript and the [asciinema cast](docs/demo.cast).
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
Python 3.11 or newer and [`uv`](https://docs.astral.sh/uv/) are required. The distribution and the command are both named `benchling-tools`, published on [PyPI](https://pypi.org/project/benchling-tools/). Install it with `uv tool install`, or run it without installing with `uvx benchling-tools`.
|
|
65
|
+
|
|
66
|
+
```console
|
|
67
|
+
uv tool install benchling-tools
|
|
68
|
+
benchling-tools --help
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
From a checkout, use `uv tool install .`, or `uv run benchling-tools` after `uv sync` (add `--extra dev` for the test and lint tools); `uv sync` does not put `benchling-tools` on PATH.
|
|
72
|
+
|
|
73
|
+
## Log in
|
|
74
|
+
|
|
75
|
+
Create the Benchling app and grant it project access first; see the [setup guide](docs/setup.md). Then run `benchling-tools auth login` in your own terminal. The client secret is read from a hidden prompt, or from stdin with `--secret-stdin`, and is never accepted as an argument. It goes to the OS keychain; there is no plaintext fallback.
|
|
76
|
+
|
|
77
|
+
```console
|
|
78
|
+
benchling-tools auth login --env dev
|
|
79
|
+
# Tenant URL: https://your-tenant.benchling.com
|
|
80
|
+
# Client ID: your-app-client-id
|
|
81
|
+
# Client secret (not echoed):
|
|
82
|
+
benchling-tools auth status
|
|
83
|
+
benchling-tools doctor --env dev
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The toolkit acts as the **app**, with the app's permissions and audit identity, not the signed-in browser user. Login without a terminal, environment names, `auth status --check`, and `auth logout` are in the [reference](docs/reference.md#configuration).
|
|
87
|
+
|
|
88
|
+
## Headless Linux
|
|
89
|
+
|
|
90
|
+
Linux servers and agent machines often have no unlocked Secret Service on the session bus, and `benchling-tools` will not write the client secret to a plaintext file. Install `gnome-keyring` and `dbus`, unlock a keyring, and run the login in that session. A long-lived bus for MCP, later shells, and cron is needed too. The commands are in the [reference](docs/reference.md#headless-linux).
|
|
91
|
+
|
|
92
|
+
## CLI examples
|
|
93
|
+
|
|
94
|
+
There is no default environment: pass `--env NAME` (or `-e`) on every API command. Every command prints a versioned JSON envelope; diagnostics go to stderr.
|
|
95
|
+
|
|
96
|
+
```console
|
|
97
|
+
benchling-tools entry resolve EXP-0001 --env dev
|
|
98
|
+
benchling-tools entry inspect etr_abc123 --env dev
|
|
99
|
+
benchling-tools entry list --project src_example --modified-after 2026-01-01 --env dev
|
|
100
|
+
benchling-tools results tables etr_abc123 --env dev
|
|
101
|
+
benchling-tools export --kind table --part docpart_table1 --format csv --output measurements.csv --env dev
|
|
102
|
+
|
|
103
|
+
benchling-tools changes plan --entry etr_abc123 --family table --spec examples/table-set-cells.json --env dev
|
|
104
|
+
benchling-tools changes apply PLAN_ID --env dev
|
|
105
|
+
benchling-tools changes status PLAN_ID --env dev
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Every command, the six change families, spec shapes, result uploads and attachments, pending results, and the canned examples are in the [CLI and MCP reference](docs/reference.md#cli-examples).
|
|
109
|
+
|
|
110
|
+
## MCP server
|
|
111
|
+
|
|
112
|
+
One server serves every environment saved with `auth login`. The client config carries no secrets; the server reads the same `environments.json` file and OS keychain as the CLI.
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"benchling-tools": {
|
|
118
|
+
"command": "uvx",
|
|
119
|
+
"args": ["benchling-tools", "mcp", "serve"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Each CLI command is one tool named after its command path (`benchling-tools entry get` is `entry_get`), with the same arguments, defaults, and envelope. Commands that need a terminal or change local credentials have no tool. On Linux, add `DBUS_SESSION_BUS_ADDRESS` to the config's `env` block. The naming rule, the Linux config, and tool details are in the [reference](docs/reference.md#mcp-server).
|
|
126
|
+
|
|
127
|
+
## Safety model
|
|
128
|
+
|
|
129
|
+
- **Read-only by default.** `changes plan` only reads Benchling and writes an immutable local plan. Nothing changes remotely until `changes apply`, which re-checks the plan's version preconditions, refuses stale or already-used plans, never retries a write, and records each stage in a local journal.
|
|
130
|
+
- **Write guards on MCP.** The MCP server refuses `changes_apply` unless it was started with `--allow-writes ENV` for that environment. Reads, `export`, and `changes_plan` stay available.
|
|
131
|
+
- **Protected environments.** An environment marked with `auth protect` refuses a write unless its name is typed twice: `--env prod --confirm-env prod` on the CLI, or `confirm_env` equal to `env` on MCP.
|
|
132
|
+
|
|
133
|
+
The full safety model, design tradeoffs, exit codes, and known limitations are in the [reference](docs/reference.md#safety-model). The [threat model](docs/threat-model.md) covers what these controls do not protect against.
|
|
134
|
+
|
|
135
|
+
## Documentation
|
|
136
|
+
|
|
137
|
+
- [SKILL.md](SKILL.md): the agent guide, also installed with the package (`benchling-tools skill show`)
|
|
138
|
+
- [CLI and MCP reference](docs/reference.md): every command and tool, configuration, safety model, exit codes, and known limitations
|
|
139
|
+
- [Setup guide](docs/setup.md), [API limitations](docs/api-limitations.md), and [research record](docs/research.md)
|
|
140
|
+
- [Threat model](docs/threat-model.md): credentials, stale or replayed plans, write scoping, and agent misuse, including the limits of those controls
|
|
141
|
+
- [ARCHITECTURE.md](ARCHITECTURE.md): the plan, apply, and journal sequence and the module map
|
|
142
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
143
|
+
|
|
144
|
+
## Citation
|
|
145
|
+
|
|
146
|
+
If you use this software, please cite it. GitHub's "Cite this repository" button uses [`CITATION.cff`](CITATION.cff) for [jmamodeo/benchling-tools](https://github.com/jmamodeo/benchling-tools).
|
|
147
|
+
|
|
148
|
+
## Contributing, security, license
|
|
149
|
+
|
|
150
|
+
- [Contributing guide](CONTRIBUTING.md), including tests and the opt-in sandbox exercise, and [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
151
|
+
- [Security policy](SECURITY.md)
|
|
152
|
+
- Licensed under the [Apache License 2.0](LICENSE); see [NOTICE](NOTICE). Releases up to and including 0.4.1 were published under the MIT License and remain available under it.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# benchling-tools
|
|
2
|
+
|
|
3
|
+
A CLI for coding agents and humans, directly mirrored as an MCP server for chat agents.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/jmamodeo/benchling-tools/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](pyproject.toml)
|
|
8
|
+
|
|
9
|
+
> **Unofficial; not affiliated with or endorsed by Benchling, Inc.** Benchling is a trademark of Benchling, Inc.
|
|
10
|
+
|
|
11
|
+
An electronic lab notebook is a scientific record, so letting an AI agent write to one directly is hard to trust. `benchling-tools` is a JSON-first command-line tool for a [Benchling](https://www.benchling.com) tenant that coding agents and people run directly. Each CLI command is also a tool on a local [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server, so chat agents get the same commands, arguments, and replies. It uses the public Benchling API only and never automates the browser. It covers six change families: template-based entry creation, document text, unstructured tables, entry fields, assay results, and containers. Every change is first previewed as an immutable, checksummed plan, and a separate, explicit step applies it. You can keep several environments, each saved with `benchling-tools auth login` with its client secret in the OS keychain. Both interfaces return one versioned JSON envelope and stable exit codes.
|
|
12
|
+
|
|
13
|
+
**No public Python API.** benchling-tools has no public Python API. Its Python modules are internal and may change in any release. To script Benchling from Python, use the official [Benchling SDK](https://docs.benchling.com/docs/getting-started-with-the-sdk). A public Python API may be added if there is enough interest; [open a GitHub issue](https://github.com/jmamodeo/benchling-tools/issues) to say you want one.
|
|
14
|
+
|
|
15
|
+
## Demo
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
A scripted playback of the offline fixture demo (no credentials, no network). The [demo page](docs/demo.md) has the full transcript and the [asciinema cast](docs/demo.cast).
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
Python 3.11 or newer and [`uv`](https://docs.astral.sh/uv/) are required. The distribution and the command are both named `benchling-tools`, published on [PyPI](https://pypi.org/project/benchling-tools/). Install it with `uv tool install`, or run it without installing with `uvx benchling-tools`.
|
|
24
|
+
|
|
25
|
+
```console
|
|
26
|
+
uv tool install benchling-tools
|
|
27
|
+
benchling-tools --help
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
From a checkout, use `uv tool install .`, or `uv run benchling-tools` after `uv sync` (add `--extra dev` for the test and lint tools); `uv sync` does not put `benchling-tools` on PATH.
|
|
31
|
+
|
|
32
|
+
## Log in
|
|
33
|
+
|
|
34
|
+
Create the Benchling app and grant it project access first; see the [setup guide](docs/setup.md). Then run `benchling-tools auth login` in your own terminal. The client secret is read from a hidden prompt, or from stdin with `--secret-stdin`, and is never accepted as an argument. It goes to the OS keychain; there is no plaintext fallback.
|
|
35
|
+
|
|
36
|
+
```console
|
|
37
|
+
benchling-tools auth login --env dev
|
|
38
|
+
# Tenant URL: https://your-tenant.benchling.com
|
|
39
|
+
# Client ID: your-app-client-id
|
|
40
|
+
# Client secret (not echoed):
|
|
41
|
+
benchling-tools auth status
|
|
42
|
+
benchling-tools doctor --env dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The toolkit acts as the **app**, with the app's permissions and audit identity, not the signed-in browser user. Login without a terminal, environment names, `auth status --check`, and `auth logout` are in the [reference](docs/reference.md#configuration).
|
|
46
|
+
|
|
47
|
+
## Headless Linux
|
|
48
|
+
|
|
49
|
+
Linux servers and agent machines often have no unlocked Secret Service on the session bus, and `benchling-tools` will not write the client secret to a plaintext file. Install `gnome-keyring` and `dbus`, unlock a keyring, and run the login in that session. A long-lived bus for MCP, later shells, and cron is needed too. The commands are in the [reference](docs/reference.md#headless-linux).
|
|
50
|
+
|
|
51
|
+
## CLI examples
|
|
52
|
+
|
|
53
|
+
There is no default environment: pass `--env NAME` (or `-e`) on every API command. Every command prints a versioned JSON envelope; diagnostics go to stderr.
|
|
54
|
+
|
|
55
|
+
```console
|
|
56
|
+
benchling-tools entry resolve EXP-0001 --env dev
|
|
57
|
+
benchling-tools entry inspect etr_abc123 --env dev
|
|
58
|
+
benchling-tools entry list --project src_example --modified-after 2026-01-01 --env dev
|
|
59
|
+
benchling-tools results tables etr_abc123 --env dev
|
|
60
|
+
benchling-tools export --kind table --part docpart_table1 --format csv --output measurements.csv --env dev
|
|
61
|
+
|
|
62
|
+
benchling-tools changes plan --entry etr_abc123 --family table --spec examples/table-set-cells.json --env dev
|
|
63
|
+
benchling-tools changes apply PLAN_ID --env dev
|
|
64
|
+
benchling-tools changes status PLAN_ID --env dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Every command, the six change families, spec shapes, result uploads and attachments, pending results, and the canned examples are in the [CLI and MCP reference](docs/reference.md#cli-examples).
|
|
68
|
+
|
|
69
|
+
## MCP server
|
|
70
|
+
|
|
71
|
+
One server serves every environment saved with `auth login`. The client config carries no secrets; the server reads the same `environments.json` file and OS keychain as the CLI.
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"benchling-tools": {
|
|
77
|
+
"command": "uvx",
|
|
78
|
+
"args": ["benchling-tools", "mcp", "serve"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Each CLI command is one tool named after its command path (`benchling-tools entry get` is `entry_get`), with the same arguments, defaults, and envelope. Commands that need a terminal or change local credentials have no tool. On Linux, add `DBUS_SESSION_BUS_ADDRESS` to the config's `env` block. The naming rule, the Linux config, and tool details are in the [reference](docs/reference.md#mcp-server).
|
|
85
|
+
|
|
86
|
+
## Safety model
|
|
87
|
+
|
|
88
|
+
- **Read-only by default.** `changes plan` only reads Benchling and writes an immutable local plan. Nothing changes remotely until `changes apply`, which re-checks the plan's version preconditions, refuses stale or already-used plans, never retries a write, and records each stage in a local journal.
|
|
89
|
+
- **Write guards on MCP.** The MCP server refuses `changes_apply` unless it was started with `--allow-writes ENV` for that environment. Reads, `export`, and `changes_plan` stay available.
|
|
90
|
+
- **Protected environments.** An environment marked with `auth protect` refuses a write unless its name is typed twice: `--env prod --confirm-env prod` on the CLI, or `confirm_env` equal to `env` on MCP.
|
|
91
|
+
|
|
92
|
+
The full safety model, design tradeoffs, exit codes, and known limitations are in the [reference](docs/reference.md#safety-model). The [threat model](docs/threat-model.md) covers what these controls do not protect against.
|
|
93
|
+
|
|
94
|
+
## Documentation
|
|
95
|
+
|
|
96
|
+
- [SKILL.md](SKILL.md): the agent guide, also installed with the package (`benchling-tools skill show`)
|
|
97
|
+
- [CLI and MCP reference](docs/reference.md): every command and tool, configuration, safety model, exit codes, and known limitations
|
|
98
|
+
- [Setup guide](docs/setup.md), [API limitations](docs/api-limitations.md), and [research record](docs/research.md)
|
|
99
|
+
- [Threat model](docs/threat-model.md): credentials, stale or replayed plans, write scoping, and agent misuse, including the limits of those controls
|
|
100
|
+
- [ARCHITECTURE.md](ARCHITECTURE.md): the plan, apply, and journal sequence and the module map
|
|
101
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
102
|
+
|
|
103
|
+
## Citation
|
|
104
|
+
|
|
105
|
+
If you use this software, please cite it. GitHub's "Cite this repository" button uses [`CITATION.cff`](CITATION.cff) for [jmamodeo/benchling-tools](https://github.com/jmamodeo/benchling-tools).
|
|
106
|
+
|
|
107
|
+
## Contributing, security, license
|
|
108
|
+
|
|
109
|
+
- [Contributing guide](CONTRIBUTING.md), including tests and the opt-in sandbox exercise, and [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
110
|
+
- [Security policy](SECURITY.md)
|
|
111
|
+
- Licensed under the [Apache License 2.0](LICENSE); see [NOTICE](NOTICE). Releases up to and including 0.4.1 were published under the MIT License and remain available under it.
|