
Security News
TeamPCP and BreachForums Launch $1,000 Contest for Supply Chain Attacks
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.
@devgrid/orbit
Advanced tools
A powerful infrastructure orchestration and configuration management system inspired by Ansible, written in TypeScript. Orbit provides a declarative approach to managing infrastructure with SSH-based task execution, playbooks, and inventory management.
npm install -g @devgrid/orbit
# or
yarn global add @devgrid/orbit
npm install @devgrid/orbit
# or
yarn add @devgrid/orbit
Create inventory.yml:
all:
hosts:
web1:
ansible_host: 192.168.1.10
ansible_user: ubuntu
ansible_ssh_private_key_file: ~/.ssh/id_rsa
web2:
ansible_host: 192.168.1.11
ansible_user: ubuntu
ansible_ssh_private_key_file: ~/.ssh/id_rsa
children:
webservers:
hosts:
web1:
web2:
vars:
nginx_port: 80
app_name: myapp
Create deploy.yml:
---
- name: Deploy Web Application
hosts: webservers
vars:
app_version: "{{ app_version | default('latest') }}"
tasks:
- name: Update apt cache
shell:
cmd: sudo apt-get update
- name: Install nginx
shell:
cmd: sudo apt-get install -y nginx
- name: Copy nginx config
copy:
src: ./files/nginx.conf
dest: /etc/nginx/sites-available/{{ app_name }}
mode: '0644'
- name: Enable site
shell:
cmd: |
sudo ln -sf /etc/nginx/sites-available/{{ app_name }} /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
- name: Deploy application
shell:
cmd: |
cd /var/www/{{ app_name }}
git pull origin main
npm install
npm run build
pm2 restart {{ app_name }}
orbit playbook run deploy.yml -i inventory.yml
# Run a playbook
orbit playbook run <playbook.yml> -i <inventory.yml>
# Run with extra variables
orbit playbook run deploy.yml -i inventory.yml -e app_version=v1.2.3
# Run with specific tags
orbit playbook run deploy.yml -i inventory.yml --tags deploy,config
# Check mode (dry run)
orbit playbook run deploy.yml -i inventory.yml --check
# Limit to specific hosts
orbit playbook run deploy.yml -i inventory.yml --limit web1,web2
# List all hosts
orbit inventory list -i inventory.yml
# Show host details
orbit inventory show web1 -i inventory.yml
# Validate inventory
orbit inventory validate -i inventory.yml
# Run command on all hosts
orbit run -i inventory.yml -a "uptime"
# Run command on specific group
orbit run -i inventory.yml -g webservers -a "df -h"
# Copy file to hosts
orbit run -i inventory.yml -m copy -a "src=./file.txt dest=/tmp/"
---
- name: Playbook Name
hosts: target_hosts
vars:
variable1: value1
variable2: value2
tasks:
- name: Task name
module_name:
param1: value1
param2: value2
Execute shell commands on remote hosts:
- name: Run shell command
shell:
cmd: echo "Hello, World!"
creates: /path/to/file # Skip if file exists
removes: /path/to/file # Skip if file doesn't exist
chdir: /path/to/dir # Change directory before execution
Copy files to remote hosts:
- name: Copy configuration file
copy:
src: ./files/app.conf
dest: /etc/myapp/app.conf
mode: '0644'
owner: root
group: root
backup: yes # Create backup of existing file
Copy and process template files:
- name: Deploy configuration from template
template:
src: ./templates/nginx.conf.j2
dest: /etc/nginx/nginx.conf
vars:
server_name: "{{ ansible_host }}"
port: "{{ nginx_port }}"
Group multiple tasks together:
- name: Setup application
composite:
tasks:
- name: Create directory
shell:
cmd: mkdir -p /opt/myapp
- name: Copy files
copy:
src: ./app/
dest: /opt/myapp/
-e flag)vars:
app_name: myapp
app_port: 3000
tasks:
- name: Start application
shell:
cmd: pm2 start {{ app_name }} -- --port {{ app_port }}
Orbit uses Mustache for templating:
# nginx.conf template
server {
listen {{ port }};
server_name {{ server_name }};
location / {
proxy_pass http://localhost:{{ app_port }};
}
}
Create .orbit.yml in your project root:
# Logging configuration
logLevel: info # debug, info, warn, error
logFormat: json # json, text
# Task execution
maxConcurrency: 5
taskTimeout: 300000 # 5 minutes in ms
# SSH defaults
sshDefaults:
connectTimeout: 10000
keepaliveInterval: 5000
readyTimeout: 5000
# Metrics
metricsEnabled: true
metricsPort: 9090
ORBIT_LOG_LEVEL - Set log levelORBIT_LOG_FORMAT - Set log formatORBIT_CONFIG - Path to configuration filetasks:
- name: Install package on Ubuntu
shell:
cmd: apt-get install -y nginx
when: ansible_distribution == "Ubuntu"
- name: Install package on CentOS
shell:
cmd: yum install -y nginx
when: ansible_distribution == "CentOS"
tasks:
- name: Create multiple users
shell:
cmd: useradd {{ item }}
with_items:
- user1
- user2
- user3
tasks:
- name: Try to start service
shell:
cmd: systemctl start myapp
ignore_errors: yes
- name: Fallback start method
shell:
cmd: /opt/myapp/start.sh
when: last_task_failed
handlers:
- name: restart nginx
shell:
cmd: systemctl restart nginx
tasks:
- name: Update nginx config
copy:
src: nginx.conf
dest: /etc/nginx/nginx.conf
notify: restart nginx
import { Orbit } from '@devgrid/orbit';
import { Playbook } from '@devgrid/orbit/core/playbooks/playbook';
const orbit = new Orbit({
logLevel: 'info',
logFormat: 'json'
});
// Load inventory
await orbit.inventory.loadFromFile('./inventory.yml');
// Create and run playbook
const playbook = new Playbook({
name: 'Deploy Application',
hosts: 'webservers',
tasks: [
{
name: 'Update code',
module: 'shell',
args: {
cmd: 'cd /opt/app && git pull'
}
}
]
});
orbit.registerPlaybook('deploy', playbook);
const result = await playbook.run(orbit.context);
import { TaskModule, TaskResult } from '@devgrid/orbit/types';
export class CustomModule implements TaskModule {
async execute(args: any, context: any): Promise<TaskResult> {
// Your custom logic here
return {
success: true,
changed: true,
output: 'Task completed'
};
}
}
// Register module
orbit.context.moduleRegistry.register('custom', CustomModule);
import { AlertingService, Alert } from '@devgrid/orbit/types';
export class SlackAlertingService implements AlertingService {
async sendAlert(alert: Alert): Promise<void> {
// Send to Slack
}
}
const orbit = new Orbit(config, new SlackAlertingService());
orbit playbook run deploy.yml -i inventory.yml --debug
SSH Connection Failed
Task Timeout
Variable Not Found
default filter for optional varsContributions are welcome! Please see our Contributing Guide for details.
MIT © DevGrid
FAQs
Orchestration system
The npm package @devgrid/orbit receives a total of 21 weekly downloads. As such, @devgrid/orbit popularity was classified as not popular.
We found that @devgrid/orbit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.