@gaodes/pi-gitlab 0.3.0 → 0.4.2

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.
Files changed (48) hide show
  1. package/.primecodex.json +3 -3
  2. package/CHANGELOG.md +40 -1
  3. package/README.md +4 -4
  4. package/package.json +1 -1
  5. package/skills/gitlab-assistant/SKILL.md +1 -1
  6. package/skills/gitlab-badge/SKILL.md +77 -0
  7. package/skills/gitlab-ci/SKILL.md +69 -0
  8. package/skills/gitlab-container/SKILL.md +67 -0
  9. package/skills/gitlab-discussion/SKILL.md +97 -0
  10. package/skills/gitlab-file/SKILL.md +86 -0
  11. package/skills/gitlab-group/SKILL.md +92 -0
  12. package/skills/gitlab-label/SKILL.md +64 -0
  13. package/skills/gitlab-milestone/SKILL.md +68 -0
  14. package/skills/gitlab-protected-branch/SKILL.md +61 -0
  15. package/skills/gitlab-release/SKILL.md +1 -1
  16. package/skills/gitlab-repo/SKILL.md +72 -0
  17. package/skills/gitlab-search/SKILL.md +47 -0
  18. package/skills/gitlab-variable/SKILL.md +69 -0
  19. package/skills/gitlab-vulnerability/SKILL.md +74 -0
  20. package/skills/gitlab-webhook/SKILL.md +79 -0
  21. package/skills/gitlab-wiki/SKILL.md +70 -0
  22. package/skills/gitlab-workflow/SKILL.md +1 -1
  23. package/src/commands/gitlab-doctor.ts +12 -4
  24. package/src/config/loader.ts +13 -1
  25. package/src/config/types.ts +4 -4
  26. package/src/index.ts +14 -1
  27. package/src/lib/env.ts +2 -3
  28. package/src/lib/projectCache.ts +17 -1
  29. package/src/lib/schemas.ts +1 -1
  30. package/src/tools/gitlab_ci_lint.ts +138 -0
  31. package/src/tools/gitlab_force_push_safe.ts +18 -10
  32. package/src/tools/gitlab_issue_close.ts +16 -4
  33. package/src/tools/gitlab_issue_create.ts +19 -5
  34. package/src/tools/gitlab_issue_list.ts +5 -5
  35. package/src/tools/gitlab_job_logs.ts +5 -5
  36. package/src/tools/gitlab_mr_bulk_approve.ts +4 -2
  37. package/src/tools/gitlab_mr_create.ts +1 -1
  38. package/src/tools/gitlab_mr_list.ts +5 -5
  39. package/src/tools/gitlab_mr_merge.ts +2 -4
  40. package/src/tools/gitlab_mr_view.ts +5 -5
  41. package/src/tools/gitlab_pipeline_run.ts +29 -10
  42. package/src/tools/gitlab_pipeline_status.ts +5 -5
  43. package/src/tools/gitlab_project_resolve.ts +5 -5
  44. package/src/tools/gitlab_release_create.ts +2 -3
  45. package/src/tools/gitlab_release_list.ts +4 -9
  46. package/src/tools/gitlab_release_view.ts +8 -3
  47. package/src/tools/gitlab_repo_view.ts +116 -0
  48. package/src/tools/gitlab_search_query.ts +221 -0
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: gitlab-milestone
3
+ description: >
4
+ GitLab milestone management using the glab CLI and API. Use for
5
+ listing, creating, and managing project milestones and sprints.
6
+ ---
7
+
8
+ # GitLab Milestone Skill
9
+
10
+ ## Patterns
11
+
12
+ ### List milestones
13
+ ```bash
14
+ glab milestone list
15
+ ```
16
+
17
+ ### Create a milestone
18
+ ```bash
19
+ glab milestone create "v1.0" -d "First stable release"
20
+ ```
21
+
22
+ ### List milestones via API (structured)
23
+ ```
24
+ gitlab_api({ endpoint: "projects/:project/milestones", project: "namespace/project" })
25
+ ```
26
+
27
+ ### Create milestone via API
28
+ ```
29
+ gitlab_api({
30
+ endpoint: "projects/:project/milestones",
31
+ project: "namespace/project",
32
+ method: "POST",
33
+ body: {
34
+ title: "v1.0",
35
+ description: "First stable release",
36
+ due_date: "2026-06-30"
37
+ },
38
+ confirm: true
39
+ })
40
+ ```
41
+
42
+ ### Update a milestone
43
+ ```
44
+ gitlab_api({
45
+ endpoint: "projects/:project/milestones/:milestone_id",
46
+ project: "namespace/project",
47
+ method: "PUT",
48
+ body: { state_event: "close" },
49
+ confirm: true
50
+ })
51
+ ```
52
+
53
+ ### Delete a milestone
54
+ ```
55
+ gitlab_api({
56
+ endpoint: "projects/:project/milestones/:milestone_id",
57
+ project: "namespace/project",
58
+ method: "DELETE",
59
+ confirm: true
60
+ })
61
+ ```
62
+
63
+ ## Rules
64
+
65
+ - All mutating operations require `confirm: true`.
66
+ - Use milestone IDs (numeric) for update and delete operations.
67
+ - Milestones are project-scoped; group milestones use the group API endpoint.
68
+ - For assigning milestones to issues, use `gitlab-issue` skill.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: gitlab-protected-branch
3
+ description: >
4
+ GitLab protected branch management via API. Use for viewing branch
5
+ protection rules, protecting and unprotecting branches, and
6
+ configuring push and merge access levels.
7
+ ---
8
+
9
+ # GitLab Protected Branch Skill
10
+
11
+ ## Patterns
12
+
13
+ ### List protected branches
14
+ ```
15
+ gitlab_api({ endpoint: "projects/:project/protected_branches", project: "namespace/project" })
16
+ ```
17
+
18
+ ### Get protection details for a branch
19
+ ```
20
+ gitlab_api({ endpoint: "projects/:project/protected_branches/:branch_name", project: "namespace/project" })
21
+ ```
22
+
23
+ ### Protect a branch
24
+ ```
25
+ gitlab_api({
26
+ endpoint: "projects/:project/protected_branches",
27
+ project: "namespace/project",
28
+ method: "POST",
29
+ body: { name: "main", push_access_level: 40, merge_access_level: 40 },
30
+ confirm: true
31
+ })
32
+ ```
33
+
34
+ ### Update protection (allow force push)
35
+ ```
36
+ gitlab_api({
37
+ endpoint: "projects/:project/protected_branches/:branch_name",
38
+ project: "namespace/project",
39
+ method: "PATCH",
40
+ body: { allow_force_push: true },
41
+ confirm: true
42
+ })
43
+ ```
44
+
45
+ ### Unprotect a branch
46
+ ```
47
+ gitlab_api({
48
+ endpoint: "projects/:project/protected_branches/:branch_name",
49
+ project: "namespace/project",
50
+ method: "DELETE",
51
+ confirm: true
52
+ })
53
+ ```
54
+
55
+ ## Rules
56
+
57
+ - All mutating operations require `confirm: true`.
58
+ - Access levels: 0 = No access, 30 = Developer, 40 = Maintainer, 60 = Admin.
59
+ - Code owner approval requires GitLab Premium.
60
+ - The `gitlab_force_push_safe` tool handles the full protection lifecycle for safe force pushes.
61
+ - Use this skill for general protection management; use `gitlab_force_push_safe` for force-push workflows.
@@ -2,7 +2,7 @@
2
2
  name: gitlab-release
3
3
  description: >
4
4
  GitLab release management. Use for listing, viewing, and creating
5
- releases tied to Git tags on gitlab.elches.dev. Requires glab and
5
+ releases tied to Git tags on the configured GitLab instance. Requires glab and
6
6
  confirm for mutating operations.
7
7
  ---
8
8
 
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: gitlab-repo
3
+ description: >
4
+ GitLab repository and project operations. Use for cloning, forking,
5
+ viewing project info, creating repositories, and managing project
6
+ settings.
7
+ ---
8
+
9
+ # GitLab Repository Skill
10
+
11
+ ## Patterns
12
+
13
+ ### View project info (structured tool)
14
+ ```
15
+ gitlab_repo_view({ project: "namespace/project" })
16
+ ```
17
+
18
+ ### Clone a repository
19
+ ```bash
20
+ glab repo clone namespace/project
21
+ ```
22
+
23
+ ### Fork a project
24
+ ```bash
25
+ glab repo fork namespace/project
26
+ ```
27
+
28
+ ### View repo in browser
29
+ ```bash
30
+ glab repo view -w
31
+ ```
32
+
33
+ ### Create a new project
34
+ ```bash
35
+ glab repo create my-project -d "Project description"
36
+ ```
37
+
38
+ ### Search repos
39
+ ```bash
40
+ glab repo search "search term"
41
+ ```
42
+
43
+ ### Archive a project
44
+ ```
45
+ gitlab_api({
46
+ endpoint: "projects/:project/archive",
47
+ project: "namespace/project",
48
+ method: "POST",
49
+ confirm: true
50
+ })
51
+ ```
52
+
53
+ ### Delete a project
54
+ ```
55
+ gitlab_api({
56
+ endpoint: "projects/:project",
57
+ project: "namespace/project",
58
+ method: "DELETE",
59
+ confirm: true
60
+ })
61
+ ```
62
+
63
+ ### List contributors
64
+ ```bash
65
+ glab repo contributors
66
+ ```
67
+
68
+ ## Rules
69
+
70
+ - Use `gitlab_repo_view` for structured project metadata; use `glab repo view` for terminal display.
71
+ - Fork and clone are safe operations; archive and delete require `confirm: true`.
72
+ - Deleting a project is **irreversible** — always confirm explicitly.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: gitlab-search
3
+ description: >
4
+ GitLab search across projects, issues, merge requests, code, commits,
5
+ users, and wiki content. Use for finding resources globally, within a
6
+ group, or within a project.
7
+ ---
8
+
9
+ # GitLab Search Skill
10
+
11
+ ## Patterns
12
+
13
+ ### Global search (all scopes)
14
+ ```
15
+ gitlab_search_query({ query: "search term" })
16
+ ```
17
+
18
+ ### Search within a project
19
+ ```
20
+ gitlab_search_query({ query: "search term", project: "namespace/project", scope: "blobs" })
21
+ ```
22
+
23
+ ### Search within a group
24
+ ```
25
+ gitlab_search_query({ query: "search term", group: "group-id", scope: "issues" })
26
+ ```
27
+
28
+ ### Search specific scope via API
29
+ ```
30
+ gitlab_api({ endpoint: "search", query: { scope: "projects", search: "pi-gitlab" } })
31
+ ```
32
+
33
+ ### Project-level code search
34
+ ```
35
+ gitlab_api({
36
+ endpoint: "projects/:project/search",
37
+ project: "namespace/project",
38
+ query: { scope: "blobs", search: "function pattern" }
39
+ })
40
+ ```
41
+
42
+ ## Rules
43
+
44
+ - Prefer `gitlab_search_query` for structured search results with automatic pagination.
45
+ - Available scopes: `projects`, `issues`, `merge_requests`, `milestones`, `blobs`, `commits`, `users`, `wiki_blobs`.
46
+ - Search results are limited to resources the authenticated user can access.
47
+ - For listing all items with known filters, prefer dedicated tools (`gitlab_issue_list`, `gitlab_mr_list`) over search.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: gitlab-variable
3
+ description: >
4
+ GitLab CI/CD variable management using the glab CLI. Use for listing,
5
+ creating, updating, and deleting project and group CI/CD variables.
6
+ ---
7
+
8
+ # GitLab CI/CD Variable Skill
9
+
10
+ ## Patterns
11
+
12
+ ### List project variables
13
+ ```bash
14
+ glab variable list
15
+ ```
16
+
17
+ ### List group variables
18
+ ```bash
19
+ glab variable list -g mygroup
20
+ ```
21
+
22
+ ### Get a variable value
23
+ ```bash
24
+ glab variable get VARIABLE_KEY
25
+ ```
26
+
27
+ ### Set a variable
28
+ ```bash
29
+ glab variable set DEPLOY_KEY "secret-value" --masked
30
+ ```
31
+
32
+ ### Update a variable
33
+ ```bash
34
+ glab variable update VARIABLE_KEY "new-value"
35
+ ```
36
+
37
+ ### Delete a variable
38
+ ```bash
39
+ glab variable delete VARIABLE_KEY
40
+ ```
41
+
42
+ ### Export variables
43
+ ```bash
44
+ glab variable export
45
+ ```
46
+
47
+ ### List variables via API (structured)
48
+ ```
49
+ gitlab_api({ endpoint: "projects/:project/variables", project: "namespace/project" })
50
+ ```
51
+
52
+ ### Create variable via API
53
+ ```
54
+ gitlab_api({
55
+ endpoint: "projects/:project/variables",
56
+ project: "namespace/project",
57
+ method: "POST",
58
+ body: { key: "DEPLOY_KEY", value: "secret-value", masked: true },
59
+ confirm: true
60
+ })
61
+ ```
62
+
63
+ ## Rules
64
+
65
+ - Masked variables hide values in job logs.
66
+ - Protected variables only apply to protected branches/tags.
67
+ - Environment-scoped variables use `environment_scope` parameter.
68
+ - All mutating operations require `confirm: true`.
69
+ - Never log or display variable values in plain text.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: gitlab-vulnerability
3
+ description: >
4
+ GitLab security vulnerability management via API. Use for listing
5
+ vulnerabilities, viewing details, confirming, dismissing, or resolving
6
+ security findings.
7
+ ---
8
+
9
+ # GitLab Vulnerability Skill
10
+
11
+ ## Patterns
12
+
13
+ ### List vulnerabilities
14
+ ```
15
+ gitlab_api({ endpoint: "projects/:project/vulnerabilities", project: "namespace/project" })
16
+ ```
17
+
18
+ ### Get vulnerability details
19
+ ```
20
+ gitlab_api({ endpoint: "projects/:project/vulnerabilities/:vuln_id", project: "namespace/project" })
21
+ ```
22
+
23
+ ### Confirm a vulnerability
24
+ ```
25
+ gitlab_api({
26
+ endpoint: "projects/:project/vulnerabilities/:vuln_id/confirm",
27
+ project: "namespace/project",
28
+ method: "POST",
29
+ confirm: true
30
+ })
31
+ ```
32
+
33
+ ### Dismiss a vulnerability
34
+ ```
35
+ gitlab_api({
36
+ endpoint: "projects/:project/vulnerabilities/:vuln_id/dismiss",
37
+ project: "namespace/project",
38
+ method: "POST",
39
+ body: { comment: "False positive - not applicable" },
40
+ confirm: true
41
+ })
42
+ ```
43
+
44
+ ### Resolve a vulnerability
45
+ ```
46
+ gitlab_api({
47
+ endpoint: "projects/:project/vulnerabilities/:vuln_id/resolve",
48
+ project: "namespace/project",
49
+ method: "POST",
50
+ confirm: true
51
+ })
52
+ ```
53
+
54
+ ### Revert to detected state
55
+ ```
56
+ gitlab_api({
57
+ endpoint: "projects/:project/vulnerabilities/:vuln_id/revert",
58
+ project: "namespace/project",
59
+ method: "POST",
60
+ confirm: true
61
+ })
62
+ ```
63
+
64
+ ### List vulnerability findings
65
+ ```
66
+ gitlab_api({ endpoint: "projects/:project/vulnerability_findings", project: "namespace/project" })
67
+ ```
68
+
69
+ ## Rules
70
+
71
+ - Full vulnerability management requires GitLab Ultimate tier.
72
+ - Vulnerability states: `detected`, `confirmed`, `dismissed`, `resolved`.
73
+ - All state-change operations require `confirm: true`.
74
+ - For running security scans, use the `gitlab-ci` skill (SAST, DAST jobs).
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: gitlab-webhook
3
+ description: >
4
+ GitLab webhook management via API. Use for listing, creating, updating,
5
+ and deleting project and group webhooks, and testing webhook delivery.
6
+ ---
7
+
8
+ # GitLab Webhook Skill
9
+
10
+ ## Patterns
11
+
12
+ ### List project webhooks
13
+ ```
14
+ gitlab_api({ endpoint: "projects/:project/hooks", project: "namespace/project" })
15
+ ```
16
+
17
+ ### Get webhook details
18
+ ```
19
+ gitlab_api({ endpoint: "projects/:project/hooks/:hook_id", project: "namespace/project" })
20
+ ```
21
+
22
+ ### Create a webhook
23
+ ```
24
+ gitlab_api({
25
+ endpoint: "projects/:project/hooks",
26
+ project: "namespace/project",
27
+ method: "POST",
28
+ body: {
29
+ url: "https://example.com/hook",
30
+ push_events: true,
31
+ merge_requests_events: true
32
+ },
33
+ confirm: true
34
+ })
35
+ ```
36
+
37
+ ### Update a webhook
38
+ ```
39
+ gitlab_api({
40
+ endpoint: "projects/:project/hooks/:hook_id",
41
+ project: "namespace/project",
42
+ method: "PUT",
43
+ body: { push_events: false, tag_push_events: true },
44
+ confirm: true
45
+ })
46
+ ```
47
+
48
+ ### Delete a webhook
49
+ ```
50
+ gitlab_api({
51
+ endpoint: "projects/:project/hooks/:hook_id",
52
+ project: "namespace/project",
53
+ method: "DELETE",
54
+ confirm: true
55
+ })
56
+ ```
57
+
58
+ ### Test webhook delivery
59
+ ```
60
+ gitlab_api({
61
+ endpoint: "projects/:project/hooks/:hook_id/test/push",
62
+ project: "namespace/project",
63
+ method: "POST",
64
+ confirm: true
65
+ })
66
+ ```
67
+
68
+ ### List group webhooks
69
+ ```
70
+ gitlab_api({ endpoint: "groups/:group_id/hooks" })
71
+ ```
72
+
73
+ ## Rules
74
+
75
+ - All mutating operations require `confirm: true`.
76
+ - Webhook URLs must use HTTPS in production.
77
+ - Available event triggers for testing: `push`, `tag_push`, `issues`, `merge_requests`, `wiki_page`.
78
+ - Hook IDs are numeric; list webhooks first to find the ID.
79
+ - Secret tokens are returned only on creation; store them securely.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: gitlab-wiki
3
+ description: >
4
+ GitLab wiki page management via API. Use for listing, reading, creating,
5
+ updating, and deleting wiki pages, and uploading attachments.
6
+ ---
7
+
8
+ # GitLab Wiki Skill
9
+
10
+ ## Patterns
11
+
12
+ ### List wiki pages
13
+ ```
14
+ gitlab_api({ endpoint: "projects/:project/wikis", project: "namespace/project" })
15
+ ```
16
+
17
+ ### Get a wiki page
18
+ ```
19
+ gitlab_api({ endpoint: "projects/:project/wikis/:slug", project: "namespace/project" })
20
+ ```
21
+
22
+ ### Create a wiki page
23
+ ```
24
+ gitlab_api({
25
+ endpoint: "projects/:project/wikis",
26
+ project: "namespace/project",
27
+ method: "POST",
28
+ body: { title: "Architecture Overview", content: "# Architecture\n\n..." },
29
+ confirm: true
30
+ })
31
+ ```
32
+
33
+ ### Update a wiki page
34
+ ```
35
+ gitlab_api({
36
+ endpoint: "projects/:project/wikis/:slug",
37
+ project: "namespace/project",
38
+ method: "PUT",
39
+ body: { content: "# Updated Architecture\n\n..." },
40
+ confirm: true
41
+ })
42
+ ```
43
+
44
+ ### Delete a wiki page
45
+ ```
46
+ gitlab_api({
47
+ endpoint: "projects/:project/wikis/:slug",
48
+ project: "namespace/project",
49
+ method: "DELETE",
50
+ confirm: true
51
+ })
52
+ ```
53
+
54
+ ### Upload a wiki attachment
55
+ ```
56
+ gitlab_api({
57
+ endpoint: "projects/:project/wikis/attachments",
58
+ project: "namespace/project",
59
+ method: "POST",
60
+ body: { file: "path/to/file", branch: "main" },
61
+ confirm: true
62
+ })
63
+ ```
64
+
65
+ ## Rules
66
+
67
+ - All mutating operations require `confirm: true`.
68
+ - Wiki slugs are URL-friendly versions of the title (e.g. "Architecture Overview" → "architecture-overview").
69
+ - Wiki content supports Markdown and RDoc formats.
70
+ - Use `format` field to specify content format: `markdown` (default), `rdoc`, or `asciidoc`.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: gitlab-workflow
3
3
  description: >
4
- Cross-domain GitLab workflow orchestration on gitlab.elches.dev.
4
+ Cross-domain GitLab workflow orchestration on the configured GitLab instance.
5
5
  Combines tools into multi-step flows like release cut, hotfix, and
6
6
  issue-to-MR pipelines. Routes to focused skills for individual steps.
7
7
  ---
@@ -32,7 +32,10 @@ function versionSatisfies(installed: string, required: string): boolean {
32
32
  return patI >= patR;
33
33
  }
34
34
 
35
- export async function runDoctor(pi: ExtensionAPI, cwd?: string): Promise<Check[]> {
35
+ export async function runDoctor(
36
+ pi: ExtensionAPI,
37
+ cwd?: string,
38
+ ): Promise<Check[]> {
36
39
  const checks: Check[] = [];
37
40
 
38
41
  try {
@@ -59,7 +62,8 @@ export async function runDoctor(pi: ExtensionAPI, cwd?: string): Promise<Check[]
59
62
  checks.push({
60
63
  label: "glab CLI",
61
64
  status: "fail",
62
- detail: "glab not found in PATH. Install from: https://gitlab.com/gitlab-org/cli#installation",
65
+ detail:
66
+ "glab not found in PATH. Install from: https://gitlab.com/gitlab-org/cli#installation",
63
67
  });
64
68
  }
65
69
 
@@ -145,7 +149,8 @@ async function runSetupWizard(ctx: ExtensionContext): Promise<boolean> {
145
149
  if (!proceed) return false;
146
150
 
147
151
  const hostname =
148
- (await ctx.ui.input("GitLab hostname", current.hostname)) ?? current.hostname;
152
+ (await ctx.ui.input("GitLab hostname", current.hostname)) ??
153
+ current.hostname;
149
154
  const sshHostname =
150
155
  (await ctx.ui.input("GitLab SSH hostname", current.sshHostname)) ??
151
156
  current.sshHostname;
@@ -183,7 +188,10 @@ async function runSetupWizard(ctx: ExtensionContext): Promise<boolean> {
183
188
  defaultProjectPath,
184
189
  });
185
190
 
186
- ctx.ui.notify("Saved pi-gitlab configuration to global prime-settings.json", "info");
191
+ ctx.ui.notify(
192
+ "Saved pi-gitlab configuration to global prime-settings.json",
193
+ "info",
194
+ );
187
195
 
188
196
  if (!process.env[tokenEnv] || process.env[tokenEnv]?.trim().length === 0) {
189
197
  ctx.ui.notify(
@@ -98,6 +98,11 @@ export function loadConfig(cwd?: string): PiGitlabConfig {
98
98
  }
99
99
  }
100
100
 
101
+ // Auto-derive apiBase from hostname if not explicitly set
102
+ if (base.hostname && !base.apiBase) {
103
+ base.apiBase = `https://${base.hostname}/api/v4`;
104
+ }
105
+
101
106
  return base;
102
107
  }
103
108
 
@@ -145,7 +150,9 @@ export function ensureConfig(): void {
145
150
  });
146
151
  }
147
152
 
148
- export function writeConfig(overrides: Partial<PiGitlabConfig>): PiGitlabConfig {
153
+ export function writeConfig(
154
+ overrides: Partial<PiGitlabConfig>,
155
+ ): PiGitlabConfig {
149
156
  const existing = readGlobalSettings();
150
157
  const base = cloneDefaults();
151
158
  if (existing["pi-gitlab"] && typeof existing["pi-gitlab"] === "object") {
@@ -159,6 +166,11 @@ export function writeConfig(overrides: Partial<PiGitlabConfig>): PiGitlabConfig
159
166
  safety: { ...base.safety, ...(overrides.safety ?? {}) },
160
167
  };
161
168
 
169
+ // Auto-derive apiBase from hostname if not explicitly set
170
+ if (merged.hostname && !merged.apiBase) {
171
+ merged.apiBase = `https://\${merged.hostname}/api/v4`;
172
+ }
173
+
162
174
  writeGlobalSettings({
163
175
  ...existing,
164
176
  "pi-gitlab": merged,
@@ -23,10 +23,10 @@ export interface PiGitlabConfig {
23
23
  }
24
24
 
25
25
  export const DEFAULT_CONFIG: PiGitlabConfig = {
26
- hostname: "gitlab.elches.dev",
27
- sshHostname: "gitlab-ssh.elches.dev",
28
- sshPort: 2222,
29
- apiBase: "https://gitlab.elches.dev/api/v4",
26
+ hostname: "",
27
+ sshHostname: "",
28
+ sshPort: 22,
29
+ apiBase: "",
30
30
  tokenRef: null,
31
31
  tokenEnv: "PI_GITLAB_TOKEN",
32
32
  defaultProjectId: null,
package/src/index.ts CHANGED
@@ -24,7 +24,12 @@
24
24
  * gitlab_mr_bulk_approve — bulk-approve MRs (confirm:true)
25
25
  * gitlab_force_push_safe — safe force push with branch protection lifecycle (confirm:true)
26
26
  *
27
- * Commands:
27
+ * Phase 4 search, CI lint, and repo tools:
28
+ * gitlab_search_query — search GitLab across multiple scopes
29
+ * gitlab_ci_lint — validate .gitlab-ci.yml configuration
30
+ * gitlab_repo_view — view project/repository info
31
+ *
32
+ * In-package skills (0.3.0):
28
33
  * /gitlab-doctor — diagnostic check for glab, auth, API, and config
29
34
  *
30
35
  * Configuration lives in prime-settings.json key `pi-gitlab`.
@@ -34,6 +39,7 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
34
39
  import { gitlabDoctorCommand } from "./commands/gitlab-doctor.js";
35
40
  import { registerResourcesDiscover } from "./events/resourcesDiscover.js";
36
41
  import { registerGitlabApi } from "./tools/gitlab_api.js";
42
+ import { registerGitlabCiLint } from "./tools/gitlab_ci_lint.js";
37
43
  import { registerGitlabForcePushSafe } from "./tools/gitlab_force_push_safe.js";
38
44
  import { registerGitlabIssueClose } from "./tools/gitlab_issue_close.js";
39
45
  import { registerGitlabIssueCreate } from "./tools/gitlab_issue_create.js";
@@ -50,6 +56,8 @@ import { registerGitlabProjectResolve } from "./tools/gitlab_project_resolve.js"
50
56
  import { registerGitlabReleaseCreate } from "./tools/gitlab_release_create.js";
51
57
  import { registerGitlabReleaseList } from "./tools/gitlab_release_list.js";
52
58
  import { registerGitlabReleaseView } from "./tools/gitlab_release_view.js";
59
+ import { registerGitlabRepoView } from "./tools/gitlab_repo_view.js";
60
+ import { registerGitlabSearchQuery } from "./tools/gitlab_search_query.js";
53
61
 
54
62
  export default function piGitlab(pi: ExtensionAPI) {
55
63
  // Expose in-package skills
@@ -84,4 +92,9 @@ export default function piGitlab(pi: ExtensionAPI) {
84
92
  registerGitlabReleaseCreate(pi);
85
93
  registerGitlabMrBulkApprove(pi);
86
94
  registerGitlabForcePushSafe(pi);
95
+
96
+ // Phase 4 search, CI lint, and repo tools
97
+ registerGitlabSearchQuery(pi);
98
+ registerGitlabCiLint(pi);
99
+ registerGitlabRepoView(pi);
87
100
  }