Skip to main content

Universal Command Execution for the Modern Stack

One execution API for local, SSH, Docker, and Kubernetes environments. Write once in TypeScript, run anywhere.

import { $ } from '@xec-sh/core';

// Local execution
await $`npm run build`;

// SSH execution with connection pooling
await $.ssh({
  host: 'prod-server',
  username: 'deploy'
})`systemctl restart app`;

// Docker container execution
await $.docker({
  container: 'my-app'
})`python manage.py migrate`;

// Kubernetes pod execution  
await $.k8s({
  pod: 'app-pod',
  namespace: 'production'
})`kubectl rollout status deployment/app`;

Universal Execution Engine

Single API for all environments via @xec-sh/core. Execute commands across local, SSH, Docker, and Kubernetes with the same consistent interface and automatic adapter selection.

Multi-Environment Native

Seamless execution across local shells, SSH connections, Docker containers, and Kubernetes pods. Built-in adapters with environment-specific optimizations.

TypeScript Template Literals

Intuitive $`command` syntax with full type safety. Natural command writing with automatic escaping, interpolation, and IntelliSense support.

Enterprise Features

Connection pooling, retry logic, error handling, caching, event system, and audit logging built-in. Production-ready with comprehensive monitoring and debugging.

Parallel Execution

Execute commands across multiple targets simultaneously. Built-in batch processing, concurrency control, and stream multiplexing for efficient operations.

Flexible Approach

Use imperative TypeScript scripts or declarative YAML configuration. Mix and match approaches to suit your workflow and team preferences.

Unified Ecosystem

A powerful core package and CLI working together to execute commands and automate tasks across any environment

Xec CLI

Command-line interface with built-in commands, dynamic command loading, and full TypeScript/JavaScript scripting support.

@xec-sh/core

Powerful execution engine with template literal syntax, multi-environment adapters, connection pooling, and enterprise features.

Built for Real-World Challenges

Multi-Environment Execution

Same code runs everywhere - from local development to cloud production. No more environment-specific scripts.

Infrastructure Management

Control servers, containers, and clusters with unified commands. SSH pooling and Docker lifecycle management built-in.

CI/CD Pipelines

Build sophisticated deployment workflows with TypeScript. Full control with proper error handling and retry logic.

DevOps Automation

Automate operations with TypeScript safety. Parallel execution, event monitoring, and audit logging included.

Cross-Platform Testing

Test on multiple environments simultaneously. Execute test suites across different containers and configurations.

Hybrid Cloud Operations

Manage mixed infrastructure seamlessly. Execute across on-premise servers and cloud containers with one API.

Solving Real Problems

❌ The Problem

  • Different APIs for local/remote execution
  • SSH connection management is complex
  • Docker commands are verbose
  • Kubernetes kubectl is cumbersome
  • Can't execute across environments
  • No type safety in shell scripts

βœ… The Xec Solution

  • Single unified execution API
  • Built-in connection pooling
  • Simple $.docker() interface
  • Intuitive $.k8s() execution
  • Multi-target parallel execution
  • Full TypeScript with IntelliSense

Why Choose Xec?

FeatureXecSSH ClientsAnsiblezx/shelljs
Multi-environmentβœ… Native support❌ SSH onlyβœ… Via plugins❌ Local only
TypeScript APIβœ… Full support❌ None❌ YAML onlyβœ… Partial
Connection poolingβœ… Built-in⚠️ Manualβœ… Built-in❌ N/A
Docker/K8sβœ… Native❌ None⚠️ Modules❌ None
Template literalsβœ… $`cmd`❌ None❌ Noneβœ… $`cmd`
Enterprise featuresβœ… Complete❌ Limitedβœ… Complete❌ Basic

Start Automating Your Tasks Today

Join thousands of developers who are already using Xec to simplify their workflows and automate complex tasks.