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.3.tar.gz (23.0 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.3-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotctl-1.0.3.tar.gz
  • Upload date:
  • Size: 23.0 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.3.tar.gz
Algorithm Hash digest
SHA256 07800211414c9cf1e238946a65c7f6b6f157e03375bf9c35be3afcf26432297d
MD5 747e109a8d2dab768e0f7aa69d563391
BLAKE2b-256 208379fab90c3aa3ef9bbb6151e7e7cce8c32688c8a080b546c1295f5ec043ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotctl-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 29.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b043f0df175911b2a4db7542c8ac66b055d66b1b73a9ced6de5980a3125c94ac
MD5 773c1b16f6261188c13168278648aa53
BLAKE2b-256 a899cda6e30f1077845188201fd81398c30711ee67ae02cdd45fc96bcd5a2b6e

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