Help us shape the future of Go! Take the 2026 Go Developer Survey

commandanalysis

package module
v0.0.0-...-c703685 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package commandanalysis owns deterministic command and executable facts.

Index

Constants

View Source
const MaxScriptBytes = 1 << 20

MaxScriptBytes bounds static observation of a stock JavaScript cell.

Variables

View Source
var VCSTools = []string{"git", "gh", "hg", "svn", "jj"}

VCSTools names the version-control and hosting executables recognized by Mekugi.

Functions

func GitHubRemoteWrite

func GitHubRemoteWrite(args []string) bool

GitHubRemoteWrite reports possible GitHub API or repository mutations.

func GitInvocation

func GitInvocation(args []string) (globals []string, command string, rest []string)

GitInvocation shares global-option parsing between approval and observation.

func GitReadOnlyCommand

func GitReadOnlyCommand(command string) bool

GitReadOnlyCommand reports built-in readers with no worktree mutation. Options that write output or run a pager need separate caller checks.

func HasHelpFlag

func HasHelpFlag(args []string) bool

HasHelpFlag recognizes explicit help requests among already-separated options.

func IsVCSTool

func IsVCSTool(name string) bool

IsVCSTool identifies an executable without deciding its effects or approval.

func LocalEnvironment

func LocalEnvironment(environmentID []byte) bool

func SVNReadOnlyCommand

func SVNReadOnlyCommand(command string) bool

SVNReadOnlyCommand identifies Subversion's built-in readers and aliases.

func VCSValueOption

func VCSValueOption(tool, option string) bool

VCSValueOption identifies global options whose next argument is a value.

func WorktreeWrites

func WorktreeWrites(argv []string) bool

WorktreeWrites reports whether a VCS invocation may import, discard, or write out repository content. Unknown commands remain possible writers. This is effect attribution, independent of remote-write approval.

Types

type Command

type Command struct {
	Command string
	Workdir string
	Shell   string `json:",omitempty"`
}

Source: internal/router/exec_observation.go:57:61,208:235,1656:1794@23344db6. Command is one stock command as the host will run it.

func ExecCommandArguments

func ExecCommandArguments(arguments, directory, sessionShell string) (Command, bool)

ExecCommandArguments decodes stock exec_command arguments and resolves the working directory against the selected metadata directory. A command without its own shell runs in the session shell. A command for another environment is excluded from local observation.

func LiteralExecCommands

func LiteralExecCommands(source, directory, sessionShell string) (commands []Command, dynamic bool)

LiteralExecCommands extracts literal tools.exec_command calls from a exec cell. Any other reference to the command tools, including write_stdin input that can drive a started process, makes the cell dynamic.

Directories

Path Synopsis
Package execscope derives bounded write scopes without executing the user's program.
Package execscope derives bounded write scopes without executing the user's program.

Jump to

Keyboard shortcuts

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