@pks-cli/cli 1.0.0-rc.5
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 +143 -0
- package/bin/pks.js +96 -0
- package/package.json +42 -0
- package/postinstall.js +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PKS Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# PKS CLI
|
|
2
|
+
|
|
3
|
+
The next agentic CLI for .NET developers - combining beautiful terminal UI with AI-powered development assistance and Kubernetes deployment capabilities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Quick Install (npm)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @pks-cli/pks
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Quick Install (.NET Global Tool)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dotnet tool install -g pks-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
After installation, use the `pks` command:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# See all available commands
|
|
25
|
+
pks --help
|
|
26
|
+
|
|
27
|
+
# Initialize a new project
|
|
28
|
+
pks init MyProject
|
|
29
|
+
|
|
30
|
+
# Interactive mode (prompts for details)
|
|
31
|
+
pks init
|
|
32
|
+
|
|
33
|
+
# Create agentic project with MCP integration
|
|
34
|
+
pks init MyAgent --agentic --mcp --template agent
|
|
35
|
+
|
|
36
|
+
# API project with specific template
|
|
37
|
+
pks init MyApi --template api --description "REST API for my application"
|
|
38
|
+
|
|
39
|
+
# Web application with agentic features
|
|
40
|
+
pks init MyWebApp --template web --agentic --description "Intelligent web application"
|
|
41
|
+
|
|
42
|
+
# Generate ASCII art
|
|
43
|
+
pks ascii "Hello PKS"
|
|
44
|
+
|
|
45
|
+
# View system status
|
|
46
|
+
pks status
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Available Commands
|
|
50
|
+
|
|
51
|
+
- **`pks init`** - Project initialization with templates and intelligent features
|
|
52
|
+
- Supports multiple templates: console, api, web, agent, library
|
|
53
|
+
- Agentic features with `--agentic` flag for AI automation
|
|
54
|
+
- MCP integration with `--mcp` flag for AI tool connectivity
|
|
55
|
+
- Interactive mode when no project name provided
|
|
56
|
+
- Force overwrite with `--force` flag
|
|
57
|
+
|
|
58
|
+
- **`pks agent`** - AI agent management (create, list, status, remove)
|
|
59
|
+
|
|
60
|
+
- **`pks deploy`** - Intelligent deployment orchestration
|
|
61
|
+
|
|
62
|
+
- **`pks status`** - System monitoring with real-time insights
|
|
63
|
+
|
|
64
|
+
- **`pks ascii`** - ASCII art generation with animations
|
|
65
|
+
|
|
66
|
+
## Platform Support
|
|
67
|
+
|
|
68
|
+
PKS CLI supports the following platforms:
|
|
69
|
+
|
|
70
|
+
- Linux x64
|
|
71
|
+
- Linux ARM64
|
|
72
|
+
- macOS x64 (Intel)
|
|
73
|
+
- macOS ARM64 (Apple Silicon)
|
|
74
|
+
- Windows x64
|
|
75
|
+
- Windows ARM64
|
|
76
|
+
|
|
77
|
+
The correct binary for your platform is automatically selected during installation.
|
|
78
|
+
|
|
79
|
+
## Requirements
|
|
80
|
+
|
|
81
|
+
- Node.js 18.0.0 or higher (for npm installation)
|
|
82
|
+
- .NET 10.0 or higher (for .NET tool installation)
|
|
83
|
+
|
|
84
|
+
## Features
|
|
85
|
+
|
|
86
|
+
- Beautiful terminal UI with Spectre.Console
|
|
87
|
+
- AI-powered development assistance
|
|
88
|
+
- Model Context Protocol (MCP) integration
|
|
89
|
+
- Kubernetes deployment capabilities
|
|
90
|
+
- Project scaffolding with multiple templates
|
|
91
|
+
- Interactive prompts for ease of use
|
|
92
|
+
- Development container support
|
|
93
|
+
- Git hooks integration
|
|
94
|
+
- Comprehensive documentation generation
|
|
95
|
+
|
|
96
|
+
## Troubleshooting
|
|
97
|
+
|
|
98
|
+
### Binary Not Found
|
|
99
|
+
|
|
100
|
+
If you see "PKS CLI binary not found" after installation:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Try forcing reinstall
|
|
104
|
+
npm install -g @pks-cli/pks --force
|
|
105
|
+
|
|
106
|
+
# Or install the platform-specific package manually
|
|
107
|
+
npm install -g @pks-cli/pks-linux-x64 # for Linux x64
|
|
108
|
+
npm install -g @pks-cli/pks-osx-arm64 # for macOS Apple Silicon
|
|
109
|
+
npm install -g @pks-cli/pks-win-x64 # for Windows x64
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Unsupported Platform
|
|
113
|
+
|
|
114
|
+
If your platform is not supported, please use the .NET global tool installation method:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
dotnet tool install -g pks-cli
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Documentation
|
|
121
|
+
|
|
122
|
+
- [GitHub Repository](https://github.com/pksorensen/pks-cli)
|
|
123
|
+
- [Issue Tracker](https://github.com/pksorensen/pks-cli/issues)
|
|
124
|
+
- [Architecture Guide](https://github.com/pksorensen/pks-cli/blob/main/docs/ARCHITECTURE.md)
|
|
125
|
+
- [MCP Integration](https://github.com/pksorensen/pks-cli/blob/main/docs/MCP.md)
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT License - see [LICENSE](./LICENSE) for details.
|
|
130
|
+
|
|
131
|
+
## Contributing
|
|
132
|
+
|
|
133
|
+
Contributions are welcome! Please see the [GitHub repository](https://github.com/pksorensen/pks-cli) for more information.
|
|
134
|
+
|
|
135
|
+
## Support
|
|
136
|
+
|
|
137
|
+
For issues and questions:
|
|
138
|
+
- File an issue on [GitHub Issues](https://github.com/pksorensen/pks-cli/issues)
|
|
139
|
+
- Check the [documentation](https://github.com/pksorensen/pks-cli/tree/main/docs)
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
Built with love by the PKS Team
|
package/bin/pks.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const { existsSync } = require('fs');
|
|
5
|
+
const { join } = require('path');
|
|
6
|
+
const { platform, arch } = process;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Maps Node.js platform/arch to PKS CLI platform package names
|
|
10
|
+
*/
|
|
11
|
+
function getPlatformPackage() {
|
|
12
|
+
const platformMap = {
|
|
13
|
+
'linux-x64': '@pks-cli/pks-linux-x64',
|
|
14
|
+
'linux-arm64': '@pks-cli/pks-linux-arm64',
|
|
15
|
+
'darwin-x64': '@pks-cli/pks-osx-x64',
|
|
16
|
+
'darwin-arm64': '@pks-cli/pks-osx-arm64',
|
|
17
|
+
'win32-x64': '@pks-cli/pks-win-x64',
|
|
18
|
+
'win32-arm64': '@pks-cli/pks-win-arm64'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const key = `${platform}-${arch}`;
|
|
22
|
+
return platformMap[key] || null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Finds the platform-specific binary path
|
|
27
|
+
*/
|
|
28
|
+
function getBinaryPath() {
|
|
29
|
+
const packageName = getPlatformPackage();
|
|
30
|
+
|
|
31
|
+
if (!packageName) {
|
|
32
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
33
|
+
console.error('Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64, win32-arm64');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Try to find the platform package in node_modules
|
|
38
|
+
const paths = [
|
|
39
|
+
// Installed as dependency
|
|
40
|
+
join(__dirname, '..', '..', packageName.replace('@pks-cli/', 'pks-cli-'), 'pks'),
|
|
41
|
+
join(__dirname, '..', '..', packageName.replace('@pks-cli/', 'pks-cli-'), 'pks.exe'),
|
|
42
|
+
// Installed in parent node_modules
|
|
43
|
+
join(__dirname, '..', '..', '..', packageName.replace('@pks-cli/', 'pks-cli-'), 'pks'),
|
|
44
|
+
join(__dirname, '..', '..', '..', packageName.replace('@pks-cli/', 'pks-cli-'), 'pks.exe'),
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
for (const path of paths) {
|
|
48
|
+
if (existsSync(path)) {
|
|
49
|
+
return path;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
console.error(`PKS CLI binary not found for ${platform}-${arch}`);
|
|
54
|
+
console.error('Please ensure the platform-specific package is installed.');
|
|
55
|
+
console.error(`Expected package: ${packageName}`);
|
|
56
|
+
console.error('Try running: npm install --force');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Executes the platform-specific PKS CLI binary
|
|
62
|
+
*/
|
|
63
|
+
function runPks() {
|
|
64
|
+
const binaryPath = getBinaryPath();
|
|
65
|
+
|
|
66
|
+
// Spawn the binary with all arguments passed through
|
|
67
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
68
|
+
stdio: 'inherit',
|
|
69
|
+
shell: false
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
child.on('exit', (code, signal) => {
|
|
73
|
+
if (signal) {
|
|
74
|
+
process.kill(process.pid, signal);
|
|
75
|
+
} else {
|
|
76
|
+
process.exit(code || 0);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
child.on('error', (err) => {
|
|
81
|
+
console.error('Failed to execute PKS CLI:', err.message);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Handle process termination
|
|
86
|
+
process.on('SIGINT', () => {
|
|
87
|
+
child.kill('SIGINT');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
process.on('SIGTERM', () => {
|
|
91
|
+
child.kill('SIGTERM');
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Run PKS CLI
|
|
96
|
+
runPks();
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pks-cli/cli",
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
|
+
"description": "The next agentic CLI for .NET developers",
|
|
5
|
+
"bin": {
|
|
6
|
+
"pks": "./bin/pks.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node postinstall.js"
|
|
10
|
+
},
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@pks-cli/cli-linux-x64": "1.0.0",
|
|
13
|
+
"@pks-cli/cli-linux-arm64": "1.0.0",
|
|
14
|
+
"@pks-cli/cli-osx-x64": "1.0.0",
|
|
15
|
+
"@pks-cli/cli-osx-arm64": "1.0.0",
|
|
16
|
+
"@pks-cli/cli-win-x64": "1.0.0",
|
|
17
|
+
"@pks-cli/cli-win-arm64": "1.0.0"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/pksorensen/pks-cli.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"cli",
|
|
28
|
+
"dotnet",
|
|
29
|
+
"agentic",
|
|
30
|
+
"developer-tools",
|
|
31
|
+
"ai",
|
|
32
|
+
"automation",
|
|
33
|
+
"kubernetes",
|
|
34
|
+
"devcontainer"
|
|
35
|
+
],
|
|
36
|
+
"author": "PKS Team",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"homepage": "https://github.com/pksorensen/pks-cli#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/pksorensen/pks-cli/issues"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { platform, arch } = process;
|
|
4
|
+
const { existsSync } = require('fs');
|
|
5
|
+
const { join } = require('path');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Gets the expected platform package name
|
|
9
|
+
*/
|
|
10
|
+
function getPlatformPackage() {
|
|
11
|
+
const platformMap = {
|
|
12
|
+
'linux-x64': '@pks-cli/pks-linux-x64',
|
|
13
|
+
'linux-arm64': '@pks-cli/pks-linux-arm64',
|
|
14
|
+
'darwin-x64': '@pks-cli/pks-osx-x64',
|
|
15
|
+
'darwin-arm64': '@pks-cli/pks-osx-arm64',
|
|
16
|
+
'win32-x64': '@pks-cli/pks-win-x64',
|
|
17
|
+
'win32-arm64': '@pks-cli/pks-win-arm64'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const key = `${platform}-${arch}`;
|
|
21
|
+
return platformMap[key] || null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Checks if the platform-specific package is installed
|
|
26
|
+
*/
|
|
27
|
+
function checkPlatformPackage() {
|
|
28
|
+
const packageName = getPlatformPackage();
|
|
29
|
+
|
|
30
|
+
if (!packageName) {
|
|
31
|
+
console.warn(`⚠️ Unsupported platform: ${platform}-${arch}`);
|
|
32
|
+
console.warn('Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64, win32-arm64');
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const packageDirName = packageName.replace('@pks-cli/', 'pks-cli-');
|
|
37
|
+
const paths = [
|
|
38
|
+
join(__dirname, '..', packageDirName),
|
|
39
|
+
join(__dirname, '..', '..', packageDirName),
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
for (const path of paths) {
|
|
43
|
+
if (existsSync(path)) {
|
|
44
|
+
console.log(`✅ PKS CLI installed successfully for ${platform}-${arch}`);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Provides installation instructions if platform package is missing
|
|
54
|
+
*/
|
|
55
|
+
function showInstallationHelp() {
|
|
56
|
+
const packageName = getPlatformPackage();
|
|
57
|
+
|
|
58
|
+
console.warn('⚠️ Platform-specific package not found');
|
|
59
|
+
console.warn('');
|
|
60
|
+
console.warn('This can happen if:');
|
|
61
|
+
console.warn('1. Optional dependencies were skipped during installation');
|
|
62
|
+
console.warn('2. The platform package failed to download');
|
|
63
|
+
console.warn('3. Corporate proxy or firewall is blocking the download');
|
|
64
|
+
console.warn('');
|
|
65
|
+
console.warn('To fix this, try:');
|
|
66
|
+
console.warn('');
|
|
67
|
+
console.warn(` npm install ${packageName}`);
|
|
68
|
+
console.warn('');
|
|
69
|
+
console.warn('Or reinstall with:');
|
|
70
|
+
console.warn('');
|
|
71
|
+
console.warn(' npm install @pks-cli/pks --force');
|
|
72
|
+
console.warn('');
|
|
73
|
+
|
|
74
|
+
// Non-zero exit in CI environments only
|
|
75
|
+
if (process.env.CI === 'true') {
|
|
76
|
+
console.error('❌ Installation failed in CI environment');
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Main postinstall logic
|
|
83
|
+
*/
|
|
84
|
+
function postinstall() {
|
|
85
|
+
console.log('🚀 Setting up PKS CLI...');
|
|
86
|
+
|
|
87
|
+
const isInstalled = checkPlatformPackage();
|
|
88
|
+
|
|
89
|
+
if (!isInstalled) {
|
|
90
|
+
showInstallationHelp();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Run postinstall
|
|
95
|
+
try {
|
|
96
|
+
postinstall();
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.error('Postinstall script failed:', error.message);
|
|
99
|
+
// Don't fail the installation, just warn
|
|
100
|
+
if (process.env.CI === 'true') {
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|