lnai 0.1.1 → 0.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 +15 -2
- package/dist/index.js +30 -15
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img alt="LNAI Logo" src="apps/docs/public/lnai_white_on_black.png" width="200">
|
|
2
|
+
<img alt="LNAI Logo" src="https://raw.githubusercontent.com/KrystianJonca/lnai/main/apps/docs/public/lnai_white_on_black.png" width="200">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/lnai">
|
|
7
|
+
<img alt="npm version" src="https://img.shields.io/npm/v/lnai">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://github.com/KrystianJonca/lnai/stargazers">
|
|
10
|
+
<img alt="GitHub stars" src="https://img.shields.io/github/stars/KrystianJonca/lnai?style=social">
|
|
11
|
+
</a>
|
|
3
12
|
</p>
|
|
4
13
|
|
|
5
14
|
# LNAI
|
|
6
15
|
|
|
7
|
-
Unified AI configuration management CLI. Define your AI tool configurations once in `.ai/` and sync them to native formats for Claude Code,
|
|
16
|
+
Unified AI configuration management CLI. Define your AI tool configurations once in `.ai/` and sync them to native formats for Claude Code, Cursor, OpenCode, GitHub Copilot, and more.
|
|
8
17
|
|
|
9
18
|
## Documentation
|
|
10
19
|
|
|
@@ -49,3 +58,7 @@ lnai sync
|
|
|
49
58
|
## License
|
|
50
59
|
|
|
51
60
|
MIT
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
If you find LNAI helpful, please [star us on GitHub](https://github.com/KrystianJonca/lnai)!
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,24 @@ import { initUnifiedConfig, runSyncPipeline, parseUnifiedConfig, validateUnified
|
|
|
5
5
|
import chalk3 from 'chalk';
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
|
|
8
|
+
var GITHUB_URL = "https://github.com/KrystianJonca/lnai";
|
|
9
|
+
function formatValidationItem(item, color) {
|
|
10
|
+
const colorFn = color === "red" ? chalk3.red : chalk3.yellow;
|
|
11
|
+
return colorFn(` - ${item.path.join(".")}: ${item.message}`);
|
|
12
|
+
}
|
|
13
|
+
function printValidationItems(items, color) {
|
|
14
|
+
for (const item of items) {
|
|
15
|
+
console.log(formatValidationItem(item, color));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function printGitHubPromo() {
|
|
19
|
+
console.log(
|
|
20
|
+
chalk3.gray("\nIf you find LNAI helpful, please star us on GitHub:")
|
|
21
|
+
);
|
|
22
|
+
console.log(chalk3.blue(GITHUB_URL));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/commands/init.ts
|
|
8
26
|
var initCommand = new Command("init").description("Initialize a new .ai/ configuration directory").option("--force", "Overwrite existing .ai/ directory").option("--minimal", "Create only config.json (no subdirectories)").option("-t, --tools <tools...>", "Enable only specific tools").action(async (options) => {
|
|
9
27
|
const rootDir = process.cwd();
|
|
10
28
|
const spinner = ora("Initializing .ai/ configuration...").start();
|
|
@@ -23,6 +41,7 @@ var initCommand = new Command("init").description("Initialize a new .ai/ configu
|
|
|
23
41
|
console.log(
|
|
24
42
|
chalk3.gray("\nRun ") + chalk3.cyan("lnai sync") + chalk3.gray(" to generate tool configs.")
|
|
25
43
|
);
|
|
44
|
+
printGitHubPromo();
|
|
26
45
|
} catch (error) {
|
|
27
46
|
spinner.fail("Initialization failed");
|
|
28
47
|
console.error(
|
|
@@ -56,6 +75,14 @@ ${result.tool}:`));
|
|
|
56
75
|
console.log(` ${icon} ${change.path}`);
|
|
57
76
|
}
|
|
58
77
|
}
|
|
78
|
+
for (const result of results) {
|
|
79
|
+
if (result.validation.warnings.length > 0) {
|
|
80
|
+
console.log(chalk3.yellow(`
|
|
81
|
+
${result.tool} warnings:`));
|
|
82
|
+
printValidationItems(result.validation.warnings, "yellow");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
printGitHubPromo();
|
|
59
86
|
} catch (error) {
|
|
60
87
|
spinner.fail("Sync failed");
|
|
61
88
|
console.error(
|
|
@@ -73,11 +100,7 @@ var validateCommand = new Command("validate").description("Validate .ai/ configu
|
|
|
73
100
|
if (!unifiedResult.valid) {
|
|
74
101
|
spinner.fail("Validation failed");
|
|
75
102
|
console.log(chalk3.red("\nUnified config errors:"));
|
|
76
|
-
|
|
77
|
-
console.log(
|
|
78
|
-
chalk3.red(` - ${error.path.join(".")}: ${error.message}`)
|
|
79
|
-
);
|
|
80
|
-
}
|
|
103
|
+
printValidationItems(unifiedResult.errors, "red");
|
|
81
104
|
process.exit(1);
|
|
82
105
|
}
|
|
83
106
|
const tools = options.tools ?? pluginRegistry.getIds();
|
|
@@ -105,11 +128,7 @@ var validateCommand = new Command("validate").description("Validate .ai/ configu
|
|
|
105
128
|
for (const { plugin, errors } of toolErrors) {
|
|
106
129
|
console.log(chalk3.red(`
|
|
107
130
|
${plugin} errors:`));
|
|
108
|
-
|
|
109
|
-
console.log(
|
|
110
|
-
chalk3.red(` - ${error.path.join(".")}: ${error.message}`)
|
|
111
|
-
);
|
|
112
|
-
}
|
|
131
|
+
printValidationItems(errors, "red");
|
|
113
132
|
}
|
|
114
133
|
process.exit(1);
|
|
115
134
|
}
|
|
@@ -117,11 +136,7 @@ ${plugin} errors:`));
|
|
|
117
136
|
for (const { plugin, warnings } of toolWarnings) {
|
|
118
137
|
console.log(chalk3.yellow(`
|
|
119
138
|
${plugin} warnings:`));
|
|
120
|
-
|
|
121
|
-
console.log(
|
|
122
|
-
chalk3.yellow(` - ${warning.path.join(".")}: ${warning.message}`)
|
|
123
|
-
);
|
|
124
|
-
}
|
|
139
|
+
printValidationItems(warnings, "yellow");
|
|
125
140
|
}
|
|
126
141
|
for (const { plugin, skipped } of toolSkipped) {
|
|
127
142
|
console.log(chalk3.gray(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lnai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI tool that syncs a unified .ai/ config to native formats for AI coding tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
"config",
|
|
20
20
|
"configuration",
|
|
21
21
|
"claude",
|
|
22
|
+
"cursor",
|
|
22
23
|
"opencode",
|
|
24
|
+
"copilot",
|
|
25
|
+
"github-copilot",
|
|
23
26
|
"cli",
|
|
24
27
|
"ai-tools",
|
|
25
28
|
"lnai"
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
"chalk": "^5.6.2",
|
|
36
39
|
"commander": "^14.0.2",
|
|
37
40
|
"ora": "^9.1.0",
|
|
38
|
-
"@lnai/core": "0.
|
|
41
|
+
"@lnai/core": "0.3.0"
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"@types/node": "^25.0.10",
|