Skip to content

Commit 4fd03f2

Browse files
author
Lasim
committed
feat(gateway): implement core functionality and command structure for DeployStack Gateway
1 parent 233ebf5 commit 4fd03f2

File tree

29 files changed

+287
-9
lines changed

29 files changed

+287
-9
lines changed

package-lock.json

Lines changed: 48 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/gateway/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ npm install -g @deploystack/gateway
2222

2323
```bash
2424
# Login to your DeployStack account
25-
deploystack-gateway login
25+
deploystack login
2626

2727
# Start the gateway (runs on localhost:9095 by default)
28-
deploystack-gateway start
28+
deploystack start
2929

3030
# Check status
31-
deploystack-gateway status
31+
deploystack status
3232
```
3333

3434
## 🧱 How It Works

services/gateway/bin/gateway.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
require('../dist/index.js');

services/gateway/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
"version": "0.1.0",
44
"description": "The local DeployStack Gateway for secure MCP server management.",
55
"main": "dist/index.js",
6+
"bin": {
7+
"deploystack": "bin/gateway.js"
8+
},
69
"scripts": {
710
"build": "tsc",
811
"start": "node dist/index.js",
9-
"dev": "ts-node-dev --respawn src/index.ts"
12+
"dev": "ts-node-dev --respawn src/index.ts",
13+
"link": "npm run build && npm link"
1014
},
1115
"keywords": [
1216
"mcp",
@@ -15,7 +19,10 @@
1519
],
1620
"author": "DeployStack",
1721
"license": "SEE LICENSE IN ../../LICENSE",
18-
"dependencies": {},
22+
"dependencies": {
23+
"commander": "^12.0.0",
24+
"chalk": "^4.1.2"
25+
},
1926
"devDependencies": {
2027
"@types/node": "^24.1.0",
2128
"ts-node-dev": "^2.0.0",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Command } from 'commander';
2+
import chalk from 'chalk';
3+
4+
export function registerConfigCommand(program: Command) {
5+
program
6+
.command('config')
7+
.description('Manage local configuration')
8+
.action(async () => {
9+
console.log(chalk.magenta('hello world from config'));
10+
});
11+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export { registerLoginCommand } from './login';
2+
export { registerLogoutCommand } from './logout';
3+
export { registerStartCommand } from './start';
4+
export { registerStopCommand } from './stop';
5+
export { registerStatusCommand } from './status';
6+
export { registerConfigCommand } from './config';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Command } from 'commander';
2+
import chalk from 'chalk';
3+
4+
export function registerLoginCommand(program: Command) {
5+
program
6+
.command('login')
7+
.description('Authenticate with DeployStack cloud')
8+
.action(async () => {
9+
console.log(chalk.green('hello world from login'));
10+
});
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Command } from 'commander';
2+
import chalk from 'chalk';
3+
4+
export function registerLogoutCommand(program: Command) {
5+
program
6+
.command('logout')
7+
.description('Clear local credentials')
8+
.action(async () => {
9+
console.log(chalk.yellow('hello world from logout'));
10+
});
11+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Command } from 'commander';
2+
import chalk from 'chalk';
3+
4+
export function registerStartCommand(program: Command) {
5+
program
6+
.command('start')
7+
.description('Start the gateway server')
8+
.option('-p, --port <port>', 'Port to run the gateway on', '9095')
9+
.action(async (options) => {
10+
console.log(chalk.blue(`hello world from start (port: ${options.port})`));
11+
});
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Command } from 'commander';
2+
import chalk from 'chalk';
3+
4+
export function registerStatusCommand(program: Command) {
5+
program
6+
.command('status')
7+
.description('Show gateway status')
8+
.action(async () => {
9+
console.log(chalk.cyan('hello world from status'));
10+
});
11+
}

0 commit comments

Comments
 (0)