@oflow-ai/oflow-cli 0.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/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +339 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.js +467 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +320 -0
- package/dist/postinstall.d.ts +10 -0
- package/dist/postinstall.js +58 -0
- package/dist/utils/markdown.d.ts +10 -0
- package/dist/utils/markdown.js +69 -0
- package/package.json +69 -0
- package/scripts/postinstall.js +61 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script for @oflow-ai/oflow-cli
|
|
5
|
+
* Runs after npm install to display welcome message and instructions
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
|
|
10
|
+
// Check if running in CI or npm install --ignore-scripts
|
|
11
|
+
if (process.env.CI || process.env.npm_config_ignore_scripts) {
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Display welcome message
|
|
16
|
+
console.log('');
|
|
17
|
+
console.log(chalk.bold.blue('╔════════════════════════════════════════════════════════════╗'));
|
|
18
|
+
console.log(chalk.bold.blue('║ Welcome to oFlow CLI ║'));
|
|
19
|
+
console.log(chalk.bold.blue('╚════════════════════════════════════════════════════════════╝'));
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log(chalk.green('✓ oFlow CLI installed successfully!'));
|
|
22
|
+
console.log('');
|
|
23
|
+
console.log(chalk.bold('Quick Start:'));
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log(chalk.cyan(' 1. Run the CLI:'));
|
|
26
|
+
console.log(chalk.white(' oflow'));
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log(chalk.cyan(' 2. Configure authentication:'));
|
|
29
|
+
console.log(chalk.white(' oflow auth'));
|
|
30
|
+
console.log('');
|
|
31
|
+
console.log(chalk.cyan(' 3. Available AI Providers:'));
|
|
32
|
+
console.log(chalk.gray(' • OpenAI (GPT-4o, GPT-4-turbo, etc.)'));
|
|
33
|
+
console.log(chalk.gray(' • DeepSeek (深度求索) - Recommended'));
|
|
34
|
+
console.log(chalk.gray(' • Qwen (通义千问)'));
|
|
35
|
+
console.log(chalk.gray(' • GLM (智谱)'));
|
|
36
|
+
console.log(chalk.gray(' • Baichuan (百川)'));
|
|
37
|
+
console.log(chalk.gray(' • Yi (零一万物)'));
|
|
38
|
+
console.log(chalk.gray(' • Moonshot (月之暗面/Kimi)'));
|
|
39
|
+
console.log(chalk.gray(' • SiliconFlow (硅基流动)'));
|
|
40
|
+
console.log('');
|
|
41
|
+
console.log(chalk.bold('Options:'));
|
|
42
|
+
console.log(chalk.gray(' oflow --help Show help'));
|
|
43
|
+
console.log(chalk.gray(' oflow --thinking Show AI reasoning process'));
|
|
44
|
+
console.log(chalk.gray(' oflow models List available models'));
|
|
45
|
+
console.log(chalk.gray(' oflow config View configuration'));
|
|
46
|
+
console.log('');
|
|
47
|
+
console.log(chalk.bold('Documentation:'));
|
|
48
|
+
console.log(chalk.blue(' https://github.com/oflow-ai/oflow-cli'));
|
|
49
|
+
console.log('');
|
|
50
|
+
|
|
51
|
+
// Check Node.js version
|
|
52
|
+
const nodeVersion = process.version;
|
|
53
|
+
const majorVersion = parseInt(nodeVersion.slice(1).split('.')[0], 10);
|
|
54
|
+
|
|
55
|
+
if (majorVersion < 18) {
|
|
56
|
+
console.log(chalk.yellow('⚠ Warning: Node.js 18 or higher is recommended.'));
|
|
57
|
+
console.log(chalk.yellow(` Current version: ${nodeVersion}`));
|
|
58
|
+
console.log('');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
process.exit(0);
|