@factorialco/fcode-cli 1.2.0 ā 1.3.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 +4 -2
- package/bin/run +10 -1
- package/dist/commands/clone.d.ts +3 -2
- package/dist/commands/clone.js +18 -5
- package/dist/commands/remote/list.js +1 -0
- package/dist/config/settings.d.ts +1 -0
- package/dist/config/settings.js +6 -0
- package/dist/services/resource-checker.js +3 -0
- package/oclif.manifest.json +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @factorialco/fcode-cli
|
|
|
20
20
|
$ fcode COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ fcode (--version)
|
|
23
|
-
@factorialco/fcode-cli/1.
|
|
23
|
+
@factorialco/fcode-cli/1.3.0 linux-x64 node-v22.22.3
|
|
24
24
|
$ fcode --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ fcode COMMAND
|
|
@@ -100,12 +100,14 @@ Clone team workspace from cloud
|
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
USAGE
|
|
103
|
-
$ fcode clone [TEAM] [--skipSkillsSetup]
|
|
103
|
+
$ fcode clone [TEAM] [--skipSkillsSetup] [--autoSkillsSetup]
|
|
104
104
|
|
|
105
105
|
ARGUMENTS
|
|
106
106
|
[TEAM] Team name
|
|
107
107
|
|
|
108
108
|
FLAGS
|
|
109
|
+
--autoSkillsSetup Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of
|
|
110
|
+
prompting
|
|
109
111
|
--skipSkillsSetup Skip installation of the Factorial Code agent skills
|
|
110
112
|
|
|
111
113
|
DESCRIPTION
|
package/bin/run
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const { run, handle, flush } = require('@oclif/core')
|
|
3
|
+
const { run, handle, flush, settings } = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
// This is the production runner: it always executes the compiled `dist/` output,
|
|
6
|
+
// so oclif must never try to auto-transpile TypeScript sources via ts-node.
|
|
7
|
+
// Otherwise, when the caller's environment has NODE_ENV=development or =test,
|
|
8
|
+
// oclif attempts ts-node and prints "Could not find typescript ... Falling back
|
|
9
|
+
// to compiled source" because typescript is (correctly) not installed in the
|
|
10
|
+
// production dependency tree. Auto-transpile stays enabled for local
|
|
11
|
+
// development through `bin/dev`.
|
|
12
|
+
settings.enableAutoTranspile = false
|
|
4
13
|
|
|
5
14
|
run()
|
|
6
15
|
.catch(async (error) => handle(error))
|
package/dist/commands/clone.d.ts
CHANGED
|
@@ -8,17 +8,18 @@ export default class Clone extends Command {
|
|
|
8
8
|
static examples: string[];
|
|
9
9
|
static flags: {
|
|
10
10
|
skipSkillsSetup: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
autoSkillsSetup: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
checkWorkspaceAlreadyCloned(slug: string): Promise<void>;
|
|
13
14
|
checkWorkspaceIsEmpty(slug: string): Promise<void>;
|
|
14
|
-
cloneTeam(origin: TeamOrigin, skipSkillsSetup?: boolean): Promise<void>;
|
|
15
|
+
cloneTeam(origin: TeamOrigin, skipSkillsSetup?: boolean, autoSkillsSetup?: boolean): Promise<void>;
|
|
15
16
|
createWorkspaceConfig(origin: TeamOrigin): Promise<void>;
|
|
16
17
|
createWorkspaceDatastore(slug: string): void;
|
|
17
18
|
createWorkspaceStorage(slug: string): void;
|
|
18
19
|
createWorkspaceGitIgnore(slug: string): Promise<void>;
|
|
19
20
|
createWorkspaceLocalVariables(slug: string): Promise<void>;
|
|
20
21
|
private skillsInstallHint;
|
|
21
|
-
setupSkills(): Promise<void>;
|
|
22
|
+
setupSkills(autoSkillsSetup?: boolean): Promise<void>;
|
|
22
23
|
catch(error: any): Promise<void>;
|
|
23
24
|
init(): Promise<void>;
|
|
24
25
|
mkdirWorkspace(slug: string): Promise<void>;
|
package/dist/commands/clone.js
CHANGED
|
@@ -41,7 +41,7 @@ class Clone extends core_1.Command {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
async cloneTeam(origin, skipSkillsSetup = false) {
|
|
44
|
+
async cloneTeam(origin, skipSkillsSetup = false, autoSkillsSetup = false) {
|
|
45
45
|
await this.mkdirWorkspace(origin.slug);
|
|
46
46
|
await this.createWorkspaceConfig(origin);
|
|
47
47
|
await this.createWorkspaceGitIgnore(origin.slug);
|
|
@@ -51,7 +51,7 @@ class Clone extends core_1.Command {
|
|
|
51
51
|
process.chdir(origin.slug);
|
|
52
52
|
await pull_1.default.run([]);
|
|
53
53
|
if (!skipSkillsSetup) {
|
|
54
|
-
await this.setupSkills();
|
|
54
|
+
await this.setupSkills(autoSkillsSetup);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
async createWorkspaceConfig(origin) {
|
|
@@ -79,12 +79,18 @@ class Clone extends core_1.Command {
|
|
|
79
79
|
cli_1.default.log('š” Install the Factorial Code agent skills later with:');
|
|
80
80
|
cli_1.default.log(` npx skills add ${SKILLS_REPO} -s '*'`);
|
|
81
81
|
}
|
|
82
|
-
async setupSkills() {
|
|
82
|
+
async setupSkills(autoSkillsSetup = false) {
|
|
83
83
|
cli_1.default.log('');
|
|
84
84
|
// `npx --yes skills add <repo> -s '*'` ā preselect all skills; the skills CLI
|
|
85
85
|
// then handles scope (project/global) and assistant selection interactively.
|
|
86
|
+
// With autoSkillsSetup, add the skills CLI's `-y` flag so it installs
|
|
87
|
+
// non-interactively using its defaults, project-scoped (no `-g`), without prompting.
|
|
88
|
+
const skillsArgs = ['--yes', 'skills', 'add', SKILLS_REPO, '-s', '*'];
|
|
89
|
+
if (autoSkillsSetup) {
|
|
90
|
+
skillsArgs.push('-y');
|
|
91
|
+
}
|
|
86
92
|
await new Promise((resolve) => {
|
|
87
|
-
const child = (0, node_child_process_1.spawn)('npx',
|
|
93
|
+
const child = (0, node_child_process_1.spawn)('npx', skillsArgs, { stdio: 'inherit' });
|
|
88
94
|
child.on('error', () => {
|
|
89
95
|
// npx not available (or failed to launch) ā don't fail the clone, just tell the user how to do it.
|
|
90
96
|
cli_1.default.log("\nā ļø Couldn't run npx automatically (is Node.js / npx installed?).");
|
|
@@ -161,7 +167,11 @@ class Clone extends core_1.Command {
|
|
|
161
167
|
if (skipSkillsSetup === undefined) {
|
|
162
168
|
skipSkillsSetup = (await new global_1.default().getSetting(settings_1.SettingKeys.SKIP_SKILLS_SETUP)) === 'true';
|
|
163
169
|
}
|
|
164
|
-
|
|
170
|
+
let autoSkillsSetup = flags.autoSkillsSetup;
|
|
171
|
+
if (autoSkillsSetup === undefined) {
|
|
172
|
+
autoSkillsSetup = (await new global_1.default().getSetting(settings_1.SettingKeys.AUTO_SKILLS_SETUP)) === 'true';
|
|
173
|
+
}
|
|
174
|
+
await this.cloneTeam({ url, slug }, skipSkillsSetup, autoSkillsSetup);
|
|
165
175
|
cli_1.default.log(`\nš ${args.team} team workspace cloned successfully!\n`);
|
|
166
176
|
cli_1.default.log(`$ cd ${slug}\n`);
|
|
167
177
|
}
|
|
@@ -173,5 +183,8 @@ Clone.flags = {
|
|
|
173
183
|
skipSkillsSetup: core_1.Flags.boolean({
|
|
174
184
|
description: 'Skip installation of the Factorial Code agent skills',
|
|
175
185
|
}),
|
|
186
|
+
autoSkillsSetup: core_1.Flags.boolean({
|
|
187
|
+
description: 'Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of prompting',
|
|
188
|
+
}),
|
|
176
189
|
};
|
|
177
190
|
exports.default = Clone;
|
|
@@ -6,6 +6,7 @@ const color_1 = require("@oclif/color");
|
|
|
6
6
|
const workspace_1 = require("../../config/workspace");
|
|
7
7
|
class RemoteList extends base_command_1.default {
|
|
8
8
|
async init() {
|
|
9
|
+
await this.parse(RemoteList);
|
|
9
10
|
this.workspaceConfig = new workspace_1.default();
|
|
10
11
|
}
|
|
11
12
|
async run() {
|
|
@@ -4,6 +4,7 @@ export interface SettingDefinition {
|
|
|
4
4
|
description?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare enum SettingKeys {
|
|
7
|
+
AUTO_SKILLS_SETUP = "autoSkillsSetup",
|
|
7
8
|
DISABLE_UPDATE_NOTIFIER = "disableUpdateNotifier",
|
|
8
9
|
IGNORE_PROCESS_VERSIONS = "ignoreProcessVersions",
|
|
9
10
|
IGNORE_WORKSPACE_NOT_EMPTY = "ignoreWorkspaceNotEmpty",
|
package/dist/config/settings.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.SETTINGS_DEFINITIONS = exports.SettingKeys = void 0;
|
|
|
4
4
|
exports.getSettingDefault = getSettingDefault;
|
|
5
5
|
var SettingKeys;
|
|
6
6
|
(function (SettingKeys) {
|
|
7
|
+
SettingKeys["AUTO_SKILLS_SETUP"] = "autoSkillsSetup";
|
|
7
8
|
SettingKeys["DISABLE_UPDATE_NOTIFIER"] = "disableUpdateNotifier";
|
|
8
9
|
SettingKeys["IGNORE_PROCESS_VERSIONS"] = "ignoreProcessVersions";
|
|
9
10
|
SettingKeys["IGNORE_WORKSPACE_NOT_EMPTY"] = "ignoreWorkspaceNotEmpty";
|
|
@@ -28,6 +29,11 @@ exports.SETTINGS_DEFINITIONS = [
|
|
|
28
29
|
default: 'false',
|
|
29
30
|
description: 'Skip Factorial Code agent skills install on clone',
|
|
30
31
|
},
|
|
32
|
+
{
|
|
33
|
+
key: SettingKeys.AUTO_SKILLS_SETUP,
|
|
34
|
+
default: 'false',
|
|
35
|
+
description: 'Install Factorial Code agent skills non-interactively (defaults, project scope) on clone',
|
|
36
|
+
},
|
|
31
37
|
{
|
|
32
38
|
key: SettingKeys.IGNORE_FCODE_RUN_PROCESSES,
|
|
33
39
|
default: 'false',
|
|
@@ -60,6 +60,9 @@ exports.default = {
|
|
|
60
60
|
case types_1.ResourceStatus.OUT_OF_DATE:
|
|
61
61
|
outOfDateResources.push(remoteResource);
|
|
62
62
|
break;
|
|
63
|
+
case types_1.ResourceStatus.SENSITIVITY_CHANGED:
|
|
64
|
+
outOfDateResources.push(remoteResource);
|
|
65
|
+
break;
|
|
63
66
|
case types_1.ResourceStatus.REMOTE_REMOVED:
|
|
64
67
|
remoteRemovedResources.push(localResource);
|
|
65
68
|
break;
|
package/oclif.manifest.json
CHANGED
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
"name": "skipSkillsSetup",
|
|
42
42
|
"allowNo": false,
|
|
43
43
|
"type": "boolean"
|
|
44
|
+
},
|
|
45
|
+
"autoSkillsSetup": {
|
|
46
|
+
"description": "Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of prompting",
|
|
47
|
+
"name": "autoSkillsSetup",
|
|
48
|
+
"allowNo": false,
|
|
49
|
+
"type": "boolean"
|
|
44
50
|
}
|
|
45
51
|
},
|
|
46
52
|
"hasDynamicHelp": false,
|
|
@@ -1779,5 +1785,5 @@
|
|
|
1779
1785
|
]
|
|
1780
1786
|
}
|
|
1781
1787
|
},
|
|
1782
|
-
"version": "1.
|
|
1788
|
+
"version": "1.3.0"
|
|
1783
1789
|
}
|