dotctl 1.0.4__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dotctl-1.0.6/PKG-INFO +636 -0
- dotctl-1.0.6/README.md +610 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/pyproject.toml +1 -1
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/activator.py +12 -2
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/arg_manager.py +8 -0
- dotctl-1.0.6/src/dotctl/handlers/hooks_handler.py +79 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/main.py +2 -0
- dotctl-1.0.6/src/dotctl/utils.py +13 -0
- dotctl-1.0.6/src/dotctl.egg-info/PKG-INFO +636 -0
- dotctl-1.0.4/PKG-INFO +0 -355
- dotctl-1.0.4/README.md +0 -329
- dotctl-1.0.4/src/dotctl/handlers/hooks_handler.py +0 -110
- dotctl-1.0.4/src/dotctl/utils.py +0 -5
- dotctl-1.0.4/src/dotctl.egg-info/PKG-INFO +0 -355
- {dotctl-1.0.4 → dotctl-1.0.6}/LICENSE +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/setup.cfg +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/__init__.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/__init__.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/creator.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/exporter.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/importer.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/initializer.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/lister.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/remover.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/saver.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/switcher.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/actions/wiper.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/exception.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/handlers/__init__.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/handlers/config_handler.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/handlers/data_handler.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/handlers/git_handler.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/hooks/post_apply.sh +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/hooks/pre_apply.sh +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/paths.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/templates/__init__.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/templates/dev.yaml +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/templates/kde.yaml +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/templates/other.yaml +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl/validators.py +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl.egg-info/SOURCES.txt +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl.egg-info/dependency_links.txt +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl.egg-info/entry_points.txt +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl.egg-info/requires.txt +0 -0
- {dotctl-1.0.4 → dotctl-1.0.6}/src/dotctl.egg-info/top_level.txt +0 -0
dotctl-1.0.6/PKG-INFO
ADDED
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dotctl
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: 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.
|
|
5
|
+
Author-email: Pankaj Jackson <pankajackson@live.co.uk>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/pankajackson/dotctl
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/pankajackson/dotctl/issues
|
|
9
|
+
Project-URL: Source, https://github.com/pankajackson/dotctl
|
|
10
|
+
Keywords: dotfiles,config,settings,backup,dotfile-manager
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Topic :: System :: Archiving :: Backup
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: PyYAML
|
|
24
|
+
Requires-Dist: gitpython
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# DotCtl
|
|
28
|
+
|
|
29
|
+
**dotctl** is a powerful CLI tool to manage, save, apply, export, and import system configurations as named profiles.
|
|
30
|
+
It helps centralize dotfiles and service configurations in Git repositories for seamless replication across systems.
|
|
31
|
+
|
|
32
|
+
Designed for developers and sysadmins, it supports pre/post hook scripts and is ideal for setting up consistent environments across desktops and servers.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📚 Table of Contents
|
|
37
|
+
|
|
38
|
+
- [DotCtl](#dotctl)
|
|
39
|
+
- [📚 Table of Contents](#-table-of-contents)
|
|
40
|
+
- [🚀 Features](#-features)
|
|
41
|
+
- [📁 Profile Config Structure (`dotctl.yaml`)](#-profile-config-structure-dotctlyaml)
|
|
42
|
+
- [🧠 Concept Overview](#-concept-overview)
|
|
43
|
+
- [🗝 Available Path Keys](#-available-path-keys)
|
|
44
|
+
- [✅ Example: Minimal Config](#-example-minimal-config)
|
|
45
|
+
- [💻 Real World: Full Ubuntu + KDE Config](#-real-world-full-ubuntu--kde-config)
|
|
46
|
+
- [📦 Profile Usage Flow (e.g., nginx)](#-profile-usage-flow-eg-nginx)
|
|
47
|
+
- [🔄 Profile Workflow Diagram](#-profile-workflow-diagram)
|
|
48
|
+
- [📊 Profile Block Table](#-profile-block-table)
|
|
49
|
+
- [🔁 Example Workflow Table](#-example-workflow-table)
|
|
50
|
+
- [🔧 Installation](#-installation)
|
|
51
|
+
- [📘 Usage](#-usage)
|
|
52
|
+
- [🛠️ Commands](#️-commands)
|
|
53
|
+
- [📁 `init`](#-init)
|
|
54
|
+
- [💾 `save`](#-save)
|
|
55
|
+
- [📋 `list` / `ls`](#-list--ls)
|
|
56
|
+
- [🔀 `switch` / `sw`](#-switch--sw)
|
|
57
|
+
- [🆕 `create` / `new`](#-create--new)
|
|
58
|
+
- [❌ `remove` / `rm` / `delete` / `del`](#-remove--rm--delete--del)
|
|
59
|
+
- [🧪 `apply`](#-apply)
|
|
60
|
+
- [📤 `export`](#-export)
|
|
61
|
+
- [📥 `import`](#-import)
|
|
62
|
+
- [🔥 `wipe`](#-wipe)
|
|
63
|
+
- [🧑💻 Development \& Publishing](#-development--publishing)
|
|
64
|
+
- [Setup Development Environment](#setup-development-environment)
|
|
65
|
+
- [Test the new code](#test-the-new-code)
|
|
66
|
+
- [Build the Package](#build-the-package)
|
|
67
|
+
- [Publish to TestPyPI](#publish-to-testpypi)
|
|
68
|
+
- [Publish to PyPI](#publish-to-pypi)
|
|
69
|
+
- [🙋 Contact](#-contact)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🚀 Features
|
|
74
|
+
|
|
75
|
+
- 📦 **Profile Management** — Create, switch, save, remove, and apply system profiles.
|
|
76
|
+
- 🌀 **Pre/Post Hooks** — Run scripts before or after activating a profile (e.g., install packages, restart services).
|
|
77
|
+
- 🔄 **Git Integration** — Sync profiles with local or remote Git repositories.
|
|
78
|
+
- 📁 **Portable Configs** — Export/import profiles using `.dtsv` files for easy backups and sharing.
|
|
79
|
+
- ⚙️ **Custom Configs** — Define tracking rules via `dotctl.yaml`.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📁 Profile Config Structure (`dotctl.yaml`)
|
|
84
|
+
|
|
85
|
+
The `dotctl.yml` config file defines what files and directories to **track**, **save**, and **export** as part of a system profile. This enables seamless migration, sharing, and restoration of system configs and personalizations—perfect for dotfiles, apps, or entire setups like KDE.
|
|
86
|
+
|
|
87
|
+
### 🧠 Concept Overview
|
|
88
|
+
|
|
89
|
+
The config has two main sections:
|
|
90
|
+
|
|
91
|
+
- **`save`**:
|
|
92
|
+
Specifies config files or directories that should be version-controlled (typically small files like dotfiles).
|
|
93
|
+
These are **committed to Git** and restored via `dotctl apply`.
|
|
94
|
+
- **`export`**:
|
|
95
|
+
For large or non-versioned files (like fonts, themes, or binaries) that **shouldn't go into Git**, but you still want to package and move using `dotctl export`/`import`.
|
|
96
|
+
This is helpful in offline environments or when syncing across machines.
|
|
97
|
+
|
|
98
|
+
Each section can define **any number of data blocks**, and every block contains:
|
|
99
|
+
|
|
100
|
+
- `location`: A base directory (like `$HOME` or `$CONFIG_DIR`).
|
|
101
|
+
- `entries`: A list of files/directories to include relative to the `location`.
|
|
102
|
+
|
|
103
|
+
### 🗝 Available Path Keys
|
|
104
|
+
|
|
105
|
+
To simplify path definitions, these keys can be used in `location`:
|
|
106
|
+
|
|
107
|
+
| Key | Path |
|
|
108
|
+
| ----------------- | ---------------- |
|
|
109
|
+
| `$HOME` | `/home/<user>` |
|
|
110
|
+
| `$APP_DIR` | `~/.dotctl` |
|
|
111
|
+
| `$CONFIG_DIR` | `~/.config` |
|
|
112
|
+
| `$SHARE_DIR` | `~/.local/share` |
|
|
113
|
+
| `$BIN_DIR` | `~/.local/bin` |
|
|
114
|
+
| `$SYS_SHARE_DIR` | `/usr/share` |
|
|
115
|
+
| `$SYS_CONFIG_DIR` | `/etc` |
|
|
116
|
+
|
|
117
|
+
Use them to make profiles portable across systems.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### ✅ Example: Minimal Config
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
save:
|
|
125
|
+
configs:
|
|
126
|
+
location: $HOME
|
|
127
|
+
entries:
|
|
128
|
+
- test.txt
|
|
129
|
+
|
|
130
|
+
export:
|
|
131
|
+
share_folder:
|
|
132
|
+
location: $HOME/.local/share
|
|
133
|
+
entries: []
|
|
134
|
+
home_folder:
|
|
135
|
+
location: $HOME/
|
|
136
|
+
entries: []
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### 💻 Real World: Full Ubuntu + KDE Config
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
save:
|
|
145
|
+
configs:
|
|
146
|
+
location: $CONFIG_DIR
|
|
147
|
+
entries:
|
|
148
|
+
- gtk-2.0
|
|
149
|
+
- gtk-3.0
|
|
150
|
+
- gtk-4.0
|
|
151
|
+
- Kvantum
|
|
152
|
+
- latte
|
|
153
|
+
- dolphinrc
|
|
154
|
+
- konsolerc
|
|
155
|
+
- kcminputrc
|
|
156
|
+
- kdeglobals
|
|
157
|
+
- kglobalshortcutsrc
|
|
158
|
+
- klipperrc
|
|
159
|
+
- krunnerrc
|
|
160
|
+
- kscreenlockerrc
|
|
161
|
+
- ksmserverrc
|
|
162
|
+
- kwinrc
|
|
163
|
+
- kwinrulesrc
|
|
164
|
+
- plasma-org.kde.plasma.desktop-appletsrc
|
|
165
|
+
- plasmarc
|
|
166
|
+
- plasmashellrc
|
|
167
|
+
- gtkrc
|
|
168
|
+
- gtkrc-2.0
|
|
169
|
+
- lattedockrc
|
|
170
|
+
- breezerc
|
|
171
|
+
- oxygenrc
|
|
172
|
+
- lightlyrc
|
|
173
|
+
- ksplashrc
|
|
174
|
+
- khotkeysrc
|
|
175
|
+
- autostart
|
|
176
|
+
|
|
177
|
+
app_layouts:
|
|
178
|
+
location: $HOME/.local/share/kxmlgui5
|
|
179
|
+
entries:
|
|
180
|
+
- dolphin
|
|
181
|
+
- konsole
|
|
182
|
+
|
|
183
|
+
home_folder:
|
|
184
|
+
location: $HOME/
|
|
185
|
+
entries:
|
|
186
|
+
- .zshrc
|
|
187
|
+
- .p10k.zsh
|
|
188
|
+
|
|
189
|
+
sddm_configs:
|
|
190
|
+
location: $SYS_CONFIG_DIR
|
|
191
|
+
entries:
|
|
192
|
+
- sddm.conf.d
|
|
193
|
+
|
|
194
|
+
export:
|
|
195
|
+
home_folder:
|
|
196
|
+
location: $HOME/
|
|
197
|
+
entries:
|
|
198
|
+
- .fonts
|
|
199
|
+
- .themes
|
|
200
|
+
- .icons
|
|
201
|
+
- .wallpapers
|
|
202
|
+
- .conky
|
|
203
|
+
- .zsh
|
|
204
|
+
- .bin
|
|
205
|
+
- bin
|
|
206
|
+
|
|
207
|
+
share_folder:
|
|
208
|
+
location: $SHARE_DIR
|
|
209
|
+
entries:
|
|
210
|
+
- plasma
|
|
211
|
+
- kwin
|
|
212
|
+
- konsole
|
|
213
|
+
- fonts
|
|
214
|
+
- kfontinst
|
|
215
|
+
- color-schemes
|
|
216
|
+
- aurorae
|
|
217
|
+
- icons
|
|
218
|
+
- wallpapers
|
|
219
|
+
|
|
220
|
+
root_share_folder:
|
|
221
|
+
location: $SYS_SHARE_DIR
|
|
222
|
+
entries:
|
|
223
|
+
- plasma
|
|
224
|
+
- kwin
|
|
225
|
+
- konsole
|
|
226
|
+
- fonts
|
|
227
|
+
- kfontinst
|
|
228
|
+
- color-schemes
|
|
229
|
+
- aurorae
|
|
230
|
+
- icons
|
|
231
|
+
- wallpapers
|
|
232
|
+
- Kvantum
|
|
233
|
+
- themes
|
|
234
|
+
|
|
235
|
+
sddm:
|
|
236
|
+
location: $SYS_SHARE_DIR/sddm
|
|
237
|
+
entries:
|
|
238
|
+
- themes
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
### 📦 Profile Usage Flow (e.g., nginx)
|
|
244
|
+
|
|
245
|
+
For a service like **nginx**, your profile might:
|
|
246
|
+
|
|
247
|
+
- `save:` files like `/etc/nginx/nginx.conf`, `/etc/nginx/sites-*`
|
|
248
|
+
- Include a **pre-hook** to install nginx (`apt-get install -y nginx`)
|
|
249
|
+
- Use a **post-hook** to reload the service (`systemctl reload nginx`)
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 🔄 Profile Workflow Diagram
|
|
254
|
+
|
|
255
|
+
This diagram shows the typical lifecycle of using a `dotctl` profile, from saving configs to applying them on another machine:
|
|
256
|
+
|
|
257
|
+

|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
┌──────────────┐
|
|
261
|
+
│ dotctl.yml │
|
|
262
|
+
└──────┬───────┘
|
|
263
|
+
│
|
|
264
|
+
┌─────────▼──────────┐
|
|
265
|
+
│ `save` Section │ ◄──── Config Files
|
|
266
|
+
└────────┬───────────┘
|
|
267
|
+
│
|
|
268
|
+
┌────────▼───────────┐
|
|
269
|
+
│ dotctl save │
|
|
270
|
+
└────────┬───────────┘
|
|
271
|
+
│
|
|
272
|
+
▼
|
|
273
|
+
Push to Git Repository
|
|
274
|
+
│
|
|
275
|
+
▼
|
|
276
|
+
┌─────────────────────┐
|
|
277
|
+
│ Transfer to New PC │
|
|
278
|
+
└────────┬────────────┘
|
|
279
|
+
│
|
|
280
|
+
┌───────▼──────────┐
|
|
281
|
+
│ dotctl apply │
|
|
282
|
+
└───────┬──────────┘
|
|
283
|
+
│
|
|
284
|
+
┌───────────▼────────────┐
|
|
285
|
+
│ Pre-hook (e.g. install)│
|
|
286
|
+
└───────────┬────────────┘
|
|
287
|
+
▼
|
|
288
|
+
Apply saved config files
|
|
289
|
+
│
|
|
290
|
+
┌──────────────▼─────────────────┐
|
|
291
|
+
│ Post-hook (e.g. restart/reload)│
|
|
292
|
+
└────────────────────────────────┘
|
|
293
|
+
|
|
294
|
+
│
|
|
295
|
+
▼
|
|
296
|
+
┌─────────────────────┐
|
|
297
|
+
│ dotctl export │
|
|
298
|
+
└────────┬────────────┘
|
|
299
|
+
▼
|
|
300
|
+
Create `.dtsv` file
|
|
301
|
+
│
|
|
302
|
+
Transfer `.dtsv` file
|
|
303
|
+
▼
|
|
304
|
+
┌─────────────────────┐
|
|
305
|
+
│ dotctl import │
|
|
306
|
+
└─────────────────────┘
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 📊 Profile Block Table
|
|
312
|
+
|
|
313
|
+
| Section | Field | Description |
|
|
314
|
+
| -------- | ---------- | ----------------------------------------------------------------- |
|
|
315
|
+
| `save` | `location` | Base path of the tracked files (can use key like `$CONFIG_DIR`) |
|
|
316
|
+
| | `entries` | List of files/folders to track under that location |
|
|
317
|
+
| `export` | `location` | Base path of export files (e.g., large assets not suited for Git) |
|
|
318
|
+
| | `entries` | List of assets or binaries to package in `.dtsv` |
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 🔁 Example Workflow Table
|
|
323
|
+
|
|
324
|
+
| Action | Command | Description |
|
|
325
|
+
| --------------- | ---------------------- | ----------------------------------------------------------- |
|
|
326
|
+
| Save configs | `dotctl save` | Pulls files defined in `save` and stores in repo |
|
|
327
|
+
| Export assets | `dotctl export` | Package large, non-Git assets into `.dtsv` file |
|
|
328
|
+
| Transfer assets | `scp profile.dtsv ...` | Manually copy to another machine |
|
|
329
|
+
| Import assets | `dotctl import` | Unpack `.dtsv` on another system |
|
|
330
|
+
| Apply profile | `dotctl apply` | Pull from repo, run pre/post hooks, and apply saved configs |
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 🔧 Installation
|
|
335
|
+
|
|
336
|
+
```sh
|
|
337
|
+
pip install dotctl
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 📘 Usage
|
|
343
|
+
|
|
344
|
+
```sh
|
|
345
|
+
dotctl [OPTIONS] <COMMAND> [ARGS]
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Run `dotctl -h` for global help or `dotctl <COMMAND> -h` for command-specific help.
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## 🛠️ Commands
|
|
353
|
+
|
|
354
|
+
### 📁 `init`
|
|
355
|
+
|
|
356
|
+
Initialize a new profile.
|
|
357
|
+
|
|
358
|
+
```sh
|
|
359
|
+
dotctl init [-h] [-u <git-url>] [-p <profile>] [-c <config-path>] [-e <env>]
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Examples:**
|
|
363
|
+
|
|
364
|
+
```sh
|
|
365
|
+
dotctl init -e kde
|
|
366
|
+
dotctl init -u https://github.com/user880/dots.git -p mydesktop
|
|
367
|
+
dotctl init -c ./my_custom_config.yaml
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Options:**
|
|
371
|
+
|
|
372
|
+
- `-e, --env` – Target environment (e.g., kde, gnome, server).
|
|
373
|
+
- `-u, --url` – Git URL to clone profile from.
|
|
374
|
+
- `-p, --profile` – Activate this profile after init.
|
|
375
|
+
- `-c, --config` – Path to custom YAML config.
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
### 💾 `save`
|
|
380
|
+
|
|
381
|
+
Save current system state to the active profile.
|
|
382
|
+
|
|
383
|
+
```sh
|
|
384
|
+
dotctl save [-h] [-p <password>] [--skip-sudo] [profile]
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Examples:**
|
|
388
|
+
|
|
389
|
+
```sh
|
|
390
|
+
dotctl save
|
|
391
|
+
dotctl save my_web_server --skip-sudo
|
|
392
|
+
dotctl save my_web_server -p mYsecretp@ssw0rd
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Options:**
|
|
396
|
+
|
|
397
|
+
- `--skip-sudo` – Ignore restricted resources.
|
|
398
|
+
- `-p, --password` – Password for restricted resources.
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
### 📋 `list` / `ls`
|
|
403
|
+
|
|
404
|
+
List all profiles.
|
|
405
|
+
|
|
406
|
+
```sh
|
|
407
|
+
dotctl list [-h] [--details] [--fetch]
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Examples:**
|
|
411
|
+
|
|
412
|
+
```sh
|
|
413
|
+
dotctl list
|
|
414
|
+
dotctl list --details
|
|
415
|
+
dotctl list --fetch
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Options:**
|
|
419
|
+
|
|
420
|
+
- `--details` – Show extended info.
|
|
421
|
+
- `--fetch` – Refresh remote data.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
### 🔀 `switch` / `sw`
|
|
426
|
+
|
|
427
|
+
Switch to another profile.
|
|
428
|
+
|
|
429
|
+
```sh
|
|
430
|
+
dotctl switch [-h] [--fetch] [profile]
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Examples:**
|
|
434
|
+
|
|
435
|
+
```sh
|
|
436
|
+
dotctl switch MyProfile
|
|
437
|
+
dotctl sw MyProfile --fetch
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Options:**
|
|
441
|
+
|
|
442
|
+
- `--fetch` – Refresh profile info before switching.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
### 🆕 `create` / `new`
|
|
447
|
+
|
|
448
|
+
Create a new, empty profile.
|
|
449
|
+
|
|
450
|
+
```sh
|
|
451
|
+
dotctl create [-h] [--fetch] [-c <path>] [-e <env>] profile
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Examples:**
|
|
455
|
+
|
|
456
|
+
```sh
|
|
457
|
+
# Create a new profile from current active profile.
|
|
458
|
+
dotctl create myserver
|
|
459
|
+
|
|
460
|
+
# Create a empty new profile from a specific environment.
|
|
461
|
+
dotctl create -e kde
|
|
462
|
+
|
|
463
|
+
# Create a empty new profile from a custom config.
|
|
464
|
+
dotctl create -c ./my_custom_config.yaml
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Options:**
|
|
468
|
+
|
|
469
|
+
- `--fetch` – Sync with remote before creating.
|
|
470
|
+
- `-c, --config` – Path to custom YAML config.
|
|
471
|
+
- `-e, --env` – Target environment (e.g., kde, gnome, server).
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
### ❌ `remove` / `rm` / `delete` / `del`
|
|
476
|
+
|
|
477
|
+
Remove a profile locally and/or remotely.
|
|
478
|
+
|
|
479
|
+
```sh
|
|
480
|
+
dotctl remove [-h] [-y] [--fetch] <profile>
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
**Examples:**
|
|
484
|
+
|
|
485
|
+
```sh
|
|
486
|
+
dotctl rm MyProfile
|
|
487
|
+
dotctl del MyProfile --fetch
|
|
488
|
+
dotctl del MyProfile -y
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**Options:**
|
|
492
|
+
|
|
493
|
+
- `--fetch` – Refresh data before removal.
|
|
494
|
+
- `-y, --no-confirm` – Skip confirmation prompt.
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
### 🧪 `apply`
|
|
499
|
+
|
|
500
|
+
Apply a saved profile.
|
|
501
|
+
|
|
502
|
+
```sh
|
|
503
|
+
dotctl apply [-h] [-p <password>] [--skip-sudo] [--skip-hooks] [--skip-pre-hooks] [--skip-post-hooks] [--ignore-hook-errors] [--hooks-timeout <timeout>] [profile]
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**Examples:**
|
|
507
|
+
|
|
508
|
+
```sh
|
|
509
|
+
dotctl apply
|
|
510
|
+
dotctl apply mydesktop --skip-hooks
|
|
511
|
+
dotctl apply mydesktop --hooks-timeout 10
|
|
512
|
+
dotctl apply MyProfile --skip-pre-hooks --ignore-hook-errors
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
**Options:**
|
|
516
|
+
|
|
517
|
+
- `--skip-sudo` – Ignore restricted resources.
|
|
518
|
+
- `--skip-hooks` – Skip all hooks.
|
|
519
|
+
- `--skip-pre-hooks` – Skip only pre-hooks.
|
|
520
|
+
- `--skip-post-hooks` – Skip only post-hooks.
|
|
521
|
+
- `--ignore-hook-errors` – Don’t abort if hooks fail.
|
|
522
|
+
- `--hooks-timeout` – Timeout in seconds for hooks.
|
|
523
|
+
- `-p, --password` – Password for restricted actions.
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
### 📤 `export`
|
|
528
|
+
|
|
529
|
+
Export a profile to `.dtsv`.
|
|
530
|
+
|
|
531
|
+
```sh
|
|
532
|
+
dotctl export [-h] [-p <password>] [--skip-sudo] [profile]
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
**Examples:**
|
|
536
|
+
|
|
537
|
+
```sh
|
|
538
|
+
dotctl export
|
|
539
|
+
dotctl export my_web_server --skip-sudo
|
|
540
|
+
dotctl export my_web_server -p mYsecretp@ssw0rd
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**Options:**
|
|
544
|
+
|
|
545
|
+
- `--skip-sudo`, `-p` same as above.
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
### 📥 `import`
|
|
550
|
+
|
|
551
|
+
Import a `.dtsv` profile.
|
|
552
|
+
|
|
553
|
+
```sh
|
|
554
|
+
dotctl import [-h] [-p <password>] [--skip-sudo] <file.dtsv>
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
**Examples:**
|
|
558
|
+
|
|
559
|
+
```sh
|
|
560
|
+
dotctl import my_web_server.dtsv
|
|
561
|
+
dotctl import /data/backup/web.dtsv --skip-sudo
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
**Options:**
|
|
565
|
+
|
|
566
|
+
- `--skip-sudo`, `-p` same as above.
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
### 🔥 `wipe`
|
|
571
|
+
|
|
572
|
+
Remove all local profiles.
|
|
573
|
+
|
|
574
|
+
```sh
|
|
575
|
+
dotctl wipe [-h] [-y]
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**Examples:**
|
|
579
|
+
|
|
580
|
+
```sh
|
|
581
|
+
dotctl wipe
|
|
582
|
+
dotctl wipe -y
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
**Options:**
|
|
586
|
+
|
|
587
|
+
- `-y, --no-confirm` – Do not prompt before wiping.
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
## 🧑💻 Development & Publishing
|
|
592
|
+
|
|
593
|
+
### Setup Development Environment
|
|
594
|
+
|
|
595
|
+
```sh
|
|
596
|
+
python -m venv venv
|
|
597
|
+
source venv/bin/activate # Linux/macOS
|
|
598
|
+
venv\Scripts\activate # Windows
|
|
599
|
+
|
|
600
|
+
pip install -r requirements.txt
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
### Test the new code
|
|
604
|
+
|
|
605
|
+
```sh
|
|
606
|
+
cd src
|
|
607
|
+
python -m dotctl.main --help
|
|
608
|
+
python -m dotctl.main new my_profile
|
|
609
|
+
python -m dotctl.main save
|
|
610
|
+
python -m dotctl.main apply
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### Build the Package
|
|
614
|
+
|
|
615
|
+
```sh
|
|
616
|
+
python -m build
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
### Publish to TestPyPI
|
|
620
|
+
|
|
621
|
+
```sh
|
|
622
|
+
twine upload --repository testpypi dist/*
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
### Publish to PyPI
|
|
626
|
+
|
|
627
|
+
```sh
|
|
628
|
+
twine upload --repository pypi dist/*
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
---
|
|
632
|
+
|
|
633
|
+
## 🙋 Contact
|
|
634
|
+
|
|
635
|
+
- **Maintainer:** [Pankaj Jackson](https://github.com/pankajackson)
|
|
636
|
+
- **Support:** [Open an Issue](https://github.com/pankajackson/dotctl/issues)
|