Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommandNames ¶
GetCommandNames returns all command names for a project.
func GetScriptCommand ¶ added in v0.8.0
GetScriptCommand returns the command string for a named script from package.json. Returns empty string if not found.
func HasCommand ¶
HasCommand checks if a project has a command with the given name.
Types ¶
type CommandDef ¶
type CommandDef struct {
// Name is the command identifier (e.g., "test", "lint", "build").
Name string `json:"name"`
// Description is a human-readable description.
Description string `json:"description"`
// Command is the executable to run.
Command string `json:"command"`
// Args are the default arguments.
Args []string `json:"args,omitempty"`
// Timeout is the default timeout in seconds (0 = no timeout).
Timeout int `json:"timeout,omitempty"`
// Persistent indicates this is a long-running process (dev server).
Persistent bool `json:"persistent,omitempty"`
}
CommandDef defines a runnable command for a project.
func DefaultGoCommands ¶
func DefaultGoCommands() []CommandDef
DefaultGoCommands returns the default commands for a Go project.
func DefaultNodeCommands ¶
func DefaultNodeCommands(packageManager string) []CommandDef
DefaultNodeCommands returns the default commands for a Node.js project.
func DefaultPythonCommands ¶
func DefaultPythonCommands() []CommandDef
DefaultPythonCommands returns the default commands for a Python project.
func GetCommandByName ¶
func GetCommandByName(proj *Project, name string) *CommandDef
GetCommandByName finds a command by name in a project.
type Project ¶
type Project struct {
// Path is the absolute path to the project root.
Path string `json:"path"`
// Type is the detected project type.
Type ProjectType `json:"type"`
// Name is the project name (from config files or directory name).
Name string `json:"name"`
// Commands are the available commands for this project.
Commands []CommandDef `json:"commands"`
// PackageManager is the detected package manager (for Node.js).
PackageManager string `json:"package_manager,omitempty"`
// Metadata holds additional project-specific info.
Metadata map[string]string `json:"metadata,omitempty"`
}
Project represents a detected development project.
type ProjectType ¶
type ProjectType string
ProjectType identifies the kind of project.
const ( // ProjectGo is a Go project (go.mod). ProjectGo ProjectType = "go" // ProjectNode is a Node.js project (package.json). ProjectNode ProjectType = "node" // ProjectPython is a Python project (pyproject.toml, setup.py, requirements.txt). ProjectPython ProjectType = "python" // ProjectUnknown is an unrecognized project type. ProjectUnknown ProjectType = "unknown" )