xgic-gitlab-cli 0.1.1__py3-none-any.whl

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.
@@ -0,0 +1,5 @@
1
+ """XGIC CLI GitLab module (``xgic.cli.gitlab``)."""
2
+
3
+ __version__ = "0.1.1"
4
+
5
+ __all__ = ["__version__"]
@@ -0,0 +1 @@
1
+ """GitLab CLI command handlers."""
@@ -0,0 +1,86 @@
1
+ """``xgic gitlab backup`` — create a GitLab EE backup via Compose exec."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ from typing import Any
8
+
9
+ from xgic.cli.gitlab.compose import ComposeRunner
10
+ from xgic.cli.gitlab.config import resolve_config
11
+ from xgic.cli.utils.output import print_error, print_info, print_success, print_warning
12
+
13
+
14
+ def run_backup(args: argparse.Namespace) -> int:
15
+ """Run ``gitlab-backup create`` inside the GitLab EE service container."""
16
+ cfg = resolve_config(args)
17
+ runner = ComposeRunner(cfg)
18
+ report: dict[str, Any] = {
19
+ "ok": False,
20
+ "action": "backup",
21
+ "config": cfg.public_dict(),
22
+ "command": [
23
+ "gitlab-backup",
24
+ "create",
25
+ ],
26
+ "detail": "",
27
+ }
28
+
29
+ if not runner.available():
30
+ report["detail"] = "docker CLI not found on PATH"
31
+ return _emit(args, report, 1)
32
+
33
+ running = runner.running_services()
34
+ if cfg.gitlab_service not in running:
35
+ report["detail"] = (
36
+ f"service {cfg.gitlab_service!r} is not running "
37
+ f"(running: {running or 'none'})"
38
+ )
39
+ return _emit(args, report, 1)
40
+
41
+ cmd = ["gitlab-backup", "create"]
42
+ # STRATEGY=copy is common for volume-friendly backups; keep optional via env later.
43
+ if cfg.dry_run:
44
+ report["ok"] = True
45
+ report["detail"] = (
46
+ f"dry-run: would exec in {cfg.gitlab_service}: {' '.join(cmd)} "
47
+ f"(host backup dir hint: {cfg.backup_dir})"
48
+ )
49
+ return _emit(args, report, 0)
50
+
51
+ print_info(f"Creating backup in service {cfg.gitlab_service}…")
52
+ proc = runner.exec_service(cfg.gitlab_service, cmd, dry_run=False)
53
+ if proc is None:
54
+ report["detail"] = "exec did not run"
55
+ return _emit(args, report, 1)
56
+
57
+ report["returncode"] = proc.returncode
58
+ report["stdout_tail"] = (proc.stdout or "")[-2000:]
59
+ report["stderr_tail"] = (proc.stderr or "")[-2000:]
60
+ if proc.returncode == 0:
61
+ report["ok"] = True
62
+ report["detail"] = (
63
+ f"backup create completed; copies typically land under the container "
64
+ f"backup path (host map often {cfg.backup_dir})"
65
+ )
66
+ return _emit(args, report, 0)
67
+
68
+ report["detail"] = f"gitlab-backup create failed (exit {proc.returncode})"
69
+ return _emit(args, report, proc.returncode or 1)
70
+
71
+
72
+ def _emit(args: argparse.Namespace, report: dict[str, Any], exit_code: int) -> int:
73
+ if getattr(args, "json", False):
74
+ print(json.dumps(report, indent=2))
75
+ return exit_code
76
+
77
+ if report["ok"]:
78
+ print_success(report["detail"] or "Backup OK")
79
+ else:
80
+ print_error(report["detail"] or "Backup failed")
81
+
82
+ print_info(f"Service: {report['config']['gitlab_service']}")
83
+ print_info(f"Compose: {report['config']['compose_file']}")
84
+ if report.get("stderr_tail"):
85
+ print_warning(report["stderr_tail"][:500])
86
+ return exit_code
@@ -0,0 +1,148 @@
1
+ """``xgic gitlab health`` — Compose + optional HTTP readiness checks."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import urllib.error
8
+ import urllib.request
9
+ from typing import Any
10
+
11
+ from xgic.cli.gitlab.compose import ComposeRunner
12
+ from xgic.cli.gitlab.config import resolve_config
13
+ from xgic.cli.utils.output import print_error, print_info, print_success, print_warning
14
+
15
+
16
+ def _http_ok(url: str, timeout: float = 5.0) -> tuple[bool, str]:
17
+ try:
18
+ req = urllib.request.Request(url, method="GET")
19
+ with urllib.request.urlopen(req, timeout=timeout) as resp: # noqa: S310
20
+ code = getattr(resp, "status", 200)
21
+ if 200 <= int(code) < 400:
22
+ return True, f"HTTP {code}"
23
+ return False, f"HTTP {code}"
24
+ except urllib.error.HTTPError as exc:
25
+ return False, f"HTTP {exc.code}"
26
+ except Exception as exc: # noqa: BLE001 — surface any transport failure
27
+ return False, str(exc)
28
+
29
+
30
+ def run_health(args: argparse.Namespace) -> int:
31
+ """Check stack service presence and optional HTTP health endpoints."""
32
+ cfg = resolve_config(args)
33
+ runner = ComposeRunner(cfg)
34
+ report: dict[str, Any] = {
35
+ "ok": False,
36
+ "config": cfg.public_dict(),
37
+ "docker_available": runner.available(),
38
+ "running_services": [],
39
+ "checks": [],
40
+ }
41
+
42
+ if not runner.available():
43
+ report["checks"].append(
44
+ {"name": "docker", "ok": False, "detail": "docker CLI not found on PATH"}
45
+ )
46
+ return _emit(args, report, exit_code=1)
47
+
48
+ running = runner.running_services()
49
+ report["running_services"] = running
50
+ report["checks"].append(
51
+ {
52
+ "name": "compose_ps",
53
+ "ok": True,
54
+ "detail": f"{len(running)} running service(s)",
55
+ }
56
+ )
57
+
58
+ for service, label in (
59
+ (cfg.xgic_service, "orchestration_service"),
60
+ (cfg.gitlab_service, "gitlab_ee_service"),
61
+ ):
62
+ present = service in running
63
+ report["checks"].append(
64
+ {
65
+ "name": label,
66
+ "ok": present,
67
+ "detail": f"{service}: {'running' if present else 'not running'}",
68
+ }
69
+ )
70
+
71
+ if cfg.gitlab_url:
72
+ health_url = cfg.gitlab_url.rstrip("/") + "/-/health"
73
+ ok, detail = _http_ok(health_url)
74
+ report["checks"].append(
75
+ {"name": "gitlab_http_health", "ok": ok, "detail": f"{health_url} → {detail}"}
76
+ )
77
+ else:
78
+ report["checks"].append(
79
+ {
80
+ "name": "gitlab_http_health",
81
+ "ok": True,
82
+ "detail": "skipped (set GITLAB_URL or --url to enable)",
83
+ "skipped": True,
84
+ }
85
+ )
86
+
87
+ # Optional local orchestration healthz when service is up (container network not required;
88
+ # operators may publish XGIC_GITLAB_PORT — we only probe if --url-style not used).
89
+ # Probe is best-effort via docker compose exec curl if service running.
90
+ if cfg.xgic_service in running and not cfg.dry_run:
91
+ proc = runner.exec_service(
92
+ cfg.xgic_service,
93
+ ["curl", "-fsS", "http://127.0.0.1:8080/healthz"],
94
+ dry_run=False,
95
+ )
96
+ ok = proc is not None and proc.returncode == 0
97
+ detail = "ok" if ok else (proc.stderr or proc.stdout or "failed" if proc else "n/a")
98
+ report["checks"].append(
99
+ {"name": "xgic_healthz", "ok": ok, "detail": str(detail).strip()[:200]}
100
+ )
101
+ elif cfg.dry_run and cfg.xgic_service in running:
102
+ report["checks"].append(
103
+ {
104
+ "name": "xgic_healthz",
105
+ "ok": True,
106
+ "detail": "dry-run: would exec curl healthz in orchestration service",
107
+ "skipped": True,
108
+ }
109
+ )
110
+
111
+ critical = [
112
+ c
113
+ for c in report["checks"]
114
+ if not c.get("skipped") and c["name"] in {"docker", "orchestration_service", "gitlab_ee_service", "gitlab_http_health", "xgic_healthz"}
115
+ ]
116
+ # compose_ps alone is not enough; require gitlab-ee running for overall ok
117
+ gitlab_ok = any(
118
+ c["name"] == "gitlab_ee_service" and c["ok"] for c in report["checks"]
119
+ )
120
+ failed = [c for c in critical if not c["ok"]]
121
+ report["ok"] = gitlab_ok and not failed
122
+
123
+ return _emit(args, report, exit_code=0 if report["ok"] else 1)
124
+
125
+
126
+ def _emit(args: argparse.Namespace, report: dict[str, Any], *, exit_code: int) -> int:
127
+ if getattr(args, "json", False):
128
+ print(json.dumps(report, indent=2))
129
+ return exit_code
130
+
131
+ if report["ok"]:
132
+ print_success("GitLab stack health: OK")
133
+ else:
134
+ print_error("GitLab stack health: issues detected")
135
+
136
+ print_info(f"Compose: {report['config']['compose_file']} (project {report['config']['project_name']})")
137
+ if report["running_services"]:
138
+ print_info("Running: " + ", ".join(report["running_services"]))
139
+ else:
140
+ print_warning("No running Compose services detected")
141
+
142
+ for check in report["checks"]:
143
+ status = "ok" if check["ok"] else "FAIL"
144
+ if check.get("skipped"):
145
+ status = "skip"
146
+ print_info(f"[{status}] {check['name']}: {check['detail']}")
147
+
148
+ return exit_code
@@ -0,0 +1,40 @@
1
+ """``xgic gitlab info`` — module status."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+
8
+ from xgic.cli.gitlab import __version__
9
+ from xgic.cli.utils.output import print_info, print_success
10
+
11
+
12
+ def run_info(args: argparse.Namespace) -> int:
13
+ """Print GitLab CLI module identity and capabilities."""
14
+ payload = {
15
+ "module": "xgic.cli.gitlab",
16
+ "package": "xgic-gitlab-cli",
17
+ "version": __version__,
18
+ "status": "experimental",
19
+ "commands": ["info", "health", "backup", "restore"],
20
+ "planned": [
21
+ "graphql-backed ops (optional extra)",
22
+ ],
23
+ "repository": "https://github.com/xgic/gitlab-cli",
24
+ "graph_client": "https://github.com/xgic/gitlab-graphql",
25
+ "config": {
26
+ "compose_file": "XGIC_GITLAB_COMPOSE_FILE / --compose-file",
27
+ "gitlab_url": "GITLAB_URL / --url (no default host)",
28
+ "token": "GITLAB_TOKEN / --token (never logged)",
29
+ },
30
+ }
31
+ if getattr(args, "json", False):
32
+ print(json.dumps(payload, indent=2))
33
+ return 0
34
+
35
+ print_success(f"XGIC GitLab CLI {__version__} (experimental)")
36
+ print_info("Namespace: xgic.cli.gitlab")
37
+ print_info("Repo: https://github.com/xgic/gitlab-cli")
38
+ print_info("Commands: info, health, backup, restore")
39
+ print_info("Config via env/flags only — no private host defaults")
40
+ return 0
@@ -0,0 +1,108 @@
1
+ """``xgic gitlab restore`` — restore a GitLab EE backup (destructive)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import re
8
+ from typing import Any
9
+
10
+ from xgic.cli.gitlab.compose import ComposeRunner
11
+ from xgic.cli.gitlab.config import resolve_config
12
+ from xgic.cli.utils.output import print_error, print_info, print_success, print_warning
13
+
14
+ _BACKUP_ID_RE = re.compile(r"^[A-Za-z0-9._-]+$")
15
+
16
+
17
+ def run_restore(args: argparse.Namespace) -> int:
18
+ """Restore from a backup id via ``gitlab-backup restore`` in the EE container.
19
+
20
+ Destructive: requires ``--yes`` unless ``--dry-run``.
21
+ """
22
+ cfg = resolve_config(args)
23
+ backup_id = str(getattr(args, "backup_id", "") or "").strip()
24
+ yes = bool(getattr(args, "yes", False))
25
+
26
+ report: dict[str, Any] = {
27
+ "ok": False,
28
+ "action": "restore",
29
+ "config": cfg.public_dict(),
30
+ "backup_id": backup_id,
31
+ "detail": "",
32
+ }
33
+
34
+ if not backup_id or not _BACKUP_ID_RE.match(backup_id):
35
+ report["detail"] = (
36
+ "invalid or missing backup id (use alphanumeric, dot, underscore, hyphen)"
37
+ )
38
+ return _emit(args, report, 2)
39
+
40
+ if not yes and not cfg.dry_run:
41
+ report["detail"] = (
42
+ "refusing restore without --yes (destructive). "
43
+ "Re-run with --yes after confirming the backup id, or use --dry-run."
44
+ )
45
+ return _emit(args, report, 2)
46
+
47
+ runner = ComposeRunner(cfg)
48
+ if not runner.available():
49
+ report["detail"] = "docker CLI not found on PATH"
50
+ return _emit(args, report, 1)
51
+
52
+ running = runner.running_services()
53
+ if cfg.gitlab_service not in running:
54
+ report["detail"] = (
55
+ f"service {cfg.gitlab_service!r} is not running "
56
+ f"(running: {running or 'none'})"
57
+ )
58
+ return _emit(args, report, 1)
59
+
60
+ # Official Omnibus restore pattern (BACKUP= timestamp id without _gitlab_backup.tar).
61
+ shell_cmd = f"gitlab-backup restore BACKUP={backup_id} force=yes"
62
+ if cfg.dry_run:
63
+ report["ok"] = True
64
+ report["detail"] = (
65
+ f"dry-run: would exec in {cfg.gitlab_service}: {shell_cmd}"
66
+ )
67
+ return _emit(args, report, 0)
68
+
69
+ print_warning("Restore is destructive and will overwrite GitLab application data.")
70
+ print_info(f"Restoring backup id {backup_id!r} in {cfg.gitlab_service}…")
71
+ proc = runner.exec_service(
72
+ cfg.gitlab_service,
73
+ ["bash", "-lc", shell_cmd],
74
+ dry_run=False,
75
+ )
76
+ if proc is None:
77
+ report["detail"] = "exec did not run"
78
+ return _emit(args, report, 1)
79
+
80
+ report["returncode"] = proc.returncode
81
+ report["stdout_tail"] = (proc.stdout or "")[-2000:]
82
+ report["stderr_tail"] = (proc.stderr or "")[-2000:]
83
+ if proc.returncode == 0:
84
+ report["ok"] = True
85
+ report["detail"] = (
86
+ "restore completed; reconfigure/restart GitLab EE if your runbook requires it"
87
+ )
88
+ return _emit(args, report, 0)
89
+
90
+ report["detail"] = f"gitlab-backup restore failed (exit {proc.returncode})"
91
+ return _emit(args, report, proc.returncode or 1)
92
+
93
+
94
+ def _emit(args: argparse.Namespace, report: dict[str, Any], exit_code: int) -> int:
95
+ if getattr(args, "json", False):
96
+ print(json.dumps(report, indent=2))
97
+ return exit_code
98
+
99
+ if report["ok"]:
100
+ print_success(report["detail"] or "Restore OK")
101
+ else:
102
+ print_error(report["detail"] or "Restore failed")
103
+
104
+ print_info(f"Backup id: {report.get('backup_id')}")
105
+ print_info(f"Service: {report['config']['gitlab_service']}")
106
+ if report.get("stderr_tail"):
107
+ print_warning(report["stderr_tail"][:500])
108
+ return exit_code
@@ -0,0 +1,71 @@
1
+ """Thin Docker Compose runner for GitLab stack ops (stdlib only)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import shutil
6
+ import subprocess
7
+ from collections.abc import Sequence
8
+ from dataclasses import dataclass
9
+
10
+ from xgic.cli.gitlab.config import GitLabOpsConfig
11
+
12
+
13
+ @dataclass
14
+ class ComposeRunner:
15
+ """Run ``docker compose`` against the configured project."""
16
+
17
+ config: GitLabOpsConfig
18
+
19
+ def available(self) -> bool:
20
+ return shutil.which("docker") is not None
21
+
22
+ def base_cmd(self) -> list[str]:
23
+ return [
24
+ "docker",
25
+ "compose",
26
+ "-f",
27
+ self.config.compose_file,
28
+ "-p",
29
+ self.config.project_name,
30
+ ]
31
+
32
+ def run(
33
+ self,
34
+ *args: str,
35
+ check: bool = False,
36
+ capture: bool = True,
37
+ ) -> subprocess.CompletedProcess[str]:
38
+ cmd = [*self.base_cmd(), *args]
39
+ return subprocess.run(
40
+ cmd,
41
+ check=check,
42
+ capture_output=capture,
43
+ text=True,
44
+ )
45
+
46
+ def running_services(self) -> list[str]:
47
+ try:
48
+ result = self.run(
49
+ "ps",
50
+ "--services",
51
+ "--filter",
52
+ "status=running",
53
+ check=False,
54
+ )
55
+ except FileNotFoundError:
56
+ return []
57
+ if result.returncode != 0:
58
+ return []
59
+ return [line.strip() for line in result.stdout.splitlines() if line.strip()]
60
+
61
+ def exec_service(
62
+ self,
63
+ service: str,
64
+ command: Sequence[str],
65
+ *,
66
+ dry_run: bool = False,
67
+ ) -> subprocess.CompletedProcess[str] | None:
68
+ """``docker compose exec -T <service> <command…>``."""
69
+ if dry_run:
70
+ return None
71
+ return self.run("exec", "-T", service, *command, check=False)
@@ -0,0 +1,152 @@
1
+ """Public-safe GitLab ops configuration (env + flags; no private defaults)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import os
7
+ from dataclasses import dataclass
8
+
9
+ # Environment keys (operators set these; package never ships private hosts/tokens).
10
+ ENV_GITLAB_URL = "GITLAB_URL"
11
+ ENV_GITLAB_TOKEN = "GITLAB_TOKEN"
12
+ ENV_COMPOSE_FILE = "XGIC_GITLAB_COMPOSE_FILE"
13
+ ENV_COMPOSE_PROJECT = "XGIC_GITLAB_COMPOSE_PROJECT"
14
+ ENV_GITLAB_SERVICE = "XGIC_GITLAB_EE_SERVICE"
15
+ ENV_XGIC_SERVICE = "XGIC_GITLAB_ORCH_SERVICE"
16
+ ENV_BACKUP_DIR = "XGIC_GITLAB_BACKUP_DIR"
17
+
18
+ DEFAULT_COMPOSE_FILE = "docker-compose.yml"
19
+ DEFAULT_PROJECT_NAME = "xgic-gitlab"
20
+ DEFAULT_GITLAB_SERVICE = "gitlab-ee"
21
+ DEFAULT_XGIC_SERVICE = "xgic-gitlab"
22
+ DEFAULT_BACKUP_DIR = "./gitlab-backups"
23
+
24
+
25
+ @dataclass(frozen=True)
26
+ class GitLabOpsConfig:
27
+ """Resolved ops settings for Compose-based GitLab stacks."""
28
+
29
+ compose_file: str
30
+ project_name: str
31
+ gitlab_service: str
32
+ xgic_service: str
33
+ backup_dir: str
34
+ gitlab_url: str | None
35
+ token: str | None
36
+ dry_run: bool
37
+
38
+ def public_dict(self) -> dict[str, object]:
39
+ """Serializable view safe for logs/JSON (token redacted)."""
40
+ return {
41
+ "compose_file": self.compose_file,
42
+ "project_name": self.project_name,
43
+ "gitlab_service": self.gitlab_service,
44
+ "xgic_service": self.xgic_service,
45
+ "backup_dir": self.backup_dir,
46
+ "gitlab_url": self.gitlab_url,
47
+ "token_set": bool(self.token),
48
+ "dry_run": self.dry_run,
49
+ }
50
+
51
+
52
+ def _first(*values: str | None) -> str | None:
53
+ for v in values:
54
+ if v is not None and str(v).strip() != "":
55
+ return str(v).strip()
56
+ return None
57
+
58
+
59
+ def resolve_config(args: argparse.Namespace) -> GitLabOpsConfig:
60
+ """Build config from argparse namespace and process environment."""
61
+ return GitLabOpsConfig(
62
+ compose_file=_first(
63
+ getattr(args, "compose_file", None),
64
+ os.environ.get(ENV_COMPOSE_FILE),
65
+ )
66
+ or DEFAULT_COMPOSE_FILE,
67
+ project_name=_first(
68
+ getattr(args, "project", None),
69
+ os.environ.get(ENV_COMPOSE_PROJECT),
70
+ )
71
+ or DEFAULT_PROJECT_NAME,
72
+ gitlab_service=_first(
73
+ getattr(args, "gitlab_service", None),
74
+ os.environ.get(ENV_GITLAB_SERVICE),
75
+ )
76
+ or DEFAULT_GITLAB_SERVICE,
77
+ xgic_service=_first(
78
+ getattr(args, "xgic_service", None),
79
+ os.environ.get(ENV_XGIC_SERVICE),
80
+ )
81
+ or DEFAULT_XGIC_SERVICE,
82
+ backup_dir=_first(
83
+ getattr(args, "backup_dir", None),
84
+ os.environ.get(ENV_BACKUP_DIR),
85
+ )
86
+ or DEFAULT_BACKUP_DIR,
87
+ gitlab_url=_first(
88
+ getattr(args, "url", None),
89
+ os.environ.get(ENV_GITLAB_URL),
90
+ ),
91
+ token=_first(
92
+ getattr(args, "token", None),
93
+ os.environ.get(ENV_GITLAB_TOKEN),
94
+ ),
95
+ dry_run=bool(getattr(args, "dry_run", False)),
96
+ )
97
+
98
+
99
+ def add_common_ops_args(parser: argparse.ArgumentParser) -> None:
100
+ """Shared flags for health / backup / restore."""
101
+ parser.add_argument(
102
+ "--compose-file",
103
+ dest="compose_file",
104
+ default=None,
105
+ help=f"Compose file path (env {ENV_COMPOSE_FILE}; default {DEFAULT_COMPOSE_FILE})",
106
+ )
107
+ parser.add_argument(
108
+ "--project",
109
+ dest="project",
110
+ default=None,
111
+ help=f"Compose project name (env {ENV_COMPOSE_PROJECT}; default {DEFAULT_PROJECT_NAME})",
112
+ )
113
+ parser.add_argument(
114
+ "--gitlab-service",
115
+ dest="gitlab_service",
116
+ default=None,
117
+ help=f"GitLab EE service name (env {ENV_GITLAB_SERVICE}; default {DEFAULT_GITLAB_SERVICE})",
118
+ )
119
+ parser.add_argument(
120
+ "--xgic-service",
121
+ dest="xgic_service",
122
+ default=None,
123
+ help=f"Orchestration service name (env {ENV_XGIC_SERVICE}; default {DEFAULT_XGIC_SERVICE})",
124
+ )
125
+ parser.add_argument(
126
+ "--backup-dir",
127
+ dest="backup_dir",
128
+ default=None,
129
+ help=f"Host backup directory hint (env {ENV_BACKUP_DIR}; default {DEFAULT_BACKUP_DIR})",
130
+ )
131
+ parser.add_argument(
132
+ "--url",
133
+ dest="url",
134
+ default=None,
135
+ help=f"GitLab base URL for HTTP checks (env {ENV_GITLAB_URL}; no default host)",
136
+ )
137
+ parser.add_argument(
138
+ "--token",
139
+ dest="token",
140
+ default=None,
141
+ help=f"API token when needed (env {ENV_GITLAB_TOKEN}; never logged)",
142
+ )
143
+ parser.add_argument(
144
+ "--dry-run",
145
+ action="store_true",
146
+ help="Print planned actions without executing destructive or mutating steps",
147
+ )
148
+ parser.add_argument(
149
+ "--json",
150
+ action="store_true",
151
+ help="Emit machine-readable JSON",
152
+ )
@@ -0,0 +1,77 @@
1
+ """Register ``xgic.cli.gitlab`` subcommands on the core ``xgic`` CLI.
2
+
3
+ All product commands live under the ``gitlab`` group for domain ownership::
4
+
5
+ xgic gitlab info
6
+ xgic gitlab health
7
+ xgic gitlab backup
8
+ xgic gitlab restore
9
+ xgic gitlab --help
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import argparse
15
+
16
+ from xgic.cli.gitlab.commands.backup import run_backup
17
+ from xgic.cli.gitlab.commands.health import run_health
18
+ from xgic.cli.gitlab.commands.info import run_info
19
+ from xgic.cli.gitlab.commands.restore import run_restore
20
+ from xgic.cli.gitlab.config import add_common_ops_args
21
+
22
+
23
+ def register(
24
+ subparsers: argparse._SubParsersAction[argparse.ArgumentParser],
25
+ ) -> None:
26
+ """Entry point: ``xgic.cli.commands`` → GitLab product commands."""
27
+ gitlab = subparsers.add_parser(
28
+ "gitlab",
29
+ help="GitLab product commands",
30
+ )
31
+ gitlab_sub = gitlab.add_subparsers(
32
+ dest="gitlab_command",
33
+ help="GitLab action",
34
+ metavar="ACTION",
35
+ required=True,
36
+ )
37
+
38
+ info = gitlab_sub.add_parser(
39
+ "info",
40
+ help="Show GitLab CLI module version and status",
41
+ )
42
+ info.add_argument(
43
+ "--json",
44
+ action="store_true",
45
+ help="Output as JSON",
46
+ )
47
+ info.set_defaults(func=run_info)
48
+
49
+ health = gitlab_sub.add_parser(
50
+ "health",
51
+ help="Check Compose services and optional GitLab HTTP health",
52
+ )
53
+ add_common_ops_args(health)
54
+ health.set_defaults(func=run_health)
55
+
56
+ backup = gitlab_sub.add_parser(
57
+ "backup",
58
+ help="Create a GitLab EE backup (docker compose exec gitlab-backup create)",
59
+ )
60
+ add_common_ops_args(backup)
61
+ backup.set_defaults(func=run_backup)
62
+
63
+ restore = gitlab_sub.add_parser(
64
+ "restore",
65
+ help="Restore a GitLab EE backup (destructive; requires --yes)",
66
+ )
67
+ restore.add_argument(
68
+ "backup_id",
69
+ help="Backup id (timestamp prefix; not the full tar filename)",
70
+ )
71
+ restore.add_argument(
72
+ "--yes",
73
+ action="store_true",
74
+ help="Confirm destructive restore",
75
+ )
76
+ add_common_ops_args(restore)
77
+ restore.set_defaults(func=run_restore)
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.5
2
+ Name: xgic-gitlab-cli
3
+ Version: 0.1.1
4
+ Summary: XGIC CLI GitLab module - GitLab ops commands and helpers (xgic.cli.gitlab).
5
+ Project-URL: Homepage, https://github.com/xgic/gitlab-cli
6
+ Project-URL: Repository, https://github.com/xgic/gitlab-cli
7
+ Project-URL: Issues, https://github.com/xgic/gitlab-cli/issues
8
+ Project-URL: Documentation, https://github.com/xgic/gitlab-cli#readme
9
+ Project-URL: Changelog, https://github.com/xgic/gitlab-cli/releases
10
+ Author: XGIC
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ License-File: NOTICE
14
+ Keywords: cli,gitlab,orchestration,xgic
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Environment :: Console
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: Apache Software License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.14
25
+ Requires-Dist: rich>=13.7
26
+ Requires-Dist: xgic-cli>=0.2.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
29
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
30
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
31
+ Provides-Extra: graphql
32
+ Requires-Dist: xgic-gitlab-graphql>=0.1.0; extra == 'graphql'
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest>=8.0.0; extra == 'test'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # XGIC GitLab CLI
38
+
39
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
40
+ [![CI](https://github.com/xgic/gitlab-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/xgic/gitlab-cli/actions/workflows/ci.yml)
41
+ [![Python](https://img.shields.io/badge/python-3.14+-blue?logo=python&logoColor=white)](https://www.python.org/)
42
+
43
+ **GitLab product commands for the modular [XGIC CLI](https://github.com/xgic/cli)—ops under
44
+ `xgic gitlab …`.**
45
+
46
+ Namespace: **`xgic.cli.gitlab`** · Console group: **`xgic gitlab …`** · Brand: **XGIC CLI only**
47
+ ([ADR-0005](https://github.com/xgic/ai/blob/main/docs/adr/0005-modular-xgic-cli-and-retirement-of-xde.md))
48
+
49
+ Standards hub: [xgic/ai](https://github.com/xgic/ai) ·
50
+ [README standards](https://github.com/xgic/ai/blob/main/docs/readme-standards.md)
51
+
52
+ ---
53
+
54
+ ## Vision
55
+
56
+ Self-managed GitLab operators need a **stable, public-safe command surface** for versioned ops—
57
+ not a grab bag of one-off scripts. This module owns the **GitLab product** namespace under `xgic`.
58
+ The GraphQL client library lives in [gitlab-graphql](https://github.com/xgic/gitlab-graphql);
59
+ the Compose **template** and orchestration **image producer** live in
60
+ [gitlab](https://github.com/xgic/gitlab) and [gitlab-dev](https://github.com/xgic/gitlab-dev).
61
+
62
+ One brand (`xgic`), clear ownership, and no private hosts or tracker IDs in the package.
63
+
64
+ ---
65
+
66
+ ## Why this module exists
67
+
68
+ | Benefit | Detail |
69
+ |---------|--------|
70
+ | **Domain clarity** | Nested under `xgic gitlab`—no clash with core or Payload commands |
71
+ | **Composable stack** | Depends on `xgic-cli`; optional GraphQL extra when automation lands |
72
+ | **Public-safe by design** | Endpoints via env/flags—never hard-coded private inventory |
73
+ | **AI + human parity** | Same command map in README and [AGENTS.md](AGENTS.md) |
74
+ | **Open-source rigor** | Apache-2.0, Python 3.14+, RC → TestPyPI → PyPI |
75
+
76
+ ---
77
+
78
+ ## Ecosystem
79
+
80
+ | Package / repo | Role |
81
+ |----------------|------|
82
+ | [xgic/cli](https://github.com/xgic/cli) | Thin core framework (`xgic`) |
83
+ | [xgic/gitlab-graphql](https://github.com/xgic/gitlab-graphql) | GraphQL client library |
84
+ | **This repo** | GitLab product module (`xgic.cli.gitlab`) |
85
+ | [xgic/gitlab-dev](https://github.com/xgic/gitlab-dev) | Orchestration image **producer** (`ghcr.io/xgic/xgic-gitlab`) |
86
+ | [xgic/gitlab](https://github.com/xgic/gitlab) | End-user Docker Compose **template** |
87
+
88
+ Architecture: [ADR-0001](https://github.com/xgic/ai/blob/main/docs/adr/0001-xgic-gitlab-architecture-and-repository-naming.md)
89
+ · [ADR-0005](https://github.com/xgic/ai/blob/main/docs/adr/0005-modular-xgic-cli-and-retirement-of-xde.md).
90
+
91
+ ---
92
+
93
+ ## Quick start
94
+
95
+ ### Development (editable) — current primary path
96
+
97
+ ```bash
98
+ uv pip install -e ../cli
99
+ uv pip install -e ".[dev]"
100
+ xgic gitlab --help
101
+ xgic gitlab info
102
+ ```
103
+
104
+ Optional GraphQL extra (when GraphQL-backed commands ship):
105
+
106
+ ```bash
107
+ uv pip install -e ".[graphql]"
108
+ ```
109
+
110
+ ### Install (PyPI)
111
+
112
+ PyPI publish follows the hub
113
+ [python-package-release.md](https://github.com/xgic/ai/blob/main/docs/python-package-release.md)
114
+ path (RC → TestPyPI → PyPI). Until the first release is published:
115
+
116
+ ```bash
117
+ # After first PyPI release:
118
+ uv pip install "xgic-cli>=0.2.0" "xgic-gitlab-cli"
119
+ xgic gitlab --help
120
+ ```
121
+
122
+ ### Requirements
123
+
124
+ - Python **3.14+**
125
+ - `xgic-cli` ≥ 0.2.0
126
+ - Docker / Docker Compose for stack ops (`health` / `backup` / `restore`)
127
+
128
+ ---
129
+
130
+ ## Console commands
131
+
132
+ All product commands nest under **`xgic gitlab`**:
133
+
134
+ | Command | Purpose |
135
+ |---------|---------|
136
+ | `xgic gitlab info` | Module version and status (`--json` supported) |
137
+ | `xgic gitlab health` | Compose service checks + optional HTTP `/-/health` |
138
+ | `xgic gitlab backup` | `gitlab-backup create` via `docker compose exec` |
139
+ | `xgic gitlab restore <id>` | Destructive restore (`--yes` required; prefer `--dry-run` first) |
140
+
141
+ ### Configuration (no private host defaults)
142
+
143
+ | Setting | Flag | Environment |
144
+ |---------|------|-------------|
145
+ | Compose file | `--compose-file` | `XGIC_GITLAB_COMPOSE_FILE` (default `docker-compose.yml`) |
146
+ | Project name | `--project` | `XGIC_GITLAB_COMPOSE_PROJECT` (default `xgic-gitlab`) |
147
+ | GitLab EE service | `--gitlab-service` | `XGIC_GITLAB_EE_SERVICE` (default `gitlab-ee`) |
148
+ | Orchestration service | `--xgic-service` | `XGIC_GITLAB_ORCH_SERVICE` (default `xgic-gitlab`) |
149
+ | Backup dir hint | `--backup-dir` | `XGIC_GITLAB_BACKUP_DIR` |
150
+ | GitLab URL | `--url` | `GITLAB_URL` (**no default**) |
151
+ | Token | `--token` | `GITLAB_TOKEN` (never logged) |
152
+
153
+ Shared: `--dry-run`, `--json`.
154
+
155
+ ### Examples
156
+
157
+ ```bash
158
+ # From a checked-out xgic/gitlab template directory
159
+ export GITLAB_URL=http://localhost:8929
160
+ xgic gitlab health --json
161
+ xgic gitlab backup --dry-run
162
+ xgic gitlab restore 20240101_1200 --dry-run
163
+ # after confirmation:
164
+ xgic gitlab restore 20240101_1200 --yes
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Status
170
+
171
+ **0.1.1 — experimental.** Nested `xgic gitlab` commands: `info`, `health`, `backup`, `restore` against
172
+ Docker Compose stacks (typically [xgic/gitlab](https://github.com/xgic/gitlab)).
173
+
174
+ ---
175
+
176
+ ## AI agent guidance
177
+
178
+ - Use **`xgic gitlab …`** for product ops; do not hardcode private GitLab hostnames in public
179
+ artifacts or committed examples.
180
+ - Prefer **fictional placeholders** (`https://gitlab.example.com`) in docs and tests.
181
+ - Destructive restore always needs **`--yes`**; start with **`--dry-run`**.
182
+ - Follow hub
183
+ [public-safe](https://github.com/xgic/ai/blob/main/docs/BASE-STANDARDS-FOR-ORCHESTRATED-REPOS.md)
184
+ rules before any public GitHub write.
185
+
186
+ ---
187
+
188
+ ## Public safety
189
+
190
+ This package is **public-safe only**. Do not hardcode private GitLab hosts, internal inventory, or
191
+ private tracker IDs. Operators configure endpoints via environment / flags.
192
+
193
+ ---
194
+
195
+ ## Publishing
196
+
197
+ Follow
198
+ [python-package-release.md](https://github.com/xgic/ai/blob/main/docs/python-package-release.md)
199
+ (publish **after** `xgic-cli` for stack releases). Tags: `vX.Y.ZrcN` → TestPyPI; `vX.Y.Z` → PyPI.
200
+
201
+ ---
202
+
203
+ ## License
204
+
205
+ Apache License 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
206
+ Copyright form: `Copyright 2026 XGIC`.
@@ -0,0 +1,15 @@
1
+ xgic/cli/gitlab/__init__.py,sha256=u_Vi3HUKvlPXr5z_OEN96NWBdizeCptNGz2Dgd29KxY,102
2
+ xgic/cli/gitlab/compose.py,sha256=bb-ZFjrEO9y_Hrzbt2LZuqXMCBV4iNk1emWAtzROhOo,1834
3
+ xgic/cli/gitlab/config.py,sha256=4yzCKhWnSpVkyavQXjZ9HUPIgyUhBc8y8UOL-VBqJG0,4803
4
+ xgic/cli/gitlab/plugin.py,sha256=HFi8KUSook9UnYjiGLXgg7t1iOEtzzKsENazIiEclvU,2161
5
+ xgic/cli/gitlab/commands/__init__.py,sha256=OpMcBC9eWBwov9CMkhsxNVDwblOvM4eX0c01pJGcvNw,35
6
+ xgic/cli/gitlab/commands/backup.py,sha256=QDmzFpgnq935i_OO6EopoatxFaeBS-n88eK1TyZNvHc,2941
7
+ xgic/cli/gitlab/commands/health.py,sha256=HAuLQrrjI49V0m3GR5ml0olRUbbJRgphtOn25uw4Q0A,5232
8
+ xgic/cli/gitlab/commands/info.py,sha256=tKyP-MlvlhppYARknMDKtRwjGL-kSYncinOwg9EqpsM,1402
9
+ xgic/cli/gitlab/commands/restore.py,sha256=K6y6s_IViFgr6imzdedbSKkJF907kxbMs6ThEO7B8pI,3683
10
+ xgic_gitlab_cli-0.1.1.dist-info/METADATA,sha256=gVcgXIWMg2h-5L30foWlliaH3kl9cs2z_PWRCPHREws,7479
11
+ xgic_gitlab_cli-0.1.1.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
12
+ xgic_gitlab_cli-0.1.1.dist-info/entry_points.txt,sha256=PpbKNTue84VAwrvDrkjfXaccDjBRpT19SQb2YCIjNTk,61
13
+ xgic_gitlab_cli-0.1.1.dist-info/licenses/LICENSE,sha256=zR7vJ5cGf_9LgWHYDAugptsXPsV0_78I9kvVnf7VRk0,11335
14
+ xgic_gitlab_cli-0.1.1.dist-info/licenses/NOTICE,sha256=u_0eKm5vtkPsSwUiJWQMqew39u_CfG7VEa8nobed68Y,207
15
+ xgic_gitlab_cli-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [xgic.cli.commands]
2
+ gitlab = xgic.cli.gitlab.plugin:register
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 XGIC
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
@@ -0,0 +1,8 @@
1
+ XGIC GitLab CLI
2
+ Copyright 2026 XGIC
3
+
4
+ This product includes software and documentation developed at XGIC
5
+ (https://xgic.net).
6
+
7
+ Licensed under the Apache License, Version 2.0.
8
+ See the LICENSE file for details.