DEV.co
AI Coding Agents · natefinch

gorram

Gorram is a CLI tool that executes Go functions directly from the command line without writing boilerplate code. It automatically converts command-line arguments to function parameters and handles input/output streams intelligently, making Go stdlib and custom package functions accessible as simple CLI commands.

Source: GitHub — github.com/natefinch/gorram
1.1k
GitHub stars
33
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorynatefinch/gorram
Ownernatefinch
Primary languageGo
LicenseMIT — OSI-approved
Stars1.1k
Forks33
Open issues14
Latest releasev1.0 (2017-06-20)
Last updated2025-06-13
Sourcehttps://github.com/natefinch/gorram

What gorram is

Gorram dynamically analyzes Go function signatures at runtime, generates temporary Go source files, and invokes them via `go run`. It implements heuristics for common Go patterns (io.Reader, []byte, error returns) to map stdin/stdout and CLI args to function parameters, caching generated scripts for performance.

Quickstart

Get the gorram source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/natefinch/gorram.gitcd gorram# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Quick prototyping with stdlib functions

Execute crypto, encoding, JSON, or math functions directly from the shell (e.g., `gorram crypto/sha256 Sum256 file.txt`) without writing wrapper code.

CLI tooling for internal Go packages

Expose unexported or ad-hoc functions from your GOPATH as one-off command-line utilities for scripting or DevOps workflows.

Educational exploration of Go stdlib

Developers learning Go can interactively test and understand stdlib behavior without context-switching to an IDE or test file.

Implementation considerations

  • Requires a working Go environment (go compiler, GOPATH) on the machine where gorram runs; not portable without Go installation.
  • Only exported functions, methods, and variables are accessible; private symbols cannot be invoked.
  • Generated scripts are cached in $GORRAM_CACHE or $HOME/.gorram/; cache invalidation and cleanup are manual.
  • Heuristics for stdin/stdout detection may not work for atypical function signatures; manual template output via -t flag may be needed.
  • Error handling is basic; non-zero exit codes for errors, but error context and debugging may be limited.

When to avoid it — and what to weigh

  • Production CLI tools needing stability — Gorram relies on dynamic code generation and caching; error handling and versioning are not production-grade. Use proper CLI frameworks (Cobra, urfave/cli) instead.
  • Performance-critical scripts — First invocation incurs code generation overhead; repeated invocations cache results. Not suitable for high-frequency or latency-sensitive use.
  • Complex type conversions or validation — Gorram's heuristics handle common patterns but may fail or behave unpredictably with custom types, generics, or intricate function signatures.
  • Secure handling of sensitive data — CLI arguments are visible in process listings; no special handling for secrets. Unsuitable for password or token management.

License & commercial use

MIT License. Permits use, modification, and distribution in commercial and private contexts with attribution.

MIT is a permissive OSI-approved license. Commercial use is allowed. No warranty is provided; ensure internal review of dependency compliance and liability assumptions before production deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceModerate
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitPossible
Assessment confidenceHigh
Security considerations

Gorram generates and executes arbitrary Go code based on CLI arguments. Input validation is limited to function signature matching. No sandboxing or privilege isolation. Ensure source packages are trusted. Generated scripts are cached locally; audit cache for stale or malicious code. CLI arguments visible in process listings.

Alternatives to consider

Cobra / urfave/cli

Mature frameworks for building production-grade CLI tools in Go with built-in validation, help generation, and error handling.

Go plugins (plugin package)

For dynamic loading of compiled Go code at runtime, with stronger type safety and no code generation overhead.

Custom shell scripts wrapping `go run`

More explicit, version-controlled, and testable than gorram's automatic heuristics; avoids magic and caching complexity.

Software development agency

Build on gorram with DEV.co software developers

Gorram is ideal for rapid prototyping and internal tooling. For production CLI tools, data pipelines, or complex integrations, our team can architect a robust solution tailored to your workflow.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

gorram FAQ

Do I need Go installed to run Gorram?
Yes. Gorram dynamically analyzes and compiles Go code, so a working Go environment (compiler, GOPATH) is mandatory on the execution machine.
Can Gorram call private functions?
No. Only exported (capitalized) functions, methods, and variables are accessible. This is a language-level restriction.
What happens on the first run with a new function?
Gorram generates a Go source file in $GORRAM_CACHE (or $HOME/.gorram/), compiles, and runs it. Subsequent runs reuse the cached script unless -r flag is used to regenerate.
Can Gorram output JSON or other structured formats?
Default output is via fmt.Println or %v formatting. Use the -t flag with a Go template to customize output, but built-in structured formats are not provided.

Software development & web development with DEV.co

Need help beyond evaluating gorram? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and ai coding agents integrations — and maintain them long-term.

Need a custom CLI tool or automation layer?

Gorram is ideal for rapid prototyping and internal tooling. For production CLI tools, data pipelines, or complex integrations, our team can architect a robust solution tailored to your workflow.