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.4.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.4-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotctl-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a7cdb46ffbdd877587931d95afffdaf405a296b4d96b35a20b70e03a6f981c36
MD5 8007cb7d75afacee78ef62c32d700a2f
BLAKE2b-256 8f61315536e0eb01b2aa486e1e0dc2a60f684a46d79522da92e4caf8352e232e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotctl-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 30.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 efbc7b17401cdb1ab6792d5ef3f4259d864e183909eb3cc9bb040e261fd1c0d3
MD5 438a97b03bb79316b698c62c0d769809
BLAKE2b-256 75ce986461fc7da39a30b2b7038013c9158a180f5e4d07ad1ab175c5a8a1110c

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