dryai 0.3.3 → 2.0.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/README.md +10 -7
- package/dest/lib/context.d.ts +7 -1
- package/dest/lib/context.js +7 -1
- package/dest/main.js +14 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Share AI config CLI
|
|
2
2
|
|
|
3
|
-
Installs command, rule, and skill sources from `~/.config/
|
|
3
|
+
Installs command, rule, and skill sources from `~/.config/dryai` by default into Copilot and Cursor targets.
|
|
4
4
|
|
|
5
|
-
Pass `--
|
|
5
|
+
Pass `--config-root <path>` to read configs from a different root such as `./config`.
|
|
6
6
|
|
|
7
|
-
Pass `--output <path>` to write generated output somewhere other than your home directory.
|
|
7
|
+
Pass `--output-root <path>` to write generated output somewhere other than your home directory.
|
|
8
8
|
|
|
9
|
-
`--test` is a shortcut for `--output ./output-test`, and if both are provided, `--output` wins.
|
|
9
|
+
`--test` is a shortcut for `--output-root ./output-test`, and if both are provided, `--output-root` wins.
|
|
10
10
|
|
|
11
11
|
## Input
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ Live output is written to:
|
|
|
29
29
|
One input root can contain all three source types:
|
|
30
30
|
|
|
31
31
|
```text
|
|
32
|
-
~/.config/
|
|
32
|
+
~/.config/dryai/
|
|
33
33
|
├── commands/
|
|
34
34
|
│ └── gen-commit-msg.md
|
|
35
35
|
├── rules/
|
|
@@ -129,6 +129,8 @@ dryai skills update-all Update all managed skills from
|
|
|
129
129
|
|
|
130
130
|
Imported skills are copied into `config/skills/<name>/` and tracked in `skills.lock.json`.
|
|
131
131
|
|
|
132
|
+
When you run `skills` commands, local skill directories and `skills.lock.json` are read from and written to the selected config root.
|
|
133
|
+
|
|
132
134
|
`skills add` requires at least one `--skill <name>` value. Each requested skill is always resolved from `<repo root>/skills/<name>`.
|
|
133
135
|
|
|
134
136
|
Use `--as <name>` to choose a different local managed skill name when importing exactly one skill.
|
|
@@ -172,8 +174,8 @@ pnpm run test:watch
|
|
|
172
174
|
|
|
173
175
|
pnpm dev:dryai install
|
|
174
176
|
pnpm dev:dryai --test install
|
|
175
|
-
pnpm dev:dryai --output ./tmp/install-root install
|
|
176
|
-
pnpm dev:dryai --
|
|
177
|
+
pnpm dev:dryai --output-root ./tmp/install-root install
|
|
178
|
+
pnpm dev:dryai --config-root ./config install
|
|
177
179
|
```
|
|
178
180
|
|
|
179
181
|
## CI and Release
|
|
@@ -182,6 +184,7 @@ pnpm dev:dryai --input ./config install
|
|
|
182
184
|
- Run CI validation with build, test, and `npm pack --dry-run`.
|
|
183
185
|
- On changes landing on `main`
|
|
184
186
|
- Run the same CI validation with build, test, and `npm pack --dry-run`.
|
|
187
|
+
|
|
185
188
|
- On `v*` tag pushed to `main`, the release workflow will:
|
|
186
189
|
- Verify the tag matches the checked-in `package.json` version.
|
|
187
190
|
- Verify the tagged commit is on `main`.
|
package/dest/lib/context.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type AgentsContext = {
|
|
|
17
17
|
sourceRoots: SourceRoots;
|
|
18
18
|
targetRoots: TargetRoots;
|
|
19
19
|
};
|
|
20
|
-
export declare const DEFAULT_INPUT_ROOT_SEGMENTS: readonly [".config", "
|
|
20
|
+
export declare const DEFAULT_INPUT_ROOT_SEGMENTS: readonly [".config", "dryai"];
|
|
21
21
|
export declare const DEFAULT_TEST_OUTPUT_DIR_NAME = "output-test";
|
|
22
22
|
export declare const DEFAULT_SOURCE_ROOT_NAMES: {
|
|
23
23
|
readonly commands: "commands";
|
|
@@ -50,6 +50,12 @@ export declare function resolveRequestedOutputRoot(input: {
|
|
|
50
50
|
test: boolean;
|
|
51
51
|
outputRoot?: string;
|
|
52
52
|
}): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the requested config root derived from CLI-style options.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveRequestedConfigRoot(input: {
|
|
57
|
+
configRoot?: string;
|
|
58
|
+
}): string | undefined;
|
|
53
59
|
/**
|
|
54
60
|
* Returns the filesystem path to use for generated output.
|
|
55
61
|
*/
|
package/dest/lib/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
export const DEFAULT_INPUT_ROOT_SEGMENTS = ['.config', '
|
|
3
|
+
export const DEFAULT_INPUT_ROOT_SEGMENTS = ['.config', 'dryai'];
|
|
4
4
|
export const DEFAULT_TEST_OUTPUT_DIR_NAME = 'output-test';
|
|
5
5
|
export const DEFAULT_SOURCE_ROOT_NAMES = {
|
|
6
6
|
commands: 'commands',
|
|
@@ -57,6 +57,12 @@ export function resolveRequestedOutputRoot(input) {
|
|
|
57
57
|
}
|
|
58
58
|
return input.test ? `./${DEFAULT_TEST_OUTPUT_DIR_NAME}` : undefined;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns the requested config root derived from CLI-style options.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveRequestedConfigRoot(input) {
|
|
64
|
+
return input.configRoot;
|
|
65
|
+
}
|
|
60
66
|
/**
|
|
61
67
|
* Returns the filesystem path to use for generated output.
|
|
62
68
|
*/
|
package/dest/main.js
CHANGED
|
@@ -7,11 +7,11 @@ import { z } from 'zod';
|
|
|
7
7
|
import { runInstallCommand } from './commands/install.js';
|
|
8
8
|
import { addSkillsCommand } from './commands/skills/index.js';
|
|
9
9
|
import { nonEmptyOptionStringSchema, parseOptionValue, parseOptionsObject, } from './lib/command-options.js';
|
|
10
|
-
import { createAgentsContext, resolveRequestedOutputRoot, } from './lib/context.js';
|
|
10
|
+
import { createAgentsContext, resolveRequestedConfigRoot, resolveRequestedOutputRoot, } from './lib/context.js';
|
|
11
11
|
const rootOptionsSchema = z.object({
|
|
12
12
|
test: z.boolean().optional().default(false),
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
configRoot: nonEmptyOptionStringSchema.optional(),
|
|
14
|
+
outputRoot: nonEmptyOptionStringSchema.optional(),
|
|
15
15
|
});
|
|
16
16
|
const EXECUTABLE_NAME = 'dryai';
|
|
17
17
|
/**
|
|
@@ -43,12 +43,15 @@ function getRootOptions(program) {
|
|
|
43
43
|
*/
|
|
44
44
|
function resolveActiveContext(program) {
|
|
45
45
|
const rootOptions = getRootOptions(program);
|
|
46
|
+
const requestedConfigRoot = resolveRequestedConfigRoot({
|
|
47
|
+
...(rootOptions.configRoot ? { configRoot: rootOptions.configRoot } : {}),
|
|
48
|
+
});
|
|
46
49
|
const requestedOutputRoot = resolveRequestedOutputRoot({
|
|
47
50
|
test: rootOptions.test,
|
|
48
|
-
...(rootOptions.
|
|
51
|
+
...(rootOptions.outputRoot ? { outputRoot: rootOptions.outputRoot } : {}),
|
|
49
52
|
});
|
|
50
53
|
const context = createAgentsContext({
|
|
51
|
-
...(
|
|
54
|
+
...(requestedConfigRoot ? { inputRoot: requestedConfigRoot } : {}),
|
|
52
55
|
...(requestedOutputRoot ? { outputRoot: requestedOutputRoot } : {}),
|
|
53
56
|
});
|
|
54
57
|
return context;
|
|
@@ -64,14 +67,14 @@ async function main() {
|
|
|
64
67
|
.usage('[options] <command> [args]')
|
|
65
68
|
.helpOption('-h, --help', 'Display this message')
|
|
66
69
|
.version(cliVersion, '-v, --version', 'Display the current version')
|
|
67
|
-
.option('--test', 'Shortcut for writing generated output into ./output-test unless --output is also provided')
|
|
68
|
-
.option('--
|
|
70
|
+
.option('--test', 'Shortcut for writing generated output into ./output-test unless --output-root is also provided')
|
|
71
|
+
.option('--config-root <path>', 'Read configs from a different root instead of ~/.config/dryai', parseOptionValue({
|
|
69
72
|
schema: nonEmptyOptionStringSchema,
|
|
70
|
-
optionLabel: '--
|
|
73
|
+
optionLabel: '--config-root',
|
|
71
74
|
}))
|
|
72
|
-
.option('--output <path>', 'Write generated output under a different root instead of the default home directory', parseOptionValue({
|
|
75
|
+
.option('--output-root <path>', 'Write generated output under a different root instead of the default home directory', parseOptionValue({
|
|
73
76
|
schema: nonEmptyOptionStringSchema,
|
|
74
|
-
optionLabel: '--output',
|
|
77
|
+
optionLabel: '--output-root',
|
|
75
78
|
}))
|
|
76
79
|
.helpCommand(false)
|
|
77
80
|
.action(() => {
|
|
@@ -102,7 +105,7 @@ function requestedOutputRootWasUsed(program) {
|
|
|
102
105
|
const rootOptions = getRootOptions(program);
|
|
103
106
|
return (resolveRequestedOutputRoot({
|
|
104
107
|
test: rootOptions.test,
|
|
105
|
-
...(rootOptions.
|
|
108
|
+
...(rootOptions.outputRoot ? { outputRoot: rootOptions.outputRoot } : {}),
|
|
106
109
|
}) !== undefined);
|
|
107
110
|
}
|
|
108
111
|
try {
|