onctl

command module
v0.1.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

README ยถ

Onctl

onctl is a tool to manage virtual machines in multi-cloud.

Check ๐ŸŒ https://onctl.sh for detailed documentation

build OpenSSF Scorecard OpenSSF Best Practices Lint CodeQL codecov Github All Releases GitHub release (latest SemVer)

What onctl brings

  • ๐ŸŒ Simple intuitive CLI to run VMs in seconds.
  • โ›…๏ธ Supports multi cloud providers (aws, azure, gcp, hetzner, ovh, more coming soon...)
  • ๐Ÿ“ฆ Hosted microVMs with the boxes provider: no cloud account, no host to run -- onctl login once with a token from boxctl.io, then onctl create -p boxes. Boxes have no public address; onctl ssh (and plain ssh via onctl ssh-proxy) reach them through the service.
  • ๐Ÿค– onctl claude: run Claude Code on a box instead of your laptop -- your project copied there, Claude in tmux so it keeps going when you detach, several tasks at once (--task), and the work back as git (onctl claude fetch/push).
  • ๐Ÿ”ฅ Run local microVMs with the fc (Firecracker) provider (Linux + KVM, no cloud account needed). No bare-metal Linux box? Create a nested-virtualization-enabled GCP VM (gcp.vm.nestedVirtualization: true) with onctl create -n fc-host -a firecracker/firecracker-host-setup.sh, then SSH in and run ONCTL_CLOUD=fc onctl create -n my-microvm.
  • ๐ŸŽ Run local sandboxes on a Mac with the ac (Apple container) provider: each one is a lightweight Linux VM on Virtualization.framework (macOS 26+, no cloud account needed). Install the container CLI, run container system start, then ONCTL_CLOUD=ac onctl create -n my-sandbox (any OCI image via --image; sshd is set up on first boot). pause/resume map to container stop/start.
  • ๐Ÿฎ Run local microVMs with the ch (Cloud Hypervisor) provider โ€” same idea as fc (Linux + KVM, no cloud account needed), no pause/resume support yet. Point ch.kernelImage/ch.rootfsImage at a kernel + rootfs image and run ONCTL_CLOUD=ch onctl create -n my-microvm. Also supports Windows guests via --ch-os windows (UEFI boot) โ€” see TESTING-ch-windows.md for base-image prep; unverified against real hardware.
  • ๐Ÿš€ Sets your public key and Gives you SSH access with onctl ssh <vm-name>
  • โœจ Cloud-init support. Set your own cloud-init file onctl up -n qwe --cloud-init <cloud.init.file>
  • ๐Ÿค– Use ready to use templates to configure your vm. Check onctl-templates onctl up -n qwe -a k3s/k3s-server.sh
  • ๐Ÿ—‚๏ธ Use your custom local or http accessible scripts to configure your vm. onctl ssh qwe -a <my_local_script.sh>
  • ๐Ÿ“ฅ Import a server onctl didn't create (e.g. a Hetzner auction/dedicated box) so you can ssh/ls it too: onctl import <name> --ip <ip>

Quick Start

initialize project. this will create a .onctl directory. check configuration file and set as needed.

โฏ onctl init
onctl environment initialized

export ONCTL_CLOUD to set Cloud Provider.

โฏ export ONCTL_CLOUD=hetzner

Be sure that credentials for that specific cloud provider is already set. If you already use cloud provider CLI. They're already . ex. az, aws, hcloud

โฏ echo $HCLOUD_TOKEN

Create VM.

โฏ onctl up -n onctl-test
Using: hetzner
Creating SSHKey: onctl-42da32a9...
SSH Key already exists (onctl-42da32a9)
Starting server...
Server IP: 168.119.58.112
Vm started.

Ssh into VM.

โฏ onctl ssh onctl-test
Using: hetzner
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-89-generic x86_64)
.
.
.
root@onctl-test:~# 

Import an existing server

Already have a server onctl didn't create โ€” a Hetzner auction/dedicated box (these live on Hetzner's Robot API, a different product from Hetzner Cloud, so the hetzner provider can never see them), or any other reachable host? Register it so ssh/ls work against it too:

โฏ onctl import myauctionbox --ip 1.2.3.4 --user root --key ~/.ssh/auction_key
โœ” Imported "myauctionbox" (1.2.3.4)
Use it with: onctl --provider static ssh myauctionbox

โฏ onctl --provider static ls
โฏ onctl --provider static ssh myauctionbox

Imported hosts only support ssh/ls/destroy โ€” destroy just forgets the host locally, it never touches the real machine, since onctl didn't create it and has no lifecycle API for it.

Installation

macOS and Linux
curl -sLS https://onctl.sh/get.sh | bash
sudo install onctl /usr/local/bin/
Edge build (latest main, Linux and macOS)

To install or update to the edge build, a binary rebuilt from the tip of main on every push (no Windows build):

curl -sLS https://onctl.sh/get-edge.sh | bash
sudo install onctl /usr/local/bin/
Tab completion

The install scripts also set up tab completion for your shell (bash, zsh or fish): subcommands, flags, and the names of your own VMs, so onctl ssh my-b<TAB> finishes the name for you. Open a new terminal after installing to pick it up.

It works by writing a completion script to your shell's per-user completion folder and, for bash and zsh, adding one line to ~/.bashrc or ~/.zshrc that loads it. To skip this, run the installer with ONCTL_NO_COMPLETION=1:

curl -sLS https://onctl.sh/get.sh | ONCTL_NO_COMPLETION=1 bash

To set it up by hand instead:

echo 'source <(onctl completion bash)' >> ~/.bashrc   # bash
echo 'source <(onctl completion zsh)' >> ~/.zshrc     # zsh
onctl completion fish > ~/.config/fish/completions/onctl.fish

VM names are looked up live from your cloud provider, so completing them needs an initialized .onctl directory and working credentials.

Windows
  • download windows binary from releases page
  • unzip and copy onctl.exe to a location in PATH

Enjoy โœ…

โฏ onctl
onctl is a tool to manage cross platform resources in cloud

Usage:
  onctl [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  create      Create a VM
  destroy     Destroy VM(s)
  help        Help about any command
  import      Import an existing server so it can be managed with ssh/ls
  init        init onctl environment
  ls          List VMs
  ssh         Spawn an SSH connection to a VM
  version     Print the version number of onctl

Flags:
  -h, --help   help for onctl

Use "onctl [command] --help" for more information about a command.

Contributing

See CONTRIBUTING.md for how to report issues and what a pull request needs.

For development guidelines โ€” especially when using AI coding agents (opencode, Claude, etc.) โ€” see AGENTS.md.

Important: When running multiple AI agents in parallel on this repo, you must use separate git worktrees (or clones) for isolation. See the "Coordinating multiple agents..." section in AGENTS.md.

Star History

Star History Chart

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
internal
providerboxes
Package providerboxes talks to the hosted boxes service's REST API (boxctl-vms's /api/vms*, /api/images), authenticating with a personal token minted from the dashboard.
Package providerboxes talks to the hosted boxes service's REST API (boxctl-vms's /api/vms*, /api/images), authenticating with a personal token minted from the dashboard.
providerch
Package providerch provides the host-side implementations (process management, networking, rootfs preparation) backing cloud.ProviderCH, plus configuration loading from viper.
Package providerch provides the host-side implementations (process management, networking, rootfs preparation) backing cloud.ProviderCH, plus configuration loading from viper.
providerfc
Package providerfc provides the host-side implementations (process management, networking, rootfs preparation and API access) backing cloud.ProviderFC, plus configuration loading from viper.
Package providerfc provides the host-side implementations (process management, networking, rootfs preparation and API access) backing cloud.ProviderFC, plus configuration loading from viper.
ui
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ ๆข็ฝ‘ๅ€