shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ System Integration/ CLI Tools/ External
Go Package

external

External process runner — exec.Command wrapper with timeout, output capture, error handling

Go Ready SI
Command Execution with Timeout go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
result, err := external.Run(ctx, external.Command{
    Name: "go",
    Args: []string{"build", "-o", "bin/sbx", "./cmd/sbx"},
    Dir:  "/workspace/shredbx/projects/sbx/packages/core/go",
},
    external.WithTimeout(60*time.Second),
    external.WithEnv(map[string]string{"CGO_ENABLED": "0"}),
)

if err != nil {
    // Typed error classification
    var exitErr *external.ExitError
    if errors.As(err, &exitErr) {
        log.Printf("exit %d: %s", exitErr.Code, result.Stderr)
    }
    return err
}
log.Printf("built in %s", result.Duration)

About

Provides a structured wrapper around os/exec for running external processes. Captures stdout/stderr separately, enforces timeouts, injects environment variables, and classifies exit codes into typed errors.

Public API

NameKindSignature
Runfuncfunc Run(ctx context.Context, cmd Command) (*Result, error)
Commandtypetype Command struct
Resulttypetype Result struct
WithTimeoutfuncfunc WithTimeout(d time.Duration) Option
WithEnvfuncfunc WithEnv(env map[string]string) Option

Dependencies

Imported By (7)

gitcli Go Ready

Git CLI wrapper — branch operations, commit, status, diff with structured output

gitcli-wrapperstructured-outputbranch-ops
6 exports 2 deps
worktree Go Ready

Git worktree manager — create, list, remove worktrees with Docker integration

git-worktreeisolationdocker-integrationparallel-dev
5 exports 2 deps
vault Go Ready

1Password vault adapter — credential retrieval, caching, op:// URI resolution

1passwordsecretscredentialsop-uri
5 exports 4 deps
build Go Ready

Build orchestrator — Go/Node/Docker build commands with progress reporting

build-systemmulti-platformdockerprogress
5 exports 2 deps
migrate Go Ready

Database migration runner — up/down/status with versioned SQL files

migrationssqlversionedup-down
5 exports 2 deps
webassets Go Ready

Image processing pipeline — resize, optimize, format conversion via sips/ImageMagick

imagesresizeoptimizationsipsimagemagick
5 exports 2 deps
pdf Go Ready

PDF generation — HTML-to-PDF rendering with template support

pdfhtml-to-pdftemplatesrendering
4 exports 1 deps

Related Packages

gitcli Go Ready

Git CLI wrapper — branch operations, commit, status, diff with structured output

gitcli-wrapperstructured-outputbranch-ops
6 exports 2 deps
vault Go Ready

1Password vault adapter — credential retrieval, caching, op:// URI resolution

1passwordsecretscredentialsop-uri
5 exports 4 deps
build Go Ready

Build orchestrator — Go/Node/Docker build commands with progress reporting

build-systemmulti-platformdockerprogress
5 exports 2 deps

Source

github.com/shredbx/sbx-core/pkg/external
execprocess-runnertimeoutoutput-capture
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |