projectdiscovery

package
v2.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package projectdiscovery implements MCP tools that resolve Git remote URLs to GitLab project metadata.

The package wraps the GitLab Projects API after extracting a project path from a complete HTTPS or SSH remote URL:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for standalone project discovery actions.

func FormatMarkdown

func FormatMarkdown(out ResolveOutput) string

FormatMarkdown renders the resolved project as a Markdown CallToolResult.

func ParseRemoteURL

func ParseRemoteURL(rawURL string) (string, error)

ParseRemoteURL extracts the project path_with_namespace from a git remote URL. Supports HTTPS, SSH (git@host:path), and ssh:// protocol URLs. Returns the path and nil on success, or empty string and an error.

Types

type ResolveInput

type ResolveInput struct {
	RemoteURL string `` /* 492-byte string literal not displayed */
}

ResolveInput defines parameters for resolving a git remote URL to a GitLab project.

type ResolveOutput

type ResolveOutput struct {
	toolutil.HintableOutput
	ID                int64  `json:"id"`
	Name              string `json:"name"`
	Path              string `json:"path"`
	PathWithNamespace string `json:"path_with_namespace"`
	WebURL            string `json:"web_url"`
	DefaultBranch     string `json:"default_branch"`
	Description       string `json:"description"`
	Visibility        string `json:"visibility"`
	HTTPURLToRepo     string `json:"http_url_to_repo,omitempty"`
	SSHURLToRepo      string `json:"ssh_url_to_repo,omitempty"`
	ExtractedPath     string `json:"extracted_path"`
}

ResolveOutput holds the resolved GitLab project information.

func Resolve

func Resolve(ctx context.Context, client *gitlabclient.Client, input ResolveInput) (ResolveOutput, error)

Resolve parses a git remote URL, extracts the project path, and looks up the project via the GitLab API. Returns the project details or an error with guidance on what to try next.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL