Feat/stackdome cli overhaul - #1
Merged
Merged
Conversation
Rename module to github.com/stackdome/cli, bump to Go 1.25.0. New internal packages: - errors: unified CLIError type with exit codes and HTTP mapping - config: ~/.stackdome/config.json with atomic writes - output: formatter (table/json/yaml) with TTY-aware colors - cmdutil: CommandContext, WithContext/RequireAuth/RequireStack middleware New entry point at cmd/stackdome/ with root command (global flags: --log-level, --no-color, --output) and version command. Makefile updated for stackdome binary with ldflags.
API client wrapping the generated OpenAPI client with bearer token auth via default headers, transparent token refresh, and org/team scoping. Commands: - stackdome login (interactive email/password + --token for CI) - stackdome logout - stackdome signup (with --org for organisation creation) - stackdome config view (table + json/yaml output) - stackdome config set-context (switch server) - stackdome config set-stack (set current stack context)
Parse developer-friendly YAML stackfiles into OpenAPI Stack objects. Handles resources, builds, env refs, secrets, addon connections, volumes, and JSON passthrough + tests.
Commands: deploy, status, destroy, validate, stack list/info/delete.
Deploy supports stackfile YAML and raw JSON, waits for Ready/Failed.
Status renders resource table with colors using lipgloss. Stack info
and delete resolve by name. Status --stack accepts name.
Stackfile improvements:
- Env refs support exact ({{ db.host }}) and template
("redis://{{ redis.host }}:6379") patterns
- Secrets and addons reference by name, resolved at deploy time
- Validation: self/resource output checking against port definitions,
single-source-per-env-value enforcement, addon output validation
- OpenAPI schema for stackfile format
Stack client: create, get, update, delete, list, find-by-name.
- logs: SSE streaming from stack or resource with --follow, --tail, --since - build: list/info subcommands for viewing build history and details - restart: triggers resource restart via POST actions/restart endpoint - open: opens resource public URL in browser, prepends http:// if needed - SSE parser for line-by-line event stream parsing - Client methods for log streaming (raw HTTP), builds (OpenAPI), restart - Export TimeAgo from output package for reuse
- secret: list, info, create, set, delete with support for all 6 types (Generic, DockerRegistry, GitCredentials, UsernamePassword, Token, SSHKey) - secret create: --data KEY=VALUE (repeatable) and --from-file for .env files - volume: list and delete (create blocked by stale WorkspaceName validation) - Extract API reason from 400 responses so validation errors show clearly (e.g. "docker registry secret requires field: registry")
…er, and code cleanup - stackdome init: converts docker-compose.yaml to stackfile with validation - stackdome completion: bash, zsh, fish - deploy returns immediately by default, use --wait for blocking - env_file and command/args support in stackfile format - spinner for deploy --wait - code cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.