project

package
v0.153.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package project derives the identity of the project the process runs in. It is a leaf package so both the agent and its tools can share it without import cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRemoteURL

func ParseRemoteURL(url string) string

ParseRemoteURL extracts "org/repo" from an https or scp-style ssh git remote URL, returning "" when it does not match either form.

func RemoteName

func RemoteName() string

RemoteName returns the "org/repo" name parsed from the origin remote URL, or "" when there is no repo/remote or the URL is unparsable.

func Slugify

func Slugify(name string) string

Slugify normalizes a name into a safe, flat filename segment: lowercased, non-alphanumeric runs collapsed to single hyphens, trimmed, and length-capped. Notably Slugify("org/repo") == "org-repo".

Types

type Identity

type Identity struct {
	Name string
	Slug string
}

Identity is the detected project the process is running in. The zero value means global scope (no project).

func Detect

func Detect() Identity

Detect returns the current project, cached for the process lifetime (chat sessions and `infer agent` subprocesses run with a fixed cwd). Detection order: git remote origin -> org/repo; else the cwd basename; else global (the zero Identity).

Jump to

Keyboard shortcuts

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