Skip to main content

A powerful CLI tool to profile your OS by saving, applying, exporting, and importing system configurations as named profiles. Designed to manage dot files and service configurations in a centralized Git repository (local or remote), dotctl enables seamless system replication across machines. Supports pre/post hook scripts, making it ideal for setting up servers or desktops with consistent environments.

Project description

DotCtl

dotctl is a powerful CLI tool to manage, save, apply, export, and import system configurations as named profiles.
It helps centralize dotfiles and service configurations in Git repositories for seamless replication across systems.

Designed for developers and sysadmins, it supports pre/post hook scripts and is ideal for setting up consistent environments across desktops and servers.


๐Ÿ“š Table of Contents


๐Ÿš€ Features

  • ๐Ÿ“ฆ Profile Management โ€” Create, switch, save, remove, and apply system profiles.
  • ๐ŸŒ€ Pre/Post Hooks โ€” Run scripts before or after activating a profile (e.g., install packages, restart services).
  • ๐Ÿ”„ Git Integration โ€” Sync profiles with local or remote Git repositories.
  • ๐Ÿ“ Portable Configs โ€” Export/import profiles using .dtsv files for easy backups and sharing.
  • โš™๏ธ Custom Configs โ€” Define tracking rules via dotctl.yaml.

๐Ÿ”ง Installation

pip install dotctl

๐Ÿ“˜ Usage

dotctl [OPTIONS] <COMMAND> [ARGS]

Run dotctl -h for global help or dotctl <COMMAND> -h for command-specific help.


๐Ÿ› ๏ธ Commands

๐Ÿ“ init

Initialize a new profile.

dotctl init [-h] [-u <git-url>] [-p <profile>] [-c <config-path>] [-e <env>]

Examples:

dotctl init -e kde
dotctl init -u https://github.com/user880/dots.git -p mydesktop
dotctl init -c ./my_custom_config.yaml

Options:

  • -e, --env โ€“ Target environment (e.g., kde, gnome, server).
  • -u, --url โ€“ Git URL to clone profile from.
  • -p, --profile โ€“ Activate this profile after init.
  • -c, --config โ€“ Path to custom YAML config.

๐Ÿ’พ save

Save current system state to the active profile.

dotctl save [-h] [-p <password>] [--skip-sudo] [profile]

Examples:

dotctl save
dotctl save my_web_server --skip-sudo
dotctl save my_web_server -p mYsecretp@ssw0rd

Options:

  • --skip-sudo โ€“ Ignore restricted resources.
  • -p, --password โ€“ Password for restricted resources.

๐Ÿ“‹ list / ls

List all profiles.

dotctl list [-h] [--details] [--fetch]

Examples:

dotctl list
dotctl list --details
dotctl list --fetch

Options:

  • --details โ€“ Show extended info.
  • --fetch โ€“ Refresh remote data.

๐Ÿ”€ switch / sw

Switch to another profile.

dotctl switch [-h] [--fetch] [profile]

Examples:

dotctl switch MyProfile
dotctl sw MyProfile --fetch

Options:

  • --fetch โ€“ Refresh profile info before switching.

๐Ÿ†• create / new

Create a new, empty profile.

dotctl create [-h] [--fetch] <profile>

Examples:

dotctl create myserver
dotctl new myserver --fetch

Options:

  • --fetch โ€“ Sync with remote before creating.

โŒ remove / rm / delete / del

Remove a profile locally and/or remotely.

dotctl remove [-h] [-y] [--fetch] <profile>

Examples:

dotctl rm MyProfile
dotctl del MyProfile --fetch
dotctl del MyProfile -y

Options:

  • --fetch โ€“ Refresh data before removal.
  • -y, --no-confirm โ€“ Skip confirmation prompt.

๐Ÿงช apply

Apply a saved profile.

dotctl apply [-h] [-p <password>] [--skip-sudo] [--skip-hooks] [--skip-pre-hooks] [--skip-post-hooks] [--ignore-hook-errors] [profile]

Examples:

dotctl apply
dotctl apply mydesktop --skip-hooks
dotctl apply MyProfile --skip-pre-hooks --ignore-hook-errors

Options:

  • --skip-sudo โ€“ Ignore restricted resources.
  • --skip-hooks โ€“ Skip all hooks.
  • --skip-pre-hooks โ€“ Skip only pre-hooks.
  • --skip-post-hooks โ€“ Skip only post-hooks.
  • --ignore-hook-errors โ€“ Donโ€™t abort if hooks fail.
  • -p, --password โ€“ Password for restricted actions.

๐Ÿ“ค export

Export a profile to .dtsv.

dotctl export [-h] [-p <password>] [--skip-sudo] [profile]

Examples:

dotctl export
dotctl export my_web_server --skip-sudo
dotctl export my_web_server -p mYsecretp@ssw0rd

Options:

  • --skip-sudo, -p same as above.

๐Ÿ“ฅ import

Import a .dtsv profile.

dotctl import [-h] [-p <password>] [--skip-sudo] <file.dtsv>

Examples:

dotctl import my_web_server.dtsv
dotctl import /data/backup/web.dtsv --skip-sudo

Options:

  • --skip-sudo, -p same as above.

๐Ÿ”ฅ wipe

Remove all local profiles.

dotctl wipe [-h] [-y]

Examples:

dotctl wipe
dotctl wipe -y

Options:

  • -y, --no-confirm โ€“ Do not prompt before wiping.

๐Ÿง‘โ€๐Ÿ’ป Development & Publishing

Setup Development Environment

python -m venv venv
source venv/bin/activate  # Linux/macOS
venv\Scripts\activate     # Windows

pip install -r requirements.txt

Build the Package

python -m build

Publish to TestPyPI

twine upload --repository testpypi dist/*

Publish to PyPI

twine upload --repository pypi dist/*

๐Ÿ™‹ Contact

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

dotctl-1.0.5.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

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

dotctl-1.0.5-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file dotctl-1.0.5.tar.gz.

File metadata

  • Download URL: dotctl-1.0.5.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dotctl-1.0.5.tar.gz
Algorithm Hash digest
SHA256 fbb39966829e72f1c68cc87be46eb58748118b20db927fb75d72ded7c4910cb6
MD5 5f238f853d39a0bfb9116943f7cad8d0
BLAKE2b-256 9414d5045f9624e3af05458b81ef529008a4319efde43774bb308dc56d428ac6

See more details on using hashes here.

File details

Details for the file dotctl-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: dotctl-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dotctl-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 771a68f8bd6bd121293e549224328193c9e6720b3b4f9b0f4e54d1b1a8bb2918
MD5 2add823ad9562e0d53d79aa269fad48f
BLAKE2b-256 622f685393b77158f2df6c0b37d1112dd057bbe6481f49c6297298bce4dd4dbd

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