Skip to content

javimosch/cmdcenter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

cmdcenter

Generic command execution dashboard with configurable commands via JSON config file. Provides both a modern web UI and CLI for managing and executing shell commands.

Author: Javier Leandro Arancibia

Features

  • 🎯 Generic Command Center: Execute any shell commands from a web UI
  • βš™οΈ Configurable Commands: Define commands in ~/.cmdcenter/config.json
  • πŸ”§ CLI Management: Full CRUD operations via command-line interface
  • πŸ“‹ Command Logging: All command executions logged with timestamps and status
  • πŸ” Search Logs: Search through daemon logs with filtering
  • πŸ—‘οΈ Log Management: Clear logs when needed
  • 🎨 Modern UI: Argentine flag color scheme with bento-grid layout
  • πŸ“± Responsive Design: Works on desktop, tablet, and mobile
  • πŸš€ Daemon Mode: Run as background service
  • πŸ’¬ Non-blocking Toasts: Custom toast notifications instead of native alerts
  • πŸ”„ Argument Support: Commands can accept extra arguments
  • πŸ€– Agent-first: Designed for AI/agent workflows with comprehensive CLI

Installation

Via Supercli (Recommended)

The easiest way to install cmdcenter is via supercli:

# Install supercli
npm install -g superacli

# Install cmdcenter plugin
sc plugins install cmdcenter

From Source

git clone https://github.com/javimosch/cmdcenter.git
cd cmdcenter
go build -o cmdcenter
./cmdcenter init

Quick Start

Initialize Config

cmdcenter init

This creates ~/.cmdcenter/config.json with an empty commands array.

Add Commands

# Add a simple command
cmdcenter add --id status --name "System Status" --command "uptime" --icon "πŸ“Š"

# Add command with argument support
cmdcenter add --id df --name "Disk Free" --command "df" --icon "πŸ’Ύ" --supports-args

Start Web UI

# Start in foreground
cmdcenter start

# Start as daemon
cmdcenter start -daemon

# Start on custom port
cmdcenter start -port 3000

Access the UI at http://localhost:3031

Execute Commands

# Via CLI
cmdcenter run --id status

# With arguments (if supports-args enabled)
cmdcenter run --id df --args "-h /"

CLI Usage

Config Commands

cmdcenter init                          # Initialize config file
cmdcenter add --id <id> --name <name> --command <cmd> [--icon <emoji>] [--supports-args]
cmdcenter edit --id <id> [--name <name>] [--command <cmd>] [--icon <emoji>] [--supports-args]
cmdcenter remove --id <id>
cmdcenter list                            # List all commands

Execution Commands

cmdcenter run --id <id> [--args <args>]  # Execute a command

Server Commands

cmdcenter start [-port <port>] [-daemon]  # Start HTTP server
cmdcenter stop                            # Stop daemon
cmdcenter status                          # Check daemon status
cmdcenter version                         # Show version

Configuration

Config file location: ~/.cmdcenter/config.json

Example Config

{
  "title": "Command Center",
  "subtitle": "Generic command execution dashboard",
  "commands": [
    {
      "id": "status",
      "name": "System Status",
      "description": "Check system status",
      "icon": "πŸ“Š",
      "command": "uptime",
      "supports_args": false
    },
    {
      "id": "df",
      "name": "Disk Free",
      "description": "Show disk free space",
      "icon": "πŸ’Ύ",
      "command": "df",
      "supports_args": true
    }
  ]
}

Command Fields

  • id: Unique identifier (required)
  • name: Display name (required)
  • command: Shell command to execute (required)
  • description: Command description
  • icon: Emoji icon
  • supports_args: Enable argument input modal/CLI args support

Web UI Features

Command Execution

  • Click command buttons to execute
  • Commands with supports_args: true show argument input modal
  • Live command output display
  • Success/error feedback with custom toasts

Command Management

  • Add/Edit/Delete commands via UI
  • Raw JSON config editing
  • Live config reload
  • Form validation

Log Management

  • View daemon logs in real-time
  • Search/filter logs
  • Auto-refresh every 10 seconds
  • Clear logs on demand

UI Features

  • Non-blocking toast notifications
  • Custom confirmation dialogs
  • Responsive bento-grid layout
  • Argentine flag color scheme
  • Mobile-friendly design

Development

Build

./build.sh

This creates two binaries:

  • cmdcenter-default: Standard build
  • cmdcenter-optimized: Optimized build

Project Structure

cmdcenter/
β”œβ”€β”€ main.go           # CLI entry point
β”œβ”€β”€ server.go         # HTTP server and UI
β”œβ”€β”€ daemon.go         # Daemon management
β”œβ”€β”€ config.go         # Config file handling
β”œβ”€β”€ build.sh          # Build script
β”œβ”€β”€ AGENTS.md         # Agent documentation
β”œβ”€β”€ README.md         # This file
└── .agents/
    └── skills/
        └── cmdcenter-cheatsheet/  # Agent skill

API Endpoints

Command Execution

  • POST /api/command - Execute command (JSON: {"command": "id", "args": "optional"})

Config Management

  • GET /api/config - Get current config
  • POST /api/config/reload - Reload config from file
  • GET /api/config/commands - Get all commands
  • POST /api/config/commands/add - Add command
  • POST /api/config/commands/edit - Edit command
  • POST /api/config/commands/remove - Remove command
  • GET /api/config/raw - Get raw config JSON
  • POST /api/config/raw - Save raw config JSON

Logs

  • GET /api/logs - Get daemon logs (optional ?search=query)
  • POST /api/logs/clear - Clear daemon logs

System

  • GET /api/status - Server status
  • GET /api/health - Health check

Agent Usage

cmdcenter is designed to be agent-first. AI agents can use the CLI for all operations without needing the web UI. See AGENTS.md for detailed agent documentation.

Example Agent Workflow

# Setup commands for a task
cmdcenter add --id deploy --name "Deploy" --command "./deploy.sh" --icon "πŸš€"
cmdcenter add --id test --name "Run Tests" --command "./test.sh" --icon "βœ…"

# Execute commands
cmdcenter run --id deploy
cmdcenter run --id test

# Cleanup
cmdcenter remove --id deploy

Links

  • supercli - Plugin management and discovery

License

MIT

Contributing

Contributions welcome! Please read AGENTS.md for agent-specific guidelines.

About

Generic command execution dashboard with configurable commands via JSON config file

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors