@voidlabs.gg/voidshift 0.0.0-stage → 0.4.1
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.
- package/LICENSE +202 -0
- package/README.md +136 -2
- package/dist/checks.d.ts +9 -0
- package/dist/checks.js +51 -0
- package/dist/commands/args.d.ts +13 -0
- package/dist/commands/args.js +22 -0
- package/dist/commands/config.d.ts +1 -0
- package/dist/commands/config.js +181 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.js +52 -0
- package/dist/commands/help.d.ts +3 -0
- package/dist/commands/help.js +59 -0
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +135 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +60 -0
- package/dist/commands/tools.d.ts +9 -0
- package/dist/commands/tools.js +111 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.js +79 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +29 -0
- package/dist/dotted.d.ts +9 -0
- package/dist/dotted.js +86 -0
- package/dist/loader.d.ts +6 -0
- package/dist/loader.js +51 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +93 -0
- package/dist/registry.d.ts +8 -0
- package/dist/registry.js +26 -0
- package/dist/tool.d.ts +51 -0
- package/dist/tool.js +4 -0
- package/dist/tui/actions.d.ts +17 -0
- package/dist/tui/actions.js +99 -0
- package/dist/tui/app.d.ts +6 -0
- package/dist/tui/app.js +246 -0
- package/dist/tui/context.d.ts +62 -0
- package/dist/tui/context.js +48 -0
- package/dist/tui/data.d.ts +196 -0
- package/dist/tui/data.js +302 -0
- package/dist/tui/format.d.ts +11 -0
- package/dist/tui/format.js +54 -0
- package/dist/tui/home.d.ts +51 -0
- package/dist/tui/home.js +336 -0
- package/dist/tui/keys.d.ts +2 -0
- package/dist/tui/keys.js +107 -0
- package/dist/tui/nav.d.ts +24 -0
- package/dist/tui/nav.js +32 -0
- package/dist/tui/palette.d.ts +32 -0
- package/dist/tui/palette.js +269 -0
- package/dist/tui/run.d.ts +1 -0
- package/dist/tui/run.js +20 -0
- package/dist/tui/screens/agents.d.ts +6 -0
- package/dist/tui/screens/agents.js +44 -0
- package/dist/tui/screens/awake.d.ts +23 -0
- package/dist/tui/screens/awake.js +209 -0
- package/dist/tui/screens/checks.d.ts +11 -0
- package/dist/tui/screens/checks.js +106 -0
- package/dist/tui/screens/homes.d.ts +14 -0
- package/dist/tui/screens/homes.js +99 -0
- package/dist/tui/screens/list-window.d.ts +6 -0
- package/dist/tui/screens/list-window.js +18 -0
- package/dist/tui/screens/log.d.ts +26 -0
- package/dist/tui/screens/log.js +266 -0
- package/dist/tui/screens/memory.d.ts +24 -0
- package/dist/tui/screens/memory.js +174 -0
- package/dist/tui/screens/project-form.d.ts +14 -0
- package/dist/tui/screens/project-form.js +137 -0
- package/dist/tui/screens/projects.d.ts +17 -0
- package/dist/tui/screens/projects.js +109 -0
- package/dist/tui/screens/runs.d.ts +43 -0
- package/dist/tui/screens/runs.js +420 -0
- package/dist/tui/screens/settings.d.ts +17 -0
- package/dist/tui/screens/settings.js +153 -0
- package/dist/tui/screens/workflow-form.d.ts +58 -0
- package/dist/tui/screens/workflow-form.js +375 -0
- package/dist/tui/screens/workflows.d.ts +41 -0
- package/dist/tui/screens/workflows.js +174 -0
- package/dist/tui/screens.d.ts +30 -0
- package/dist/tui/screens.js +172 -0
- package/dist/tui/theme.d.ts +14 -0
- package/dist/tui/theme.js +18 -0
- package/dist/tui/widgets.d.ts +122 -0
- package/dist/tui/widgets.js +264 -0
- package/dist/ui.d.ts +5 -0
- package/dist/ui.js +82 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +17 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,137 @@
|
|
|
1
|
-
#
|
|
1
|
+
# VoidShift
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One CLI for the Void dev tools. Install it once, run `vsf` (short for
|
|
4
|
+
`voidshift`), pick the tools you want, and it sets each one up with good
|
|
5
|
+
defaults you can change. Everything setup does can be seen and changed later
|
|
6
|
+
from the command line.
|
|
7
|
+
|
|
8
|
+
> Early release. macOS only for now; Windows and Linux are next.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm i -g @voidlabs.gg/voidshift
|
|
12
|
+
vsf setup # pick tools and set them up
|
|
13
|
+
vsf setup --defaults # take every default, ask only what has none
|
|
14
|
+
vsf # what every tool is doing (first run: setup)
|
|
15
|
+
vsf help # every command; vsf <tool> help for a tool's
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Tools
|
|
19
|
+
|
|
20
|
+
| Tool | What it does |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `awake` | Keeps your Mac running, on battery and with the lid closed, and puts sleep back when the battery runs low, the Mac gets hot, a timer ends or it restarts |
|
|
23
|
+
| `agents` | Agents for Claude Code and Codex, and workflows that run them in the background off your Linear cards |
|
|
24
|
+
| `memory` | A markdown vault of notes, recalled into Claude Code and Codex before every prompt |
|
|
25
|
+
|
|
26
|
+
### awake
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
vsf awake on [--until 7am | --for 6h] [--battery 20]
|
|
30
|
+
vsf awake status
|
|
31
|
+
vsf awake logs [-f] # what the watchdog decided
|
|
32
|
+
vsf awake off
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Setup asks for your Mac password once to add a rule that allows only
|
|
36
|
+
`pmset -a disablesleep 0|1`. A small watchdog checks every minute and turns
|
|
37
|
+
sleep back on when it should. Keep a closed Mac out of a bag: with no airflow
|
|
38
|
+
it runs hot.
|
|
39
|
+
|
|
40
|
+
### agents
|
|
41
|
+
|
|
42
|
+
Five agents, installed into Claude Code (and Codex if you use it):
|
|
43
|
+
|
|
44
|
+
| Agent | What it does |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Plan | plans a Linear card against the code |
|
|
47
|
+
| Plan review | checks a plan before it is published |
|
|
48
|
+
| Publish | posts the plan to the card and hands it over |
|
|
49
|
+
| Dev | implements the plan and opens a draft PR |
|
|
50
|
+
| QA | CI, then code review, then a usability check in a headless browser |
|
|
51
|
+
|
|
52
|
+
Use them yourself (`/vs-plan ENG-123` in Claude Code), or let a **workflow**
|
|
53
|
+
run them. A workflow starts when one of your Linear cards gets a label, runs
|
|
54
|
+
agents in order in a project (a repo on your Mac), and sends work back to the
|
|
55
|
+
step that made it when a check fails:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
when ENG + vs-plan: Dev → QA in tether-relay
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The runner checks Linear every minute, works in its own copy of the repo so
|
|
62
|
+
your checkout is never touched, and keeps two labels on the card as it goes: the
|
|
63
|
+
stage (`vs-planning`, `vs-plan-review`, `vs-dev`, `vs-qa`, then `vs-qa-verified`
|
|
64
|
+
or `vs-parked`) and the round (`vs-v1`, `vs-v2`). On Linear it posts the plan and
|
|
65
|
+
one final comment, nothing in between.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
vsf agents status # runner, the card in progress, parked cards
|
|
69
|
+
vsf agents run ENG-123 [--from qa] # run one card now, in this terminal
|
|
70
|
+
vsf agents start | stop | restart # the background runner (stop cancels the card)
|
|
71
|
+
vsf agents pause | resume # pick up no new cards for a while
|
|
72
|
+
vsf agents cancel | retry ENG-123 # stop a card, or queue a parked one again
|
|
73
|
+
vsf agents runs | show ENG-123 # what happened, step by step
|
|
74
|
+
vsf agents logs [ENG-123] [-f] # the runner log, or a card's step logs
|
|
75
|
+
vsf agents workflows # workflows in the order they match
|
|
76
|
+
vsf agents workflow add|edit|show|rename|move|rm
|
|
77
|
+
vsf agents projects | project add|edit|show|rename|rm
|
|
78
|
+
vsf agents homes | link DIR # where the agents are installed
|
|
79
|
+
vsf agents clean # old worktrees and run logs
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### memory
|
|
83
|
+
|
|
84
|
+
A folder of markdown notes, one topic per note, with an `INDEX.md` holding one
|
|
85
|
+
keyword line per note. Before every prompt, the words you type are matched
|
|
86
|
+
against the index and the best notes are handed to Claude Code or Codex. A
|
|
87
|
+
`memory` skill tells them how to read the vault and when to write a note:
|
|
88
|
+
decisions and their why, dead ends, things that are not obvious from the code.
|
|
89
|
+
Background agents read it for each card and save what they learn.
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
vsf memory status # the vault and where recall is on
|
|
93
|
+
vsf memory search WORDS # notes recall would bring up
|
|
94
|
+
vsf memory try "a prompt" # exactly what recall would add to that prompt
|
|
95
|
+
vsf memory check # notes missing from INDEX.md, broken links
|
|
96
|
+
vsf memory on | off # turn recall on or off
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Setup creates a vault at `~/memory` or uses one you already have. Codex asks you
|
|
100
|
+
to trust the recall hook once: run `/hooks` in Codex.
|
|
101
|
+
|
|
102
|
+
## What to know
|
|
103
|
+
|
|
104
|
+
- **Your own logins.** Agents run the official `claude` and `codex` CLIs you
|
|
105
|
+
already use, signed in with your own account. VoidShift never reads or
|
|
106
|
+
stores those credentials. The Linear API key for the runner lives in your
|
|
107
|
+
macOS Keychain.
|
|
108
|
+
- **Trust.** The Dev agent can run shell commands inside its copy of the repo
|
|
109
|
+
so it can install and test. Review its pull requests like any other.
|
|
110
|
+
- **Your config** lives in `~/.config/voidshift`.
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
vsf doctor # check everything is set up, and whether an update is out
|
|
114
|
+
vsf config [tool] # every saved setting
|
|
115
|
+
vsf config set KEY VALUE # e.g. vsf config set agents.models.dev opus
|
|
116
|
+
vsf config edit [tool] # edit settings in $EDITOR, checked before saving
|
|
117
|
+
vsf update # update VoidShift and every tool you added
|
|
118
|
+
vsf tools # list tools
|
|
119
|
+
|
|
120
|
+
Read commands take `--json`. Workflow and project names can be shortened to
|
|
121
|
+
any unique start, e.g. `tether` for `tether-relay-build`.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Development
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
pnpm install
|
|
128
|
+
pnpm test
|
|
129
|
+
node packages/cli/src/main.ts
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Node 22.18 or newer runs the TypeScript sources directly. Releases are cut by
|
|
133
|
+
pushing a `v*` tag; CI publishes every package at that version.
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
package/dist/checks.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Check } from './tool.ts';
|
|
2
|
+
export interface RunResult {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
stdout: string;
|
|
5
|
+
}
|
|
6
|
+
export type Run = (cmd: string, args: string[]) => RunResult;
|
|
7
|
+
export declare const run: Run;
|
|
8
|
+
export declare function atLeast(version: string, min: string): boolean;
|
|
9
|
+
export declare function baseChecks(platform: string, nodeVersion: string, exec: Run): Check[];
|
package/dist/checks.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
export const run = (cmd, args) => {
|
|
3
|
+
const r = spawnSync(cmd, args, { encoding: 'utf8', timeout: 10_000 });
|
|
4
|
+
return { ok: r.status === 0, stdout: (r.stdout ?? '').trim() };
|
|
5
|
+
};
|
|
6
|
+
export function atLeast(version, min) {
|
|
7
|
+
const a = version.replace(/^v/, '').split('.').map(Number);
|
|
8
|
+
const b = min.split('.').map(Number);
|
|
9
|
+
for (let i = 0; i < b.length; i++) {
|
|
10
|
+
const x = a[i] ?? 0;
|
|
11
|
+
const y = b[i] ?? 0;
|
|
12
|
+
if (x !== y)
|
|
13
|
+
return x > y;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
function firstLine(s) {
|
|
18
|
+
return s.split('\n')[0] ?? '';
|
|
19
|
+
}
|
|
20
|
+
export function baseChecks(platform, nodeVersion, exec) {
|
|
21
|
+
const checks = [];
|
|
22
|
+
checks.push(platform === 'darwin'
|
|
23
|
+
? { name: 'macOS', status: 'ok', detail: 'supported' }
|
|
24
|
+
: { name: 'macOS', status: 'fail', detail: `${platform} is not supported yet`, fix: 'The MVP runs on macOS only' });
|
|
25
|
+
checks.push(atLeast(nodeVersion, '22.18')
|
|
26
|
+
? { name: 'Node', status: 'ok', detail: nodeVersion }
|
|
27
|
+
: { name: 'Node', status: 'fail', detail: `${nodeVersion} is too old`, fix: 'Install Node 22.18 or newer' });
|
|
28
|
+
const git = exec('git', ['--version']);
|
|
29
|
+
checks.push(git.ok
|
|
30
|
+
? { name: 'git', status: 'ok', detail: git.stdout }
|
|
31
|
+
: { name: 'git', status: 'fail', detail: 'not found', fix: 'xcode-select --install' });
|
|
32
|
+
const gh = exec('gh', ['auth', 'token']);
|
|
33
|
+
const ghInstalled = gh.ok || exec('gh', ['--version']).ok;
|
|
34
|
+
checks.push(gh.ok
|
|
35
|
+
? { name: 'GitHub CLI', status: 'ok', detail: 'logged in' }
|
|
36
|
+
: ghInstalled
|
|
37
|
+
? { name: 'GitHub CLI', status: 'warn', detail: 'not logged in', fix: 'gh auth login' }
|
|
38
|
+
: { name: 'GitHub CLI', status: 'warn', detail: 'not found', fix: 'brew install gh' });
|
|
39
|
+
const claude = exec('claude', ['--version']);
|
|
40
|
+
const codex = exec('codex', ['--version']);
|
|
41
|
+
checks.push(claude.ok
|
|
42
|
+
? { name: 'Claude Code', status: 'ok', detail: firstLine(claude.stdout) }
|
|
43
|
+
: { name: 'Claude Code', status: 'warn', detail: 'not found', fix: 'https://docs.claude.com/en/docs/claude-code' });
|
|
44
|
+
checks.push(codex.ok
|
|
45
|
+
? { name: 'Codex CLI', status: 'ok', detail: firstLine(codex.stdout) }
|
|
46
|
+
: { name: 'Codex CLI', status: 'warn', detail: 'not found', fix: 'npm i -g @openai/codex' });
|
|
47
|
+
if (!claude.ok && !codex.ok) {
|
|
48
|
+
checks.push({ name: 'Agent', status: 'fail', detail: 'neither Claude Code nor Codex is installed', fix: 'Install at least one' });
|
|
49
|
+
}
|
|
50
|
+
return checks;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ParseArgsOptionsConfig } from 'node:util';
|
|
2
|
+
export declare const helpOption: {
|
|
3
|
+
readonly help: {
|
|
4
|
+
readonly type: "boolean";
|
|
5
|
+
readonly short: "h";
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare function parseFlags(args: string[], options: ParseArgsOptionsConfig, usage: string): {
|
|
9
|
+
values: Record<string, string | boolean | undefined>;
|
|
10
|
+
positionals: string[];
|
|
11
|
+
} | null;
|
|
12
|
+
export declare const wantsHelp: (a: string[]) => boolean;
|
|
13
|
+
export declare function needsTerminal(command: string, hint: string): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
export const helpOption = { help: { type: 'boolean', short: 'h' } };
|
|
3
|
+
// Parse flags the same way for every command. On bad input print one plain
|
|
4
|
+
// line plus the usage and return null; callers then return 2.
|
|
5
|
+
export function parseFlags(args, options, usage) {
|
|
6
|
+
try {
|
|
7
|
+
const { values, positionals } = parseArgs({ args, options: { ...helpOption, ...options }, allowPositionals: true, strict: true });
|
|
8
|
+
return { values: values, positionals };
|
|
9
|
+
}
|
|
10
|
+
catch (err) {
|
|
11
|
+
console.error(`${err.message.split('. ')[0]?.replace(/\.$/, '')}.\n\n${usage}`);
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export const wantsHelp = (a) => a.includes('--help') || a.includes('-h');
|
|
16
|
+
// Commands that need prompts refuse to run without a terminal.
|
|
17
|
+
export function needsTerminal(command, hint) {
|
|
18
|
+
if (process.stdin.isTTY)
|
|
19
|
+
return false;
|
|
20
|
+
console.error(`vsf ${command} needs a terminal to ask its questions. ${hint}`);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function config(args: string[]): Promise<number>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { configDir, readConfig } from "../config.js";
|
|
6
|
+
import { flatten, getPath, maskDeep, parseValue, setPath, unsetPath } from "../dotted.js";
|
|
7
|
+
import { loadTool } from "../loader.js";
|
|
8
|
+
import { findTool } from "../registry.js";
|
|
9
|
+
import { context } from "../config.js";
|
|
10
|
+
import { parseFlags } from "./args.js";
|
|
11
|
+
import { usages } from "./help.js";
|
|
12
|
+
// Unknown tools are a usage mistake (2); the rest are plain failures (1).
|
|
13
|
+
const UNKNOWN = 'unknown tool: ';
|
|
14
|
+
// A tool that is added and keeps settings, or the one-line reason it is not.
|
|
15
|
+
async function configTool(name) {
|
|
16
|
+
const entry = findTool(name);
|
|
17
|
+
if (!entry)
|
|
18
|
+
return `${UNKNOWN}${name}. Run vsf tools to see the list.`;
|
|
19
|
+
if (!readConfig().tools.includes(name))
|
|
20
|
+
return `${name} is not added. Run vsf add ${name}`;
|
|
21
|
+
const tool = await loadTool(entry, configDir());
|
|
22
|
+
return tool.config ? tool : `${name} has no settings to configure.`;
|
|
23
|
+
}
|
|
24
|
+
// Added tools that keep settings, for the bare listing and for edit.
|
|
25
|
+
async function withConfig() {
|
|
26
|
+
const out = [];
|
|
27
|
+
for (const name of readConfig().tools) {
|
|
28
|
+
if (!findTool(name))
|
|
29
|
+
continue;
|
|
30
|
+
const t = await configTool(name);
|
|
31
|
+
if (typeof t !== 'string')
|
|
32
|
+
out.push([name, t]);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
async function show(name, json) {
|
|
37
|
+
let tools;
|
|
38
|
+
if (name) {
|
|
39
|
+
const t = await configTool(name);
|
|
40
|
+
if (typeof t === 'string')
|
|
41
|
+
return fail(t);
|
|
42
|
+
tools = [[name, t]];
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
tools = await withConfig();
|
|
46
|
+
}
|
|
47
|
+
const all = {};
|
|
48
|
+
for (const [n, t] of tools)
|
|
49
|
+
all[n] = maskDeep(t.config.read(configDir()));
|
|
50
|
+
if (json)
|
|
51
|
+
console.log(JSON.stringify(all, null, 2));
|
|
52
|
+
else
|
|
53
|
+
for (const [n, v] of Object.entries(all))
|
|
54
|
+
for (const [k, leaf] of flatten(v, n))
|
|
55
|
+
console.log(`${k} = ${JSON.stringify(leaf)}`);
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
function fail(line) {
|
|
59
|
+
console.error(line);
|
|
60
|
+
return line.startsWith(UNKNOWN) ? 2 : 1;
|
|
61
|
+
}
|
|
62
|
+
const splitKey = (key) => {
|
|
63
|
+
const [tool = '', ...path] = key.split('.');
|
|
64
|
+
return { tool, path };
|
|
65
|
+
};
|
|
66
|
+
async function get(key) {
|
|
67
|
+
if (!key)
|
|
68
|
+
return usageError('get needs a KEY.');
|
|
69
|
+
const { tool, path } = splitKey(key);
|
|
70
|
+
const t = await configTool(tool);
|
|
71
|
+
if (typeof t === 'string')
|
|
72
|
+
return fail(t);
|
|
73
|
+
const value = getPath(t.config.read(configDir()), path);
|
|
74
|
+
if (value === undefined)
|
|
75
|
+
return fail(`no setting ${key}`);
|
|
76
|
+
const shown = maskDeep(value, path[path.length - 1]);
|
|
77
|
+
console.log(typeof shown === 'string' ? shown : JSON.stringify(shown, null, 2));
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
function usageError(line) {
|
|
81
|
+
console.error(`${line}\n\n${usages.config}`);
|
|
82
|
+
return 2;
|
|
83
|
+
}
|
|
84
|
+
// Apply a change to a fresh read, then let the tool validate and save it.
|
|
85
|
+
async function change(key, apply, done) {
|
|
86
|
+
const { tool, path } = splitKey(key ?? '');
|
|
87
|
+
if (!key || !path.length)
|
|
88
|
+
return usageError('Give a KEY like <tool>.<setting>.');
|
|
89
|
+
const t = await configTool(tool);
|
|
90
|
+
if (typeof t === 'string')
|
|
91
|
+
return fail(t);
|
|
92
|
+
const problems = t.config.write(configDir(), apply(t.config.read(configDir()), path));
|
|
93
|
+
if (problems.length) {
|
|
94
|
+
for (const line of problems)
|
|
95
|
+
console.error(line);
|
|
96
|
+
return 1;
|
|
97
|
+
}
|
|
98
|
+
console.log(done);
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
async function edit(name) {
|
|
102
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
103
|
+
console.error('vsf config edit needs a terminal. Use vsf config set KEY VALUE.');
|
|
104
|
+
return 2;
|
|
105
|
+
}
|
|
106
|
+
let target = name;
|
|
107
|
+
if (!target) {
|
|
108
|
+
const tools = await withConfig();
|
|
109
|
+
if (tools.length !== 1) {
|
|
110
|
+
console.error(tools.length ? `Which tool? Pick one: ${tools.map(([n]) => n).join(', ')}.` : 'No added tool has settings to edit.');
|
|
111
|
+
return tools.length ? 2 : 1;
|
|
112
|
+
}
|
|
113
|
+
target = tools[0][0];
|
|
114
|
+
}
|
|
115
|
+
const t = await configTool(target);
|
|
116
|
+
if (typeof t === 'string')
|
|
117
|
+
return fail(t);
|
|
118
|
+
const ctx = context();
|
|
119
|
+
const dir = mkdtempSync(join(tmpdir(), 'vsf-'));
|
|
120
|
+
const file = join(dir, `${target}.json`);
|
|
121
|
+
try {
|
|
122
|
+
const before = JSON.stringify(t.config.read(configDir()), null, 2) + '\n';
|
|
123
|
+
writeFileSync(file, before);
|
|
124
|
+
for (;;) {
|
|
125
|
+
// Through a shell so editors with arguments work ("code --wait").
|
|
126
|
+
const r = spawnSync('/bin/sh', ['-c', '${VISUAL:-${EDITOR:-vi}} "$1"', 'sh', file], { stdio: 'inherit' });
|
|
127
|
+
if (r.error || r.status !== 0) {
|
|
128
|
+
console.error('Editor exited with an error, nothing saved.');
|
|
129
|
+
return 1;
|
|
130
|
+
}
|
|
131
|
+
const after = readFileSync(file, 'utf8');
|
|
132
|
+
if (after === before) {
|
|
133
|
+
console.log('No changes.');
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
let problems;
|
|
137
|
+
try {
|
|
138
|
+
const value = JSON.parse(after);
|
|
139
|
+
problems = typeof value === 'object' && value !== null && !Array.isArray(value) ? t.config.write(configDir(), value) : ['The settings must be a JSON object.'];
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
problems = [`Not valid JSON: ${err.message}`];
|
|
143
|
+
}
|
|
144
|
+
if (!problems.length) {
|
|
145
|
+
console.log(`Saved ${target} config.`);
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
for (const line of problems)
|
|
149
|
+
console.error(line);
|
|
150
|
+
if (!process.stdin.isTTY || !(await ctx.ui.confirm('Edit again?', true)))
|
|
151
|
+
return 1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
rmSync(dir, { recursive: true, force: true });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export async function config(args) {
|
|
159
|
+
const parsed = parseFlags(args, { json: { type: 'boolean' } }, usages.config);
|
|
160
|
+
if (!parsed)
|
|
161
|
+
return 2;
|
|
162
|
+
if (parsed.values.help) {
|
|
163
|
+
console.log(usages.config);
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
const [sub, a, b, extra] = parsed.positionals;
|
|
167
|
+
switch (sub) {
|
|
168
|
+
case 'get':
|
|
169
|
+
return get(a);
|
|
170
|
+
case 'set':
|
|
171
|
+
if (a === undefined || b === undefined || extra !== undefined)
|
|
172
|
+
return usageError('set needs a KEY and one VALUE.');
|
|
173
|
+
return change(a, (cur, path) => setPath(cur, path, parseValue(b)), `${a} = ${JSON.stringify(maskDeep(parseValue(b), a.split('.').pop()))}`);
|
|
174
|
+
case 'unset':
|
|
175
|
+
return change(a, (cur, path) => unsetPath(cur, path), `${a} unset`);
|
|
176
|
+
case 'edit':
|
|
177
|
+
return edit(a);
|
|
178
|
+
default:
|
|
179
|
+
return show(sub, parsed.values.json === true);
|
|
180
|
+
}
|
|
181
|
+
}
|