@neurcode-ai/cli 0.1.1 → 0.1.2
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 +33 -0
- package/dist/api-client.d.ts +169 -2
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +271 -15
- package/dist/api-client.js.map +1 -1
- package/dist/commands/apply.d.ts +9 -0
- package/dist/commands/apply.d.ts.map +1 -0
- package/dist/commands/apply.js +186 -0
- package/dist/commands/apply.js.map +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +87 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/config.d.ts +16 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +134 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/plan.d.ts +6 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +204 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/refactor.d.ts +3 -0
- package/dist/commands/refactor.d.ts.map +1 -0
- package/dist/commands/refactor.js +166 -0
- package/dist/commands/refactor.js.map +1 -0
- package/dist/commands/revert.d.ts +23 -0
- package/dist/commands/revert.d.ts.map +1 -0
- package/dist/commands/revert.js +234 -0
- package/dist/commands/revert.js.map +1 -0
- package/dist/commands/security.d.ts +3 -0
- package/dist/commands/security.d.ts.map +1 -0
- package/dist/commands/security.js +167 -0
- package/dist/commands/security.js.map +1 -0
- package/dist/config.d.ts +17 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +88 -21
- package/dist/config.js.map +1 -1
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const check_1 = require("./commands/check");
|
|
6
|
+
const revert_1 = require("./commands/revert");
|
|
7
|
+
const refactor_1 = require("./commands/refactor");
|
|
8
|
+
const security_1 = require("./commands/security");
|
|
9
|
+
const plan_1 = require("./commands/plan");
|
|
10
|
+
const apply_1 = require("./commands/apply");
|
|
11
|
+
const config_1 = require("./commands/config");
|
|
6
12
|
const program = new commander_1.Command();
|
|
7
13
|
program
|
|
8
14
|
.name('neurcode')
|
|
@@ -19,5 +25,82 @@ program
|
|
|
19
25
|
.option('--intent <description>', 'Describe what you intended to do (for AI analysis)')
|
|
20
26
|
.option('--session-id <id>', 'Use existing session ID (for AI analysis)')
|
|
21
27
|
.action(check_1.checkCommand);
|
|
28
|
+
(0, refactor_1.refactorCommand)(program);
|
|
29
|
+
(0, security_1.securityCommand)(program);
|
|
30
|
+
program
|
|
31
|
+
.command('config')
|
|
32
|
+
.description('Configure Neurcode CLI settings')
|
|
33
|
+
.option('--key <key>', 'Set API key')
|
|
34
|
+
.option('--global', 'Save to home directory (applies to all projects)')
|
|
35
|
+
.option('--show', 'Show current configuration')
|
|
36
|
+
.action((options) => {
|
|
37
|
+
if (options.show) {
|
|
38
|
+
(0, config_1.showConfigCommand)();
|
|
39
|
+
}
|
|
40
|
+
else if (options.key) {
|
|
41
|
+
(0, config_1.configCommand)(options.key, { global: options.global });
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Show current config if no options provided
|
|
45
|
+
(0, config_1.showConfigCommand)();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
program
|
|
49
|
+
.command('plan')
|
|
50
|
+
.description('Generate an execution plan for a user intent')
|
|
51
|
+
.argument('<intent>', 'Description of what you want to accomplish')
|
|
52
|
+
.option('--project-id <id>', 'Project ID')
|
|
53
|
+
.action((intent, options) => {
|
|
54
|
+
(0, plan_1.planCommand)(intent, {
|
|
55
|
+
projectId: options.projectId,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
program
|
|
59
|
+
.command('apply')
|
|
60
|
+
.description('Apply a saved architect plan by generating and writing code files')
|
|
61
|
+
.argument('<planId>', 'Plan ID (UUID) to apply')
|
|
62
|
+
.option('--force', 'Overwrite existing files without confirmation')
|
|
63
|
+
.action((planId, options) => {
|
|
64
|
+
(0, apply_1.applyCommand)(planId, {
|
|
65
|
+
force: options.force || false,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const revertCmd = program
|
|
69
|
+
.command('revert')
|
|
70
|
+
.description('Revert files to previous versions from Neurcode history');
|
|
71
|
+
revertCmd
|
|
72
|
+
.command('versions <filePath>')
|
|
73
|
+
.description('List available versions for a file')
|
|
74
|
+
.option('--project-id <id>', 'Project ID')
|
|
75
|
+
.option('--limit <number>', 'Maximum number of versions to show', '50')
|
|
76
|
+
.action((filePath, options) => {
|
|
77
|
+
(0, revert_1.listVersionsCommand)(filePath, {
|
|
78
|
+
projectId: options.projectId,
|
|
79
|
+
limit: parseInt(options.limit, 10),
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
revertCmd
|
|
83
|
+
.argument('<filePath>', 'Path to the file to revert')
|
|
84
|
+
.option('--to-version <version>', 'Version number to revert to (required)', (val) => parseInt(val, 10))
|
|
85
|
+
.option('--project-id <id>', 'Project ID')
|
|
86
|
+
.option('--reason <reason>', 'Reason for revert')
|
|
87
|
+
.option('--dry-run', 'Show what would be reverted without making changes')
|
|
88
|
+
.option('--backup', 'Create a backup of the current file before reverting')
|
|
89
|
+
.option('--force', 'Skip confirmation prompt')
|
|
90
|
+
.action((filePath, options) => {
|
|
91
|
+
if (!options.toVersion) {
|
|
92
|
+
console.error('❌ Error: --to-version is required');
|
|
93
|
+
console.log('Use "neurcode revert versions <filePath>" to see available versions');
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
(0, revert_1.revertCommand)(filePath, {
|
|
97
|
+
toVersion: options.toVersion,
|
|
98
|
+
projectId: options.projectId,
|
|
99
|
+
reason: options.reason,
|
|
100
|
+
dryRun: options.dryRun || false,
|
|
101
|
+
backup: options.backup || false,
|
|
102
|
+
force: options.force || false,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
22
105
|
program.parse();
|
|
23
106
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,4CAAgD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,4CAAgD;AAChD,8CAAuE;AACvE,kDAAsD;AACtD,kDAAsD;AACtD,0CAA8C;AAC9C,4CAAgD;AAChD,8CAAqE;AAErE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,8CAA8C,CAAC;KAC3D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,UAAU,EAAE,0CAA0C,CAAC;KAC9D,MAAM,CAAC,QAAQ,EAAE,4CAA4C,CAAC;KAC9D,MAAM,CAAC,cAAc,EAAE,2CAA2C,CAAC;KACnE,MAAM,CAAC,UAAU,EAAE,wCAAwC,CAAC;KAC5D,MAAM,CAAC,MAAM,EAAE,8DAA8D,CAAC;KAC9E,MAAM,CAAC,wBAAwB,EAAE,oDAAoD,CAAC;KACtF,MAAM,CAAC,mBAAmB,EAAE,2CAA2C,CAAC;KACxE,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;AACzB,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;AAEzB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,iCAAiC,CAAC;KAC9C,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC;KACpC,MAAM,C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AE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;QAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;QAC/B,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;KAC9B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neurcode-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Neurcode CLI - AI code governance and diff analysis",
|
|
5
5
|
"bin": {
|
|
6
6
|
"neurcode": "./dist/index.js"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@neurcode-ai/diff-parser": "^0.1.0",
|
|
42
42
|
"@neurcode-ai/policy-engine": "^0.1.0",
|
|
43
|
+
"chalk": "^4.1.2",
|
|
43
44
|
"commander": "^11.1.0"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|