deweyou-cli 0.4.0 → 0.5.0
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/CHANGELOG.md +5 -0
- package/README.md +9 -0
- package/dist/deweyou.mjs +90 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ cd /path/to/your/repo
|
|
|
37
37
|
deweyou-cli agent init
|
|
38
38
|
deweyou-cli agent doctor
|
|
39
39
|
deweyou-cli agent context --format markdown
|
|
40
|
+
deweyou-cli agent -h
|
|
41
|
+
deweyou-cli -v
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
For a non-interactive setup that selects everything:
|
|
@@ -59,6 +61,13 @@ skills and rules; a writing or design repo can select different ones.
|
|
|
59
61
|
|
|
60
62
|
## Commands
|
|
61
63
|
|
|
64
|
+
General options:
|
|
65
|
+
|
|
66
|
+
| Option | Meaning |
|
|
67
|
+
|--------|---------|
|
|
68
|
+
| `-h`, `--help` | Show help. Supports nested help such as `deweyou-cli agent -h` and `deweyou-cli agent init -h`. |
|
|
69
|
+
| `-v`, `--version` | Show the installed CLI version. |
|
|
70
|
+
|
|
62
71
|
### `deweyou-cli agent update`
|
|
63
72
|
|
|
64
73
|
Refreshes the local Dewey asset cache from the default `deweyou/agents` source
|
package/dist/deweyou.mjs
CHANGED
|
@@ -82,8 +82,26 @@ function toCamel(value) {
|
|
|
82
82
|
return value.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
|
+
//#region package.json
|
|
86
|
+
var version = "0.5.0";
|
|
87
|
+
//#endregion
|
|
85
88
|
//#region src/cli/main.ts
|
|
89
|
+
const COMMANDS = [
|
|
90
|
+
"init",
|
|
91
|
+
"update",
|
|
92
|
+
"context",
|
|
93
|
+
"doctor"
|
|
94
|
+
];
|
|
86
95
|
async function main(argv) {
|
|
96
|
+
const help = helpFor(argv);
|
|
97
|
+
if (help) {
|
|
98
|
+
console.log(help);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (isVersionRequest(argv)) {
|
|
102
|
+
console.log(version);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
87
105
|
const parsed = parseArgs(argv);
|
|
88
106
|
if (parsed.topic !== "agent") printUsageAndThrow();
|
|
89
107
|
if (parsed.command === "init") {
|
|
@@ -109,16 +127,87 @@ async function main(argv) {
|
|
|
109
127
|
printUsageAndThrow();
|
|
110
128
|
}
|
|
111
129
|
function usage() {
|
|
130
|
+
return rootUsage();
|
|
131
|
+
}
|
|
132
|
+
function rootUsage() {
|
|
133
|
+
return `Usage:
|
|
134
|
+
deweyou-cli agent <command> [options]
|
|
135
|
+
|
|
136
|
+
Commands:
|
|
137
|
+
agent init Initialize the current repository with Dewey assets.
|
|
138
|
+
agent update Refresh the local Dewey asset cache.
|
|
139
|
+
agent context Print the active Dewey agent context.
|
|
140
|
+
agent doctor Check whether the repository and cache are healthy.
|
|
141
|
+
|
|
142
|
+
Options:
|
|
143
|
+
-h, --help Show help.
|
|
144
|
+
-v, --version Show the CLI version.`;
|
|
145
|
+
}
|
|
146
|
+
function agentUsage() {
|
|
112
147
|
return `Usage:
|
|
113
148
|
deweyou-cli agent init [--all] [--skills a,b] [--rules a,b] [--mode link|copy|pointer] [--scope project|global] [--tools codex,claude|all] [--rule-wiring reference|inline] [--yes] [--dry-run] [--force]
|
|
114
149
|
deweyou-cli agent update
|
|
115
150
|
deweyou-cli agent context [--format markdown|json]
|
|
116
|
-
deweyou-cli agent doctor
|
|
151
|
+
deweyou-cli agent doctor
|
|
152
|
+
|
|
153
|
+
Run \`deweyou-cli agent <command> -h\` for command-specific help.`;
|
|
154
|
+
}
|
|
155
|
+
function commandUsage(command) {
|
|
156
|
+
if (command === "init") return `Usage:
|
|
157
|
+
deweyou-cli agent init [--all] [--skills a,b] [--rules a,b] [--mode link|copy|pointer] [--scope project|global] [--tools codex,claude|all] [--rule-wiring reference|inline] [--yes] [--dry-run] [--force]
|
|
158
|
+
|
|
159
|
+
Options:
|
|
160
|
+
--all Select every skill and rule.
|
|
161
|
+
--skills a,b Select comma-separated skill ids.
|
|
162
|
+
--rules a,b Select comma-separated rule ids.
|
|
163
|
+
--mode link|copy|pointer Choose how assets are referenced.
|
|
164
|
+
--scope project|global Write project or user-level instructions.
|
|
165
|
+
--tools codex,claude|all Select target agent tools.
|
|
166
|
+
--rule-wiring reference|inline
|
|
167
|
+
Choose how rules are written into instructions.
|
|
168
|
+
--yes Run without prompts for scripted selections.
|
|
169
|
+
--dry-run Print the plan without writing files.
|
|
170
|
+
--force Replace existing Dewey-managed destinations.
|
|
171
|
+
-h, --help Show help.`;
|
|
172
|
+
if (command === "context") return `Usage:
|
|
173
|
+
deweyou-cli agent context [--format markdown|json]
|
|
174
|
+
|
|
175
|
+
Options:
|
|
176
|
+
--format markdown|json Choose human-readable or structured output.
|
|
177
|
+
-h, --help Show help.`;
|
|
178
|
+
if (command === "update") return `Usage:
|
|
179
|
+
deweyou-cli agent update
|
|
180
|
+
|
|
181
|
+
Options:
|
|
182
|
+
-h, --help Show help.`;
|
|
183
|
+
return `Usage:
|
|
184
|
+
deweyou-cli agent doctor
|
|
185
|
+
|
|
186
|
+
Options:
|
|
187
|
+
-h, --help Show help.`;
|
|
117
188
|
}
|
|
118
189
|
function printUsageAndThrow() {
|
|
119
190
|
console.log(usage());
|
|
120
191
|
throw usageError("", { silent: true });
|
|
121
192
|
}
|
|
193
|
+
function helpFor(argv) {
|
|
194
|
+
if (!argv.some(isHelpFlag)) return null;
|
|
195
|
+
if (isHelpFlag(argv[0])) return rootUsage();
|
|
196
|
+
if (argv[0] !== "agent") return rootUsage();
|
|
197
|
+
const command = argv[1];
|
|
198
|
+
if (!command || isHelpFlag(command)) return agentUsage();
|
|
199
|
+
if (isAgentCommand(command)) return commandUsage(command);
|
|
200
|
+
return agentUsage();
|
|
201
|
+
}
|
|
202
|
+
function isVersionRequest(argv) {
|
|
203
|
+
return argv.length === 1 && (argv[0] === "-v" || argv[0] === "--version");
|
|
204
|
+
}
|
|
205
|
+
function isHelpFlag(value) {
|
|
206
|
+
return value === "-h" || value === "--help";
|
|
207
|
+
}
|
|
208
|
+
function isAgentCommand(value) {
|
|
209
|
+
return COMMANDS.includes(value);
|
|
210
|
+
}
|
|
122
211
|
//#endregion
|
|
123
212
|
//#region src/bin/deweyou.ts
|
|
124
213
|
main(process.argv.slice(2)).catch((error) => {
|