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.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | natefinch/gorram |
| Owner | natefinch |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 1.1k |
| Forks | 33 |
| Open issues | 14 |
| Latest release | v1.0 (2017-06-20) |
| Last updated | 2025-06-13 |
| Source | https://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.
Get the gorram source
Clone the repository and explore it locally.
git clone https://github.com/natefinch/gorram.gitcd gorram# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
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.
| Signal | Assessment |
|---|---|
| Maintenance | Moderate |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Possible |
| Assessment confidence | High |
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.
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.coRelated 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?
Can Gorram call private functions?
What happens on the first run with a new function?
Can Gorram output JSON or other structured formats?
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.