GoKart is a modular Go toolkit for recurring infrastructure setup, safe defaults, and user-owned generated code. Its enforceable boundary is defined in PHILOSOPHY.md.
go install github.com/dotcommander/gokart/cmd/gokart@v0.11.0
gokart new myapp --db sqlite --example
cd myapp
go run ./cmd greet --name Worldgokart: typed configuration, platform config directories, and JSON state persistence.gokart/cli: Cobra application construction and process-stream presentation helpers.gokart/web: chi router/server construction, JSON responses, bounded binding, and validation.gokart/postgres: pgx pool setup and transaction helpers.gokart/sqlite: zero-CGO SQLite setup and operations.gokart/migrate: goose migrations.gokart/cache: Redis construction, prefixes, JSON operations, andRemember.gokart/logger:log/slogsetup.
All modules isolate their dependencies. Constructors expose real upstream types or an explicit Client escape hatch.
gokart new creates ordinary Go code. Plain scaffolds are local and unmanaged; selecting --global or an integration adds a manifest so gokart add can safely update generated wiring.
gokart new mycli --global
gokart new service --db postgres --ai --redis
gokart add sqlite --dry-runDependencies are pinned for deterministic generation. PostgreSQL uses postgres.Open, SQLite uses sqlite.Open, Redis uses cache.Open, and AI uses the official OpenAI SDK directly.
See the generator reference and documentation index.
| Removed surface | Replacement |
|---|---|
ai.NewOpenAIClient(opts...) |
openai.NewClient(opts...) |
ai.NewOpenAIClientWithKey(key) |
openai.NewClient(option.WithAPIKey(key)) |
fs.ConfigDir / fs.EnsureConfigDir |
gokart.ConfigDir / gokart.EnsureConfigDir |
fs.WriteFile / fs.ReadOrCreate |
Standard library; no GoKart replacement |
GetString, GetInt, GetFloat, GetBool |
Typed configuration parsing or caller-owned assertions |
| Cache command mirrors | c.Client().Command(ctx, c.Key(key), ...) |
cli.Fatal, cli.FatalErr, cli.Must |
Return errors; main owns os.Exit |
| CLI writer overrides | Cobra SetOut / SetErr and command writers |
| Removed web helpers | Standard library or the named upstream package directly; see web/README.md |
No deprecated aliases or forwarding modules are retained. Historical v0.10.3 tags are the compatibility path.
Use this searchable inventory when migrating:
- Root getters:
GetString,GetInt,GetFloat,GetBool. - Cache commands:
Get,Set,Delete,Exists,Expire,TTL,Incr,IncrBy,SetNX,HGet,HSet,HGetAll,HDel,HIncrBy,ZAdd,ZRange,ZRangeByScore,ZScore,ZRem,ZCard,SAdd,SRem,SMembers,SIsMember,LPush,RPush,LRange,LPop,RPop,Decr, andDecrBy. Call the corresponding go-redis method throughClient, applyingKeyto every logical key. - CLI process control and writers:
Fatal,FatalErr,Must,SetOutput,SetErrOutput,Output, andErrOutput. - Web assets and auth:
NewAssets,AssetConfig,Assets,Assets.Path,Assets.Handler,APIKeyAuth, andBearerAuth. - Web CSRF and flash:
CSRFProtect,CSRFProtectWithOrigins,SetFlash,GetFlash,FlashFromContext,FlashMiddleware,FlashLevel,FlashMessage,FlashSuccess,FlashError,FlashWarning, andFlashInfo. - Web health and clients:
HealthHandler,ReadyHandler,HealthCheck,HealthFunc,NewHTTPClient,NewStandardClient, andHTTPConfig. - Web negotiation and pagination:
WantsJSON,IsHTMX,Negotiate,NegotiateStatus,ParsePage,ParsePageWithConfig,NewPagedResponse,Page,PageConfig, andPagedResponse. - Web rate limiting:
RateLimit,RateLimitWithKey,RateLimitWithEviction,WithTTL,WithSweepInterval,RateLimiter,RateLimiter.Middleware,RateLimiter.LimiterCount,RateLimiter.Stop, andRateLimitOption. - Web templ adapters:
Render,RenderCtx,RenderWithStatus,TemplHandler,TemplHandlerFunc, andTemplHandlerFuncE.
Go 1.26 or later is required.
just verify