open-shell-ai 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ include LICENSE
2
+ include README.md
3
+ include openshell.py
4
+ graft command
5
+ graft registry
6
+ prune image
7
+ prune skills
8
+ prune .venv
9
+ prune build
10
+ prune dist
11
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,245 @@
1
+ Metadata-Version: 2.4
2
+ Name: open-shell-ai
3
+ Version: 0.0.1
4
+ Summary: Open Shell - a JSON-pipeline shell. pip ships the core; extras come from the website registry.
5
+ Author: World Programming Society
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://openshell.dev
8
+ Project-URL: Registry, https://openshell.dev/registry
9
+ Keywords: shell,json,pipeline,cli,ai,mcp
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: System :: Shells
18
+ Requires-Python: >=3.12
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ # Open Shell
24
+
25
+ ![Open Shell](image/image1.png)
26
+
27
+ A cross-platform shell whose pipeline carries **JSON**, not text.
28
+
29
+ Bash pipes text. PowerShell pipes .NET objects. Open Shell pipes JSON records —
30
+ so every stage is structured, and the same pipeline works on Linux, macOS, and
31
+ Windows.
32
+
33
+ ```text
34
+ oshell> fs.ls -r . | where .size > 10kb | sort-by .size --desc | take 5
35
+ ```
36
+
37
+ Status: **0.0.1** (pre-alpha). Python 3.12+, standard library only.
38
+
39
+ The PyPI name is `open-shell-ai` (`openshell` and `open-shell` are taken). The
40
+ command you run is `openshell`.
41
+
42
+ ```bash
43
+ pip install open-shell-ai
44
+ openshell --version
45
+ ```
46
+
47
+ From this repo, without publishing:
48
+
49
+ ```bash
50
+ python3 -m venv .venv
51
+ .venv/bin/pip install -e .
52
+ .venv/bin/openshell -c 'help'
53
+ # or: ./openshell.py -c 'help'
54
+ ```
55
+
56
+ `pip` ships the **core + basic commands**. Extra and advanced commands are not
57
+ on PyPI — they live on the website registry.
58
+
59
+ ## Quick start
60
+
61
+ ```bash
62
+ # Interactive shell
63
+ openshell
64
+
65
+ # One pipeline, then exit
66
+ openshell -c 'fs.ls'
67
+ openshell -c 'fs.ls -r . | where .size > 10kb | sort-by .size --desc | take 5'
68
+ openshell -c 'help | select .name .summary'
69
+
70
+ # Force NDJSON (also the default when stdout is not a TTY)
71
+ openshell --json -c 'fs.ls | select .name .size'
72
+
73
+ # Works inside bash / jq
74
+ openshell -c 'fs.ls | select .name .size' | jq .name
75
+ ```
76
+
77
+ On a terminal, the last stage renders a table. When piped, it writes one JSON
78
+ object per line (NDJSON).
79
+
80
+ ## How the pipeline works
81
+
82
+ Each command **yields records**. Only sinks (`to json`, `to table`) print.
83
+ `|` passes the record stream downstream. `take 5` stops early, so
84
+ `fs.ls -r /usr | take 3` does not walk the whole tree.
85
+
86
+ ```text
87
+ fs.ls -r . → {name, path, is_dir, size, modified} …
88
+ | where .size > 10kb
89
+ | sort-by .size --desc
90
+ | take 5
91
+ | select .name .size
92
+ | to table
93
+ ```
94
+
95
+ Predicates use a leading dot for fields. Size units (`10kb`, `1mb`) and
96
+ `=~` (regex) are built in:
97
+
98
+ ```text
99
+ where .size > 10mb
100
+ where .name =~ "\.py$"
101
+ where .is_dir
102
+ ```
103
+
104
+ Errors are records, never raw tracebacks:
105
+
106
+ ```text
107
+ {"$t": "error", "code": "cmd.not_found", "message": "…", "hint": "…"}
108
+ ```
109
+
110
+ ## Basic commands (ship with pip)
111
+
112
+ | Command | Usage | What it does |
113
+ |---|---|---|
114
+ | `fs.ls` | `fs.ls [PATH] [-r] [-a]` | List files as records |
115
+ | `where` | `where .FIELD [OP VALUE]` | Filter (`>`, `<`, `==`, `!=`, `>=`, `<=`, `=~`) |
116
+ | `select` | `select .FIELD …` | Keep named fields |
117
+ | `sort-by` | `sort-by .FIELD [--desc]` | Sort (buffers the stream) |
118
+ | `take` | `take N` | First N records |
119
+ | `to` | `to json\|table [--compact]` | Render the stream |
120
+ | `help` | `help [NAME]` | List loaded commands as records |
121
+ | `command` | `command` | Same idea: every command as a record |
122
+ | `version` | `version` | Version and runtime |
123
+ | `search` | `search [QUERY]` | List extras on the website registry |
124
+ | `install` | `install NAME` | Download an extra into `~/.config/oshell/command/` |
125
+ | `remove` | `remove NAME` | Remove a website extra (not a built-in) |
126
+
127
+ `help` itself is a source command, so this works:
128
+
129
+ ```bash
130
+ openshell -c 'help | select .name .usage .origin'
131
+ ```
132
+
133
+ ## Website extras (not on PyPI)
134
+
135
+ Host the `registry/` folder so this URL exists:
136
+
137
+ `https://openshell.dev/registry/index.json`
138
+
139
+ ```bash
140
+ openshell -c 'search'
141
+ openshell -c 'install count'
142
+ openshell -c 'fs.ls | count'
143
+ openshell -c 'remove count'
144
+ ```
145
+
146
+ Until the site is live, use the copy in this repo:
147
+
148
+ ```bash
149
+ export OSHELL_REGISTRY_URL="file://$PWD/registry"
150
+ openshell -c 'search | to table'
151
+ openshell -c 'install uniq'
152
+ ```
153
+
154
+ Current extras in `registry/`:
155
+
156
+ | Command | Usage | What it does |
157
+ |---|---|---|
158
+ | `count` | `count` | Count incoming records |
159
+ | `uniq` | `uniq [.FIELD]` | Drop consecutive duplicates |
160
+
161
+ `install` writes `~/.config/oshell/command/<file>.py` and checks the `sha256`
162
+ in `registry/index.json`. Built-ins cannot be removed.
163
+
164
+ ## Writing a command
165
+
166
+ One file per command. Drop it in `command/` (basic, ships with pip) or
167
+ `registry/commands/` (website extra). The **decorator** is the name, not the
168
+ filename: `sort_by.py` registers `sort-by`.
169
+
170
+ ```python
171
+ from openshell import Records, command
172
+
173
+ @command("greet", "Say hello as a record", "greet [NAME]", source=True)
174
+ def greet(_input: Records, args: list[str]) -> Records:
175
+ yield {"hello": args[0] if args else "world"}
176
+ ```
177
+
178
+ No registration step. Files starting with `_` are skipped. A broken file is
179
+ reported and skipped; it does not kill the shell.
180
+
181
+ User-local commands (no install):
182
+
183
+ ```text
184
+ ~/.config/oshell/command/my_cmd.py
185
+ ```
186
+
187
+ Or any directory on `$OSHELL_COMMAND_PATH` (separated by `os.pathsep`).
188
+
189
+ Load order, later wins on a name clash:
190
+
191
+ 1. `<install>/oshell_command/*.py` — basic set from pip
192
+ 2. `~/.config/oshell/command/*.py` — website extras and your files
193
+ 3. `$OSHELL_COMMAND_PATH`
194
+
195
+ ## CLI
196
+
197
+ ```text
198
+ openshell start the interactive shell
199
+ openshell -c PIPELINE run one pipeline and exit
200
+ openshell --json -c ... force NDJSON output
201
+ openshell --version
202
+ openshell --help
203
+ ```
204
+
205
+ | Variable | Meaning |
206
+ |---|---|
207
+ | `OSHELL_REGISTRY_URL` | Catalog root (default `https://openshell.dev/registry`) |
208
+ | `OSHELL_COMMAND_PATH` | Extra command directories |
209
+ | `NO_COLOR` | Disable ANSI color |
210
+
211
+ ## Repository
212
+
213
+ ```text
214
+ openshell.py core: registry, loader, pipeline, REPL
215
+ command/ basic commands (shipped on PyPI)
216
+ registry/ website extras (not in the wheel)
217
+ index.json catalog + sha256
218
+ commands/*.py one extra command per file
219
+ skills/ design plan and build steps
220
+ image/ banner
221
+ ```
222
+
223
+ The repo folder is `command/`. It installs as `oshell_command/` so it does not
224
+ squat the name `command` in `site-packages`.
225
+
226
+ ## Publish
227
+
228
+ ```bash
229
+ pip install build twine
230
+ rm -rf dist
231
+ python -m build
232
+ twine upload dist/open_shell_ai-*
233
+ ```
234
+
235
+ Confirm extras stayed off the wheel:
236
+
237
+ ```bash
238
+ unzip -l dist/open_shell_ai-*.whl | grep -E 'count|uniq|registry' || echo ok
239
+ ```
240
+
241
+ Then upload `registry/` to `https://openshell.dev/registry`.
242
+
243
+ ## License
244
+
245
+ Apache-2.0
@@ -0,0 +1,223 @@
1
+ # Open Shell
2
+
3
+ ![Open Shell](image/image1.png)
4
+
5
+ A cross-platform shell whose pipeline carries **JSON**, not text.
6
+
7
+ Bash pipes text. PowerShell pipes .NET objects. Open Shell pipes JSON records —
8
+ so every stage is structured, and the same pipeline works on Linux, macOS, and
9
+ Windows.
10
+
11
+ ```text
12
+ oshell> fs.ls -r . | where .size > 10kb | sort-by .size --desc | take 5
13
+ ```
14
+
15
+ Status: **0.0.1** (pre-alpha). Python 3.12+, standard library only.
16
+
17
+ The PyPI name is `open-shell-ai` (`openshell` and `open-shell` are taken). The
18
+ command you run is `openshell`.
19
+
20
+ ```bash
21
+ pip install open-shell-ai
22
+ openshell --version
23
+ ```
24
+
25
+ From this repo, without publishing:
26
+
27
+ ```bash
28
+ python3 -m venv .venv
29
+ .venv/bin/pip install -e .
30
+ .venv/bin/openshell -c 'help'
31
+ # or: ./openshell.py -c 'help'
32
+ ```
33
+
34
+ `pip` ships the **core + basic commands**. Extra and advanced commands are not
35
+ on PyPI — they live on the website registry.
36
+
37
+ ## Quick start
38
+
39
+ ```bash
40
+ # Interactive shell
41
+ openshell
42
+
43
+ # One pipeline, then exit
44
+ openshell -c 'fs.ls'
45
+ openshell -c 'fs.ls -r . | where .size > 10kb | sort-by .size --desc | take 5'
46
+ openshell -c 'help | select .name .summary'
47
+
48
+ # Force NDJSON (also the default when stdout is not a TTY)
49
+ openshell --json -c 'fs.ls | select .name .size'
50
+
51
+ # Works inside bash / jq
52
+ openshell -c 'fs.ls | select .name .size' | jq .name
53
+ ```
54
+
55
+ On a terminal, the last stage renders a table. When piped, it writes one JSON
56
+ object per line (NDJSON).
57
+
58
+ ## How the pipeline works
59
+
60
+ Each command **yields records**. Only sinks (`to json`, `to table`) print.
61
+ `|` passes the record stream downstream. `take 5` stops early, so
62
+ `fs.ls -r /usr | take 3` does not walk the whole tree.
63
+
64
+ ```text
65
+ fs.ls -r . → {name, path, is_dir, size, modified} …
66
+ | where .size > 10kb
67
+ | sort-by .size --desc
68
+ | take 5
69
+ | select .name .size
70
+ | to table
71
+ ```
72
+
73
+ Predicates use a leading dot for fields. Size units (`10kb`, `1mb`) and
74
+ `=~` (regex) are built in:
75
+
76
+ ```text
77
+ where .size > 10mb
78
+ where .name =~ "\.py$"
79
+ where .is_dir
80
+ ```
81
+
82
+ Errors are records, never raw tracebacks:
83
+
84
+ ```text
85
+ {"$t": "error", "code": "cmd.not_found", "message": "…", "hint": "…"}
86
+ ```
87
+
88
+ ## Basic commands (ship with pip)
89
+
90
+ | Command | Usage | What it does |
91
+ |---|---|---|
92
+ | `fs.ls` | `fs.ls [PATH] [-r] [-a]` | List files as records |
93
+ | `where` | `where .FIELD [OP VALUE]` | Filter (`>`, `<`, `==`, `!=`, `>=`, `<=`, `=~`) |
94
+ | `select` | `select .FIELD …` | Keep named fields |
95
+ | `sort-by` | `sort-by .FIELD [--desc]` | Sort (buffers the stream) |
96
+ | `take` | `take N` | First N records |
97
+ | `to` | `to json\|table [--compact]` | Render the stream |
98
+ | `help` | `help [NAME]` | List loaded commands as records |
99
+ | `command` | `command` | Same idea: every command as a record |
100
+ | `version` | `version` | Version and runtime |
101
+ | `search` | `search [QUERY]` | List extras on the website registry |
102
+ | `install` | `install NAME` | Download an extra into `~/.config/oshell/command/` |
103
+ | `remove` | `remove NAME` | Remove a website extra (not a built-in) |
104
+
105
+ `help` itself is a source command, so this works:
106
+
107
+ ```bash
108
+ openshell -c 'help | select .name .usage .origin'
109
+ ```
110
+
111
+ ## Website extras (not on PyPI)
112
+
113
+ Host the `registry/` folder so this URL exists:
114
+
115
+ `https://openshell.dev/registry/index.json`
116
+
117
+ ```bash
118
+ openshell -c 'search'
119
+ openshell -c 'install count'
120
+ openshell -c 'fs.ls | count'
121
+ openshell -c 'remove count'
122
+ ```
123
+
124
+ Until the site is live, use the copy in this repo:
125
+
126
+ ```bash
127
+ export OSHELL_REGISTRY_URL="file://$PWD/registry"
128
+ openshell -c 'search | to table'
129
+ openshell -c 'install uniq'
130
+ ```
131
+
132
+ Current extras in `registry/`:
133
+
134
+ | Command | Usage | What it does |
135
+ |---|---|---|
136
+ | `count` | `count` | Count incoming records |
137
+ | `uniq` | `uniq [.FIELD]` | Drop consecutive duplicates |
138
+
139
+ `install` writes `~/.config/oshell/command/<file>.py` and checks the `sha256`
140
+ in `registry/index.json`. Built-ins cannot be removed.
141
+
142
+ ## Writing a command
143
+
144
+ One file per command. Drop it in `command/` (basic, ships with pip) or
145
+ `registry/commands/` (website extra). The **decorator** is the name, not the
146
+ filename: `sort_by.py` registers `sort-by`.
147
+
148
+ ```python
149
+ from openshell import Records, command
150
+
151
+ @command("greet", "Say hello as a record", "greet [NAME]", source=True)
152
+ def greet(_input: Records, args: list[str]) -> Records:
153
+ yield {"hello": args[0] if args else "world"}
154
+ ```
155
+
156
+ No registration step. Files starting with `_` are skipped. A broken file is
157
+ reported and skipped; it does not kill the shell.
158
+
159
+ User-local commands (no install):
160
+
161
+ ```text
162
+ ~/.config/oshell/command/my_cmd.py
163
+ ```
164
+
165
+ Or any directory on `$OSHELL_COMMAND_PATH` (separated by `os.pathsep`).
166
+
167
+ Load order, later wins on a name clash:
168
+
169
+ 1. `<install>/oshell_command/*.py` — basic set from pip
170
+ 2. `~/.config/oshell/command/*.py` — website extras and your files
171
+ 3. `$OSHELL_COMMAND_PATH`
172
+
173
+ ## CLI
174
+
175
+ ```text
176
+ openshell start the interactive shell
177
+ openshell -c PIPELINE run one pipeline and exit
178
+ openshell --json -c ... force NDJSON output
179
+ openshell --version
180
+ openshell --help
181
+ ```
182
+
183
+ | Variable | Meaning |
184
+ |---|---|
185
+ | `OSHELL_REGISTRY_URL` | Catalog root (default `https://openshell.dev/registry`) |
186
+ | `OSHELL_COMMAND_PATH` | Extra command directories |
187
+ | `NO_COLOR` | Disable ANSI color |
188
+
189
+ ## Repository
190
+
191
+ ```text
192
+ openshell.py core: registry, loader, pipeline, REPL
193
+ command/ basic commands (shipped on PyPI)
194
+ registry/ website extras (not in the wheel)
195
+ index.json catalog + sha256
196
+ commands/*.py one extra command per file
197
+ skills/ design plan and build steps
198
+ image/ banner
199
+ ```
200
+
201
+ The repo folder is `command/`. It installs as `oshell_command/` so it does not
202
+ squat the name `command` in `site-packages`.
203
+
204
+ ## Publish
205
+
206
+ ```bash
207
+ pip install build twine
208
+ rm -rf dist
209
+ python -m build
210
+ twine upload dist/open_shell_ai-*
211
+ ```
212
+
213
+ Confirm extras stayed off the wheel:
214
+
215
+ ```bash
216
+ unzip -l dist/open_shell_ai-*.whl | grep -E 'count|uniq|registry' || echo ok
217
+ ```
218
+
219
+ Then upload `registry/` to `https://openshell.dev/registry`.
220
+
221
+ ## License
222
+
223
+ Apache-2.0
@@ -0,0 +1,3 @@
1
+ # Present so packaging tools ship this folder inside the wheel, where it is
2
+ # installed as `oshell_command/`. The shell loads these files by path, not by
3
+ # import, so nothing here is executed. Files starting with `_` are skipped.