Skip to main content

CLI tool for deploying software to remote and local servers via SSH/SFTP.

Project description

ikctl — Install Kit Control

CLI tool to deploy and execute bash scripts ("kits") on remote servers via SSH/SFTP or on the local machine.

How it works

A kit is a folder containing bash scripts and an ikctl.yaml manifest. ikctl uploads the scripts to the remote server via SFTP and executes them over SSH. Everything is driven by a configuration file at ~/.ikctl/config that defines one or more contexts (sets of servers, kits path and secrets).

~/.ikctl/config          ← main config: contexts, active context
~/kits/
  ikctl.yaml             ← index of available kits
  config.yaml            ← server groups
  show-date/
    ikctl.yaml           ← kit manifest (uploads + pipeline)
    date.sh              ← the actual script

Requirements

  • Python 3.13+
  • uv (recommended) or pip

Installation

From PyPI:

pip install ikctl
# or with uv:
uv tool install ikctl

From source:

git clone <repo>
cd ikctl
uv sync
uv run ikctl --version

Initial setup

On first run, ikctl creates ~/.ikctl/ and ~/kits/ automatically and prompts for confirmation. To skip the prompt:

ikctl --list context   # triggers bootstrap if config is missing

Or create the config manually:

# ~/.ikctl/config
context: remote
contexts:
  remote:
    path_kits: ~/kits
    path_servers: ~/kits
    path_secrets: ~/.passwords/password
    mode: remote
    timeout_connect: 30.0
    timeout_exec: 120.0
  local:
    path_kits: ~/kits
    path_servers: ~/kits
    path_secrets: ~/.passwords/password
    mode: local

Server config

# ~/kits/config.yaml
servers:
  - name: web
    user: ubuntu
    hosts: [10.0.0.10, 10.0.0.11]
    port: 22
    pkey: ~/.ssh/id_ed25519
  - name: db
    user: root
    hosts: [10.0.0.20]
    port: 22
    password: $PASSWORD

Passwords in YAML can reference environment variables ($PASSWORD). Set them before running:

export PASSWORD="your-password"

Kit structure

# ~/kits/show-date/ikctl.yaml
kits:
  uploads:
    - date.sh        # files to upload to the remote server
  pipeline:
    - date.sh        # scripts to execute (in order)

Register the kit in the index:

# ~/kits/ikctl.yaml
kits:
  - show-date/ikctl.yaml
  - install-docker/ikctl.yaml

Usage

ikctl [-h] [-l {kits,servers,context,mode}] [-i INSTALL] [-n NAME]
      [-p [PARAMETER ...]] [-s {sudo}] [-c CONTEXT] [-m {local,remote}]
      [-v] [--dry-run] [--timeout-connect FLOAT] [--timeout-exec FLOAT]
      [--parallel-workers N]

List

ikctl --list kits       # available kits in the active context
ikctl --list servers    # configured server groups
ikctl --list context    # contexts, active context and paths
ikctl --list mode       # current execution mode

Switch context

ikctl --context production

Run a kit

# Remote (default)
ikctl --install show-date --name web

# With parameters passed to the script
ikctl --install deploy --name web -p v1.2.3

# With sudo
ikctl --install install-docker --name web --sudo sudo

# Local machine (no SSH)
ikctl --install show-date --mode local

Preview without executing

--dry-run shows exactly what would be uploaded and executed, without opening any SSH connection:

ikctl --install deploy --name web -p v1.2.3 --sudo sudo --dry-run

Output:

[DRY RUN] Host: 10.0.0.10
[DRY RUN] UPLOAD: ~/kits/deploy/deploy.sh → .ikctl/deploy/deploy.sh
[DRY RUN] EXEC: echo *** | sudo -S bash deploy.sh v1.2.3

Parallel execution

When a server group has multiple hosts, ikctl runs them concurrently:

ikctl --install show-date --name web --parallel-workers 4

Output includes per-host prefix and a final summary:

[10.0.0.10] UPLOAD: ...
[10.0.0.11] UPLOAD: ...
2 hosts OK, 0 hosts FAILED

Timeouts

# Override SSH connection timeout (default 30s)
ikctl --install show-date --name web --timeout-connect 60

# Override local execution timeout (default 120s)
ikctl --install build --mode local --timeout-exec 300

Timeouts can also be set per context in ~/.ikctl/config (timeout_connect, timeout_exec). CLI values take precedence over config values.

SSH authentication

ikctl supports all standard SSH authentication methods:

Method Config key
Ed25519 / ECDSA / RSA key pkey: ~/.ssh/id_ed25519
Password password: $PASSWORD
SSH agent enabled by default
Jump host (ProxyCommand) configured in SSHOptions

License

Apache License 2.0 — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ikctl-1.0.14.tar.gz (99.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ikctl-1.0.14-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file ikctl-1.0.14.tar.gz.

File metadata

  • Download URL: ikctl-1.0.14.tar.gz
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ikctl-1.0.14.tar.gz
Algorithm Hash digest
SHA256 68c72adeae0f32ebefa8c95a2848d686dab6a088d7315f7e6f13bf767062e131
MD5 83b5a55a15d5dea6102a49c4e7b93d96
BLAKE2b-256 d6ad27b9636f1b830de88423056a2294d8c7621d213ddb1547ccc44410cf9f7d

See more details on using hashes here.

File details

Details for the file ikctl-1.0.14-py3-none-any.whl.

File metadata

  • Download URL: ikctl-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ikctl-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1be7c40c40b2cf755c865a64f8828ffd39887516be3fc3ef0bc7ff88bf7637
MD5 ec4102480acae35c91d45b40a2970112
BLAKE2b-256 def4a35f6b40949ef76dac922b5a210b911322bb3963ee7ef8c91c74c2f27593

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page