Skip to content

Feat/stackdome cli overhaul - #1

Merged
ashishmax31 merged 8 commits into
mainfrom
feat/stackdome-cli-overhaul
Aug 5, 2026
Merged

Feat/stackdome cli overhaul#1
ashishmax31 merged 8 commits into
mainfrom
feat/stackdome-cli-overhaul

Conversation

@ashishmax31

Copy link
Copy Markdown
Contributor

No description provided.

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
@ashishmax31
ashishmax31 merged commit accdda2 into main Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant