Kernl is a secure persistent development environment system for cloud based Linux/Unix instances, providing a VSCode Web workspace backed by cloud based dataset managers such as HuggingFace 🤗 and Kaggle to keep full codebases, configurations, virtual environments, and dependencies persistent in the cloud, while supporting connections to distributed version-control platforms including GitHub, GitLab, and Bitbucket for SSH access and seamless continuation of development work from the start.
(1) Secure VSCode Web Workspace 🔐: Kernl provides a secure, password-protected VSCode Web workspace that offers a full development environment for cloud-based Linux/Unix instances. The workspace is exposed through ngrok tunneling and provides complete access to the VSCode interface.
(2) Cloud-backed Persistent Environment ☁️: Workspaces are managed by cloud dataset managers such as HuggingFace 🤗 and Kaggle, keeping full codebases, VSCode configurations, virtual environments, and dependencies consistently preserved and restorable across sessions. Environment storage uses fast tar-lz4 compression and decompression for quick upload and retrieval of workspace components.
(3) Integrated Version-Control Connectivity 🔗: Kernl supports connections to all major distributed version-control platforms including GitHub, GitLab, and Bitbucket. It enables authentication through platform tokens, allows adding and deleting SSH keys directly from Kernl, and provides seamless access to repositories for immediate development.
(4) Unified Remote Development Interface 🌐: Kernl allows you to push full environments to the cloud and pull them back whenever needed, enabling seamless continuation of work without occupying storage on the host machine, and allowing development to resume on any compatible cloud instance using the stored environments and connected distributed version-control platforms.
(5) API and CLI Availability 🧩: Kernl is accessible as both a Python API and a terminal-based CLI tool, allowing you to automate tasks programmatically or interact directly from the command line depending on your workflow.
kernl can be installed in two ways, either directly from PyPI for regular use or by cloning the repository if you want to modify the project or contribute. Before installing kernl, it is recommended to create a new virtual environment.
uv venv venv --python 3.11
source venv/bin/activateuv pip install kernlThis installs kernl and makes the kernl API and CLI available on your Linux or Unix based system.
git clone https://github.com/nnilayy/kernl.git
cd kernl
uv pip install -e .Installing in editable mode means any changes you make to the source code will immediately apply when running kernl.
Kernl can be used either through its terminal-based CLI or its Python API, both offering full functional access to all Kernl capabilities, with details provided in the subsections below.
The Kernl CLI provides all functionality available through the Kernl API, including starting the secure VSCode Web workspace, managing SSH keys for GitHub, GitLab, and Bitbucket, and uploading or downloading persistent environments using HuggingFace 🤗 or Kaggle dataset managers. All core actions can be executed directly from the terminal for fast and portable cloud-based development.
To start the secure VSCode Web workspace server using Kernl, run the following command with the available configuration options:
kernl server start \
--ngrok_token <NGROK_TOKEN> \
--password <PASSWORD> \
--working_directory <WORKING_DIRECTORY> \
--extensions <EXTENSION_IDS> \
--dataset_manager <DATASET_MANAGER> \
--dataset_manager_token <DATASET_MANAGER_TOKEN> \
--load_config <SLUG_ID>Replace the following:
-
<NGROK_TOKEN>: Your ngrok authentication token used to expose the VSCode Web interface over an HTTPS tunnel (If not provided, Kernl will securely prompt you.) -
<PASSWORD>: Password that secures the VSCode Web workspace from unauthorized access (If omitted, Kernl generates a strong password automatically.) -
<WORKING_DIRECTORY>: The directory that will serve as the workspace root inside VSCode (Defaults to the current working directory if not specified.) -
<EXTENSION_IDS>(optional): Space-separated VSCode extension identifiers to install at startup Example:ms-python.python ms-toolsai.jupyter -
<DATASET_MANAGER>: Cloud backend for storing or restoring persistent environments Options:huggingface,kaggle -
<DATASET_MANAGER_TOKEN>: Authentication for the selected dataset manager- For HuggingFace → your HF token
- For Kaggle → path to your
kaggle.jsonfile (If not provided, Kernl will securely prompt you.)
-
<SLUG_ID>(optional): Identifier of a previously uploaded VSCode configuration to restore at startup
Kernl lets you connect your remote VSCode Web workspace to major distributed version-control platforms like GitHub, GitLab, and Bitbucket and set up SSH integrations with ease in just a few steps. Instead of manually generating keys, configuring SSH files and known hosts, and uploading public keys to these platforms individually, Kernl provides simple CLI commands that set up SSH integration with your VCPs and get you connected to your codebases quickly so you can start building from the get-go.
All SSH integration and helper operations in Kernl are organized under the kernl ssh command interface as follows:
kernl ssh <scope> <command> [flags]
<scope>defines the target surface, it can belocalfor managing keys on your workspace, or a provider scope likegithub,gitlab, orbitbucketfor platform-specific operations.<command>specifies what operation to perform, such asgenerate-key,set-token, oradd-key.[flags]provide the required inputs like key names, token values, titles, or file paths.
The local scope includes all operations for generating, inspecting, and managing SSH keys inside your Kernl workspace. These commands help prepare your environment before connecting to GitHub, GitLab, or Bitbucket.
kernl ssh local generate-key \
--type <KEY_TYPE> \
--bits <BIT_SIZE> \
--email <EMAIL> \
--key-name <KEY_NAME> \
--passphrase <PASSPHRASE> \
--overwriteGenerates a new SSH keypair inside ~/.ssh/.
<KEY_TYPE>: Algorithm to use (ed25519, rsa, ecdsa)<BIT_SIZE>: Key size for RSA/ECDSA (2048, 3072, 4096, 256, 384, 521)<EMAIL>: Comment stored inside the public key<KEY_NAME>: Output filename under~/.ssh/<PASSPHRASE>: Optional passphrase for securing the private key--overwrite: Boolean flag — if provided, overwrites an existing key; if omitted = False
kernl ssh local list-keysDisplays all SSH public keys available in your workspace.
kernl ssh local delete-key <KEY_NAME>Deletes both the private and public key for the specified keypair.
<KEY_NAME>: Name of the SSH keypair to remove
kernl ssh local expose-public-key <PUBLIC_KEY_FILE>Prints the contents of a public key.
<PUBLIC_KEY_FILE>: The.pubkey file to display
kernl ssh local set-git-credentials \
--name <GIT_USER_NAME> \
--email <GIT_USER_EMAIL> \
--scope <CONFIG_SCOPE>Configures Git’s username and email.
<GIT_USER_NAME>: Author name for Git commits<GIT_USER_EMAIL>: Author email for Git commits<CONFIG_SCOPE>: Git configuration scope (globalorlocal)
kernl ssh local update-ssh-config \
--private-key-path <PRIVATE_KEY_PATH> \
--hostname <HOSTNAME> \
--alias <HOST_ALIAS> \
--user <SSH_USER> \
--port <SSH_PORT>Adds or updates an SSH config entry.
<PRIVATE_KEY_PATH>: Path to the private key<HOSTNAME>: SSH host (e.g., github.com)<HOST_ALIAS>: Alias for the SSH config<SSH_USER>: SSH username (usually"git")<SSH_PORT>: SSH port (default22)
kernl ssh local reset-ssh-config \
--reset-config \
--reset-known-hostsResets your SSH configuration files.
--reset-config: Boolean flag, if provided, resets~/.ssh/config; if omitted = False--reset-known-hosts: Boolean flag, if provided, resets~/.ssh/known_hosts; if omitted = False
The provider scope allows Kernl to authenticate with GitHub, GitLab, and Bitbucket and register SSH keys so your remote VSCode workspace can clone, pull, and push securely using provider-managed SSH access.
kernl ssh <provider> set-token <TOKEN>Authenticates Kernl with your version-control provider.
<provider>: Choose one ofgithub,gitlab, orbitbucket<TOKEN>: Your personal access token for the selected provider
Bitbucket uses a username:app-password structure instead of a standard token.
kernl ssh bitbucket set-token <USERNAME:APP_PASSWORD><provider>: Must bebitbucketfor this variant<USERNAME>: Your Bitbucket account username<APP_PASSWORD>: App password generated from Bitbucket settings
kernl ssh <provider> add-key \
--title <TITLE> \
--path <PUBLIC_KEY_PATH>Registers an SSH public key to the selected provider.
<provider>: Choosegithub,gitlab, orbitbucket<TITLE>: Display name for the key in the provider dashboard<PUBLIC_KEY_PATH>: Path to the.pubkey to upload
kernl ssh <provider> delete-key <KEY_ID>Removes a previously registered SSH key from the selected provider.
<provider>: Choosegithub,gitlab, orbitbucket<KEY_ID>: Identifier of the key as returned by the provider
kernl ssh <provider> list-keysRetrieves all SSH keys registered on the selected provider.
<provider>: Choosegithub,gitlab, orbitbucket
kernl ssh <provider> test-connectionChecks whether Kernl can authenticate with the selected provider using SSH.
<provider>: Choosegithub,gitlab, orbitbucket
This section outlines the recommended end-to-end workflow for preparing your Kernl remote VSCode workspace with fully functional SSH authentication across GitHub, GitLab, or Bitbucket. Follow these steps sequentially to ensure a smooth and reliable setup.
If you don’t already have an SSH keypair for Kernl, generate one:
kernl ssh local generate-key \
--type <KEY_TYPE> \
--bits <BIT_SIZE> \
--email <EMAIL> \
--key-name <KEY_NAME>This creates your private and public keys under ~/.ssh/ inside the workspace.
kernl ssh local set-git-credentials \
--name <GIT_USER_NAME> \
--email <GIT_USER_EMAIL> \
--scope <CONFIG_SCOPE>Ensures all commits pushed from Kernl have the correct author identity.
kernl ssh <provider> set-token <TOKEN>This authorizes Kernl to upload and manage SSH keys on your provider account.
If using Bitbucket, use the <USERNAME:APP_PASSWORD> format.
kernl ssh <provider> add-key \
--title <TITLE> \
--path <PUBLIC_KEY_PATH>This registers your workspace’s SSH public key with your chosen provider.
To confirm the key exists on your account:
kernl ssh <provider> list-keysMake sure your uploaded key appears in the returned list.
kernl ssh <provider> test-connectionValidates that Kernl can authenticate with your provider via SSH. If this succeeds, your setup is complete.
Once everything is connected, simply run:
git clone git@<provider>.com:<user_or_org>/<repo>.gitOr via provider-specific alias (after your SSH config is updated):
git clone <HOST_ALIAS>:<user_or_org>/<repo>.gitYour workspace is now fully authenticated and ready for development.
After initial setup, all Git operations will work smoothly:
git pull
git add .
git commit -m "Your message"
git pushNo passwords or tokens required, everything uses secure SSH.
Kernl supports cloud-backed environment storage through HuggingFace 🤗 and Kaggle, allowing you to upload or download full development environments, codebases, configurations, virtual environments, or any folder-based workspace components. All operations are handled through the dataset manager you selected when starting the server.
To perform dataset operations through the CLI, use:
kernl dataset \
--dataset_manager <huggingface|kaggle> \
--action <upload|download> \
--slug_id <SLUG_ID> \
--path <LOCAL_FOLDER_PATH> \
--token <TOKEN>Replace the following:
-
<dataset_manager>: The cloud backend to use for storage, options arehuggingface,kaggle -
<action>: The dataset operation to perform, options areupload,download -
<SLUG_ID>: Unique dataset identifier for the selected platform • HuggingFace: must follow HF slug rules • Kaggle: must be 6–50 chars, alphanumeric and hyphens only -
<LOCAL_FOLDER_PATH>: Path to the folder you want to upload or where a downloaded environment should be stored -
<TOKEN>: Authentication credential for the chosen dataset manager • HuggingFace uses a Personal Access Token • Kaggle uses akaggle.jsonfile path
Environment upload automatically performs fast tar-lz4 compression, and downloads automatically decompress the archived folder, allowing development environments to be transferred, restored, or reused across cloud instances efficiently.
Contributions are welcome! If you have suggestions, bug reports, or feature requests, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure
kernlruns as expected. - Submit a pull request with a clear and detailed explanation of your updates.
This project is licensed under the GNU General Public License v3.0, check out the LICENSE file for more details.
If you have any questions or need assistance, feel free to reach out:
- GitHub Issues: Issues Page
- Email: [email protected]
