Goenv
Go library that reads the ENV variable and returns "dev" only if exactly "dev", otherwise "prod" with boolean helpers and fail-safe defaults.
Rank
62
Safety
84
Downloads
984
Updated
Oct 11, 2026
Version
1.0.11
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 984 downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 984 downloadsadoption · observed Oct 11, 2026
- Latest release
- 1.0.11release · observed Oct 10, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.11release
- Removed the file skill-card.md. - No functional or behavior changes to the skill itself.
Observed Oct 10, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17fq93tmpky791n7516jcn08n83sfn2:goenv- Install using `clawhub skill install s17fq93tmpky791n7516jcn08n83sfn2:goenv` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/psyb0t/goenv before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-psyb0t-goenv/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
106,340 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
name: goenv
description: Go library that reads one environment variable and tells you if you're in prod or dev. `github.com/psyb0t/goenv` wraps `os.Getenv("ENV")` behind three calls — `goenv.Get()` returns the current env as a string (`"prod"` or `"dev"`), `goenv.IsProd()` and `goenv.IsDev()` return bools. It recognizes exactly two environments: `dev` when `ENV` is precisely `"dev"`, and `prod` for everything else (unset, empty, `"production"`, `"DEV"`, anything) — a fail-safe default to prod. Exposes constants `goenv.Prod`/`goenv.Dev` and the env-var name as `goenv.EnvVarName`. Zero dependencies beyond the stdlib `os`; no network, no files, no config. Note `Type` is a string *alias*, so it gives no compile-time safety over a bare `string`. Use when the user wants a tiny dependency-free prod/dev switch in a Go program, or is already importing goenv and wants to branch behavior on the environment.
homepage: https://github.com/psyb0t/goenv
user-invocable: true
metadata:
openclaw:
emoji: "🌍"
primaryEnv: ENV
requires:
bins:
- go
permissions:
filesystem: "Guides adding one import and a few calls to your project's own Go source — edits `.go` files in the current project only. The library itself writes nothing."
shell: "The Go toolchain (`go get` / `go build` / `go test`) to add and compile the dependency. No other host access."
network: "`go get` fetches the module from your configured Go module proxy the first time. The library makes no network calls at runtime."
---
# goenv
A Go library that reads a single environment variable — `ENV` — and answers one question: are you in `prod` or `dev`? That's the whole package. `os.Getenv("ENV")` with a fail-safe default and three named helpers, zero dependencies. Import it and call `goenv.Get()`.
For install, the exact match/default behavior, and a worked example, see [references/setup.md](references/setup.md).
## Security & safety
- **It reads exactly one environment variable — `ENV` — and nothing else.** No other env vars are read, nothing is written to disk, no network calls are made at runtime, and no data leaves your process. Its only import is the stdlib `os`.
- **It's a library you compile into your own binary** — it has no runtime surface of its own. Whatever your program does with the prod/dev answer is on you, same as any code you'd write by hand.
- **Fail-safe by design:** an unrecognized or unset `ENV` resolves to `prod`, so a misconfigured environment errs toward production-grade behavior rather than accidentally enabling dev-only shortcuts.
## When to use
- A Go program needs a small, dependency-free way to branch behavior between two environments (prod vs dev) — e.g. verbose logging in dev, stricter defaults in prod.
- The project already imports `github.com/psyb0t/goenv` and you want to add or read a prod/dev check consistently (`goenv.IsProd()` / `goenv.IsDev()` instead of hand-rolled `os.Getenv` comparisons).
- You want the fail-safe "default to pro_meta.json
{
"ownerId": "kn79dhvmpjng4rp2jjk8k0v5xx80ccbk",
"slug": "goenv",
"version": "1.0.11",
"publishedAt": 1791643108575
}references/setup.md
# goenv — setup & reference
## Requirements
- Go **1.26** or newer (per the module's `go.mod`).
- Nothing else. goenv's only import is the standard library `os`; it pulls in zero third-party dependencies.
## Install
```bash
go get github.com/psyb0t/goenv
```
Then import it in your Go code:
```go
import "github.com/psyb0t/goenv"
```
Module path: `github.com/psyb0t/goenv`.
## The entire API
Three functions, three constants, and one type. That's the whole surface.
| Symbol | Kind | Behavior |
|---|---|---|
| `goenv.Get() goenv.Type` | func | Returns the current environment: `Dev` if `ENV == "dev"` exactly, otherwise `Prod`. |
| `goenv.IsProd() bool` | func | `Get() == Prod`. True unless `ENV` is exactly `"dev"`. |
| `goenv.IsDev() bool` | func | `Get() == Dev`. True only when `ENV` is exactly `"dev"`. |
| `goenv.Prod` | const | The string `"prod"`. |
| `goenv.Dev` | const | The string `"dev"`. |
| `goenv.EnvVarName` | const | The string `"ENV"` — the variable it reads. |
| `goenv.Type` | type | A **string alias** (`type Type = string`). `goenv.Type` is interchangeable with `string`; the constants above are typed as `Type` but provide no compile-time enum enforcement. |
## Behavior table
`Get()` does a single exact-match `switch` on `os.Getenv("ENV")`:
| `ENV` value | `Get()` | `IsProd()` | `IsDev()` |
|---|---|---|---|
| `dev` | `dev` | false | true |
| `prod` | `prod` | true | false |
| (unset) | `prod` | true | false |
| `` (empty) | `prod` | true | false |
| `DEV` / `Dev` | `prod` | true | false |
| `development` | `prod` | true | false |
| anything else | `prod` | true | false |
The match is **case-sensitive and exact** — only the literal lowercase `"dev"` counts as dev. Everything else (including the string `"prod"` itself, and any typo) resolves to `Prod`. This is deliberate: an unknown or misconfigured environment fails safe toward production behavior.
Each call re-reads the environment (`os.Getenv`), so if something in your process mutates `ENV` at runtime, subsequent `Get()`/`IsProd()`/`IsDev()` calls reflect the new value. In practice set `ENV` once before launch and leave it.
## Worked example
```go
package main
import (
"fmt"
"github.com/psyb0t/goenv"
)
func main() {
fmt.Printf("environment: %s\n", goenv.Get())
if goenv.IsDev() {
fmt.Println("dev mode: verbose logging, hot reload, relaxed timeouts")
return
}
// goenv.IsProd() — the default path
fmt.Println("prod mode: structured logs, strict timeouts")
}
```
```bash
ENV=dev go run . # → environment: dev → dev mode ...
go run . # → environment: prod → prod mode ... (ENV unset)
```
## Notes / limitations
- **Two environments only.** There is no `staging`/`test`/`ci` — anything that isn't exactly `"dev"` is treated as `prod`. If you need more, this library can't express it; use a fuller config package.
- **Fixed variable name.** It always reads `ENV`; the name isn't configurable (it's exported as `goenv.EnvVarName` for reference, not for oskill-card.md
## Description: Guides Go developers in using goenv to distinguish development from production by reading the ENV variable, treating only the exact value dev as development. This skill is ready for commercial/non-commercial use. ## Publisher: [psyb0t](https://clawhub.ai/user/psyb0t) ### License/Terms of Use: MIT-0 ## Use Case: Go developers use this skill to add a small prod/dev environment switch to their applications or understand existing goenv calls. It provides installation guidance, examples, and the exact ENV matching behavior. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: An unset or unexpected ENV value selects production behavior instead of development behavior. Mitigation: Confirm the application needs exact ENV=dev matching before adopting the library; test intended environment values. Risk: Installation adds a third-party Go module to the project. Mitigation: Review the dependency and its version before running go get. ## Reference(s): - [Goenv setup and reference](references/setup.md) - [Goenv library homepage](https://github.com/psyb0t/goenv) - [Goenv ClawHub release](https://clawhub.ai/psyb0t/skills/goenv) ## Skill Output: **Output Type(s):** [Guidance, Code, Shell commands] **Output Format:** [Markdown with Go and shell examples] **Output Parameters:** [1D] **Other Properties Related to Output:** [None] ## Skill Version(s): 1.0.11 (source: ClawHub release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/psyb0t/skills/goenv",
"sourceUrl": "https://clawhub.ai/psyb0t/skills/goenv",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T22:30:28.374Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-psyb0t-goenv/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-psyb0t-goenv/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T22:30:28.374Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "984 downloads",
"href": "https://clawhub.ai/psyb0t/goenv",
"sourceUrl": "https://clawhub.ai/psyb0t/goenv",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T22:30:28.374Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.11",
"href": "https://clawhub.ai/psyb0t/goenv",
"sourceUrl": "https://clawhub.ai/psyb0t/goenv",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-10T14:38:28.575Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-psyb0t-goenv/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-psyb0t-goenv/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.11",
"description": "- Removed the file skill-card.md. - No functional or behavior changes to the skill itself.",
"href": "https://clawhub.ai/psyb0t/goenv",
"sourceUrl": "https://clawhub.ai/psyb0t/goenv",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-10T14:38:28.575Z",
"isPublic": true
}
]
}Record generated Oct 12, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-psyb0t-goenv/run-check
