lnp-devopscli 1.0.0__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.
- lnp_devopscli-1.0.0/PKG-INFO +136 -0
- lnp_devopscli-1.0.0/README.md +109 -0
- lnp_devopscli-1.0.0/pyproject.toml +53 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/__init__.py +3 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/groups/__init__.py +0 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/groups/bw.py +430 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/groups/gl.py +300 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/groups/ws.py +1249 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/main.py +54 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/utils/__init__.py +0 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/utils/config.py +83 -0
- lnp_devopscli-1.0.0/scripts/dc_cli/utils/gitlab.py +165 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/PKG-INFO +136 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/SOURCES.txt +17 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/dependency_links.txt +1 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/entry_points.txt +3 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/requires.txt +3 -0
- lnp_devopscli-1.0.0/scripts/lnp_devopscli.egg-info/top_level.txt +1 -0
- lnp_devopscli-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lnp-devopscli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: DevOps CLI — workspace sync (GDrive, git, GPG, systemd timers) + GitLab/Bitwarden tooling
|
|
5
|
+
Author-email: Lucas Neves Pires <npires.lucas@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/lnp-consulting-ti/devops/devops-cli
|
|
8
|
+
Project-URL: Repository, https://gitlab.com/lnp-consulting-ti/devops/devops-cli
|
|
9
|
+
Project-URL: Issues, https://gitlab.com/lnp-consulting-ti/devops/devops-cli/-/issues
|
|
10
|
+
Keywords: devops,workspace-sync,rclone,gdrive,gitlab,bitwarden,systemd
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: System :: Systems Administration
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: click>=8.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: requests>=2.28
|
|
27
|
+
|
|
28
|
+
# lnp-devopscli
|
|
29
|
+
|
|
30
|
+
DevOps CLI for workspace sync (Google Drive + git + GPG + systemd timers) and
|
|
31
|
+
GitLab/Bitwarden tooling.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
### Via PyPI (recommended)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pipx install lnp-devopscli
|
|
39
|
+
# or
|
|
40
|
+
pip install --user lnp-devopscli
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Provides two equivalent commands: `devopscli` and `dc`.
|
|
44
|
+
|
|
45
|
+
### From source
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://gitlab.com/lnp-consulting-ti/devops/devops-cli.git ~/bin/devops-cli
|
|
49
|
+
cd ~/bin/devops-cli && make setup
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Bootstrap on a new PC
|
|
53
|
+
|
|
54
|
+
For a full workspace bootstrap (rclone + GPG + git-crypt + 10 repos + systemd
|
|
55
|
+
timers), use the public bootstrap launcher:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bash <(curl -fsSL https://gitlab.com/-/snippets/6003334/raw/main/bootstrap.sh)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
See [MIGRATION-RUNBOOK.md](https://gitlab.com/lnpires/ai/workspace-personal/-/blob/main/MIGRATION-RUNBOOK.md)
|
|
62
|
+
for the complete migration procedure.
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
devopscli ws sync # full bidirectional sync (pull → git → push)
|
|
68
|
+
devopscli ws push # sync local → GDrive (13 categories)
|
|
69
|
+
devopscli ws pull # sync GDrive → local
|
|
70
|
+
devopscli ws doctor # health check (deps, configs, timers, repos)
|
|
71
|
+
devopscli ws ai-sync # git pull/commit/push for ai_workspaces
|
|
72
|
+
devopscli ws repos-sync # git pull/commit/push for repos_sync
|
|
73
|
+
devopscli ws gpg-backup # export GPG key + encrypt + send to GDrive
|
|
74
|
+
devopscli ws gpg-restore # download GPG key from GDrive + decrypt + import
|
|
75
|
+
devopscli ws install-timers # install systemd user timers (replaces cron)
|
|
76
|
+
devopscli ws uninstall-timers # remove systemd timers
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
See `devopscli ws --help` for the full list.
|
|
80
|
+
|
|
81
|
+
## Security
|
|
82
|
+
|
|
83
|
+
The CLI is open source but never accesses your data without your credentials:
|
|
84
|
+
|
|
85
|
+
- **Google OAuth** protects access to your GDrive (rclone config)
|
|
86
|
+
- **GPG passphrase** protects the GPG key backup
|
|
87
|
+
- **git-crypt** protects `.env` files inside synced repos
|
|
88
|
+
- **GitLab/SSH keys** protect access to private repositories
|
|
89
|
+
|
|
90
|
+
Anyone can `pip install` the CLI — but without your credentials, they cannot
|
|
91
|
+
access your data.
|
|
92
|
+
|
|
93
|
+
## Configuration
|
|
94
|
+
|
|
95
|
+
Edit `~/bin/config.yaml` (synced via `ws push` step 7):
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
ai_workspaces:
|
|
99
|
+
- name: "workspace-personal"
|
|
100
|
+
path: "~/workspace-personal"
|
|
101
|
+
clone_url: "git@gitlab.com:user/repo.git"
|
|
102
|
+
remote: "origin"
|
|
103
|
+
branch: "main"
|
|
104
|
+
auto_commit: true
|
|
105
|
+
commit_message: "chore(auto-sync): snapshot via ws ai-sync"
|
|
106
|
+
|
|
107
|
+
repos_sync:
|
|
108
|
+
- name: "devops-cli"
|
|
109
|
+
path: "~/bin/devops-cli"
|
|
110
|
+
clone_url: "git@gitlab.com:lnp-consulting-ti/devops/devops-cli.git"
|
|
111
|
+
remote: "origin"
|
|
112
|
+
branch: "main"
|
|
113
|
+
auto_commit: true
|
|
114
|
+
commit_message: "chore(auto-sync): snapshot via ws repos-sync"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Release
|
|
118
|
+
|
|
119
|
+
To publish a new version to PyPI:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# 1. Bump version in pyproject.toml
|
|
123
|
+
git commit -am "chore(release): v1.0.1"
|
|
124
|
+
|
|
125
|
+
# 2. Tag and push
|
|
126
|
+
git tag v1.0.1
|
|
127
|
+
git push origin main v1.0.1
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The GitLab CI pipeline auto-publishes when a tag matches `v*.*.*`.
|
|
131
|
+
|
|
132
|
+
Setup once: add `PYPI_TOKEN` to GitLab CI/CD Variables (Settings > CI/CD).
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# lnp-devopscli
|
|
2
|
+
|
|
3
|
+
DevOps CLI for workspace sync (Google Drive + git + GPG + systemd timers) and
|
|
4
|
+
GitLab/Bitwarden tooling.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
### Via PyPI (recommended)
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pipx install lnp-devopscli
|
|
12
|
+
# or
|
|
13
|
+
pip install --user lnp-devopscli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Provides two equivalent commands: `devopscli` and `dc`.
|
|
17
|
+
|
|
18
|
+
### From source
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://gitlab.com/lnp-consulting-ti/devops/devops-cli.git ~/bin/devops-cli
|
|
22
|
+
cd ~/bin/devops-cli && make setup
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Bootstrap on a new PC
|
|
26
|
+
|
|
27
|
+
For a full workspace bootstrap (rclone + GPG + git-crypt + 10 repos + systemd
|
|
28
|
+
timers), use the public bootstrap launcher:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bash <(curl -fsSL https://gitlab.com/-/snippets/6003334/raw/main/bootstrap.sh)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
See [MIGRATION-RUNBOOK.md](https://gitlab.com/lnpires/ai/workspace-personal/-/blob/main/MIGRATION-RUNBOOK.md)
|
|
35
|
+
for the complete migration procedure.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
devopscli ws sync # full bidirectional sync (pull → git → push)
|
|
41
|
+
devopscli ws push # sync local → GDrive (13 categories)
|
|
42
|
+
devopscli ws pull # sync GDrive → local
|
|
43
|
+
devopscli ws doctor # health check (deps, configs, timers, repos)
|
|
44
|
+
devopscli ws ai-sync # git pull/commit/push for ai_workspaces
|
|
45
|
+
devopscli ws repos-sync # git pull/commit/push for repos_sync
|
|
46
|
+
devopscli ws gpg-backup # export GPG key + encrypt + send to GDrive
|
|
47
|
+
devopscli ws gpg-restore # download GPG key from GDrive + decrypt + import
|
|
48
|
+
devopscli ws install-timers # install systemd user timers (replaces cron)
|
|
49
|
+
devopscli ws uninstall-timers # remove systemd timers
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
See `devopscli ws --help` for the full list.
|
|
53
|
+
|
|
54
|
+
## Security
|
|
55
|
+
|
|
56
|
+
The CLI is open source but never accesses your data without your credentials:
|
|
57
|
+
|
|
58
|
+
- **Google OAuth** protects access to your GDrive (rclone config)
|
|
59
|
+
- **GPG passphrase** protects the GPG key backup
|
|
60
|
+
- **git-crypt** protects `.env` files inside synced repos
|
|
61
|
+
- **GitLab/SSH keys** protect access to private repositories
|
|
62
|
+
|
|
63
|
+
Anyone can `pip install` the CLI — but without your credentials, they cannot
|
|
64
|
+
access your data.
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
Edit `~/bin/config.yaml` (synced via `ws push` step 7):
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
ai_workspaces:
|
|
72
|
+
- name: "workspace-personal"
|
|
73
|
+
path: "~/workspace-personal"
|
|
74
|
+
clone_url: "git@gitlab.com:user/repo.git"
|
|
75
|
+
remote: "origin"
|
|
76
|
+
branch: "main"
|
|
77
|
+
auto_commit: true
|
|
78
|
+
commit_message: "chore(auto-sync): snapshot via ws ai-sync"
|
|
79
|
+
|
|
80
|
+
repos_sync:
|
|
81
|
+
- name: "devops-cli"
|
|
82
|
+
path: "~/bin/devops-cli"
|
|
83
|
+
clone_url: "git@gitlab.com:lnp-consulting-ti/devops/devops-cli.git"
|
|
84
|
+
remote: "origin"
|
|
85
|
+
branch: "main"
|
|
86
|
+
auto_commit: true
|
|
87
|
+
commit_message: "chore(auto-sync): snapshot via ws repos-sync"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Release
|
|
91
|
+
|
|
92
|
+
To publish a new version to PyPI:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 1. Bump version in pyproject.toml
|
|
96
|
+
git commit -am "chore(release): v1.0.1"
|
|
97
|
+
|
|
98
|
+
# 2. Tag and push
|
|
99
|
+
git tag v1.0.1
|
|
100
|
+
git push origin main v1.0.1
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The GitLab CI pipeline auto-publishes when a tag matches `v*.*.*`.
|
|
104
|
+
|
|
105
|
+
Setup once: add `PYPI_TOKEN` to GitLab CI/CD Variables (Settings > CI/CD).
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lnp-devopscli"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "DevOps CLI — workspace sync (GDrive, git, GPG, systemd timers) + GitLab/Bitwarden tooling"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Lucas Neves Pires", email = "npires.lucas@gmail.com" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["devops", "workspace-sync", "rclone", "gdrive", "gitlab", "bitwarden", "systemd"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: System Administrators",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: POSIX :: Linux",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Topic :: System :: Systems Administration",
|
|
27
|
+
"Topic :: Utilities",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"click>=8.0",
|
|
31
|
+
"pyyaml>=6.0",
|
|
32
|
+
"requests>=2.28",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://gitlab.com/lnp-consulting-ti/devops/devops-cli"
|
|
37
|
+
Repository = "https://gitlab.com/lnp-consulting-ti/devops/devops-cli"
|
|
38
|
+
Issues = "https://gitlab.com/lnp-consulting-ti/devops/devops-cli/-/issues"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
devopscli = "dc_cli.main:main"
|
|
42
|
+
dc = "dc_cli.main:main"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
package-dir = { "" = "scripts" }
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["scripts"]
|
|
49
|
+
include = ["dc_cli*"]
|
|
50
|
+
exclude = ["tests*", "*.tests*"]
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.package-data]
|
|
53
|
+
"dc_cli" = ["*.toml", "*.yaml", "*.yml"]
|
|
File without changes
|