@semalt-ai/code 1.0.1 → 1.1.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 +9 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,6 +96,9 @@ semalt-code [command] [options]
|
|
|
96
96
|
- `-m, --model <name>`
|
|
97
97
|
Override the model name.
|
|
98
98
|
|
|
99
|
+
- `-v, --version`
|
|
100
|
+
Print the current CLI version.
|
|
101
|
+
|
|
99
102
|
- `-f, --file <path>`
|
|
100
103
|
Load one or more files or directories into the prompt context for `code`.
|
|
101
104
|
|
|
@@ -193,6 +196,12 @@ semalt-code shell -a "npm test"
|
|
|
193
196
|
semalt-code models
|
|
194
197
|
```
|
|
195
198
|
|
|
199
|
+
### Show the current version
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
semalt-code --version
|
|
203
|
+
```
|
|
204
|
+
|
|
196
205
|
## How Responses Are Rendered
|
|
197
206
|
|
|
198
207
|
The CLI formats streamed output for terminal readability:
|
package/index.js
CHANGED
|
@@ -10,6 +10,8 @@ const http = require('http');
|
|
|
10
10
|
const https = require('https');
|
|
11
11
|
const { URL } = require('url');
|
|
12
12
|
|
|
13
|
+
const PACKAGE_JSON = require('./package.json');
|
|
14
|
+
|
|
13
15
|
// ── Config ────────────────────────────────────────────────────────────────────
|
|
14
16
|
|
|
15
17
|
const DEFAULT_CONFIG = {
|
|
@@ -1081,12 +1083,18 @@ Options:
|
|
|
1081
1083
|
--api-base <url> API base URL (init)
|
|
1082
1084
|
--api-key <key> API key (init)
|
|
1083
1085
|
--default-model <name> Default model (init)
|
|
1086
|
+
-v, --version Show CLI version
|
|
1084
1087
|
|
|
1085
1088
|
Config: ${CONFIG_PATH}
|
|
1086
1089
|
`);
|
|
1087
1090
|
return;
|
|
1088
1091
|
}
|
|
1089
1092
|
|
|
1093
|
+
if (command === '--version' || command === '-v') {
|
|
1094
|
+
console.log(PACKAGE_JSON.version);
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1090
1098
|
if (command === 'chat') {
|
|
1091
1099
|
const { opts } = parseArgs(rawArgs.slice(1));
|
|
1092
1100
|
await cmdChat(opts);
|