jarvis-ci 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muqeet Ahmad
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,5 @@
1
+ # jarvis-ci
2
+ This npm package is light weight nodejs based CI/CD tool. the goal is to achieve simplicity and local machine or server CI/CD execution. it is configured through YAML for commands.
3
+
4
+ for local machine , the user needs to configure the proxy URL from https://smee.io
5
+
@@ -0,0 +1,9 @@
1
+ {
2
+ "server": {
3
+ "port": 5050,
4
+ "local": false,
5
+ "proxy": "",
6
+ "secret": ""
7
+ },
8
+ "repos": []
9
+ }
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ import { ConfigCommand } from "../commands/config/config.command.js";
3
+ import { PipelineCommand } from "../commands/pipeline/pipeline.command.js";
4
+ import { ServerCommand } from "../commands/server/server.command.js";
5
+ import { Server } from "../server.js";
6
+ export class JarvisCLI {
7
+ static instance;
8
+ configCommand;
9
+ serverCommand;
10
+ PipelineCommand;
11
+ constructor() {
12
+ this.configCommand = new ConfigCommand();
13
+ this.serverCommand = new ServerCommand();
14
+ this.PipelineCommand = new PipelineCommand();
15
+ }
16
+ static getInstance() {
17
+ if (!JarvisCLI.instance) {
18
+ JarvisCLI.instance = new JarvisCLI();
19
+ }
20
+ return JarvisCLI.instance;
21
+ }
22
+ async run() {
23
+ const [, , command, subcommand, pipelineName] = process.argv;
24
+ switch (command) {
25
+ case 'config':
26
+ await this.handleConfig(subcommand);
27
+ break;
28
+ case 'pipeline':
29
+ await this.handlePipeline(subcommand, pipelineName);
30
+ break;
31
+ case 'start':
32
+ Server.getInstance().start();
33
+ break;
34
+ default:
35
+ this.showHelp();
36
+ break;
37
+ }
38
+ }
39
+ async handleConfig(subcommand) {
40
+ switch (subcommand) {
41
+ case 'add':
42
+ this.configCommand.run();
43
+ break;
44
+ case 'port':
45
+ this.serverCommand.changePort();
46
+ break;
47
+ case 'local':
48
+ this.serverCommand.changeLocal();
49
+ break;
50
+ case 'proxy':
51
+ this.serverCommand.changeProxy();
52
+ break;
53
+ default:
54
+ this.showHelp();
55
+ break;
56
+ }
57
+ }
58
+ async handlePipeline(subcommand, pipelineName) {
59
+ if (!pipelineName || pipelineName === "") {
60
+ console.error("❌ Please provide a valid pipeline name.");
61
+ return;
62
+ }
63
+ switch (subcommand) {
64
+ case 'add':
65
+ case 'edit':
66
+ this.PipelineCommand.editPipeline(pipelineName);
67
+ break;
68
+ case 'list':
69
+ this.PipelineCommand.listPipelines();
70
+ break;
71
+ case 'delete':
72
+ this.PipelineCommand.deletePipeline(pipelineName);
73
+ break;
74
+ default:
75
+ this.showHelp();
76
+ break;
77
+ }
78
+ }
79
+ showHelp() {
80
+ console.log(`
81
+ Jarvis CLI
82
+
83
+ Commands:
84
+ jarvis config add Add repository configuration
85
+ jarvis config port Set webhook server port
86
+ jarvis start Start webhook server
87
+ jarvis pipeline list List all pipelines
88
+ jarvis pipeline delete <pipelineName> Delete a pipeline configuration
89
+ jarvis pipeline edit <pipelineName> Edit an existing pipeline configuration
90
+ `);
91
+ }
92
+ }
93
+ // 3. Execute the singleton
94
+ JarvisCLI.getInstance().run().catch(err => {
95
+ console.error("CLI Error:", err);
96
+ process.exit(1);
97
+ });