From d6740a0be72a776db555d4bb6ccfa4a04da6570a Mon Sep 17 00:00:00 2001 From: Clawd Date: Sun, 15 Feb 2026 18:53:55 -0800 Subject: feat(v2): implement list, status, logs, remove commands - commands_v2.go: all subcommand implementations - list: enumerates deploys from /etc/ship/ports and /var/www - status: shows deploy details (type, port, running, TTL) - logs: fetches journalctl logs (or Caddy logs for static) - remove: full cleanup of all artifacts (service, caddy, files, docker) - All commands output JSON with proper error codes All core v2 commands now implemented --- cmd/ship/root_v2.go | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'cmd/ship/root_v2.go') diff --git a/cmd/ship/root_v2.go b/cmd/ship/root_v2.go index 9900e83..e886a7e 100644 --- a/cmd/ship/root_v2.go +++ b/cmd/ship/root_v2.go @@ -82,53 +82,7 @@ func runDeployV2(cmd *cobra.Command, args []string) error { return nil } -// Placeholder subcommands - to be implemented - -var listV2Cmd = &cobra.Command{ - Use: "list", - Short: "List all deployments", - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - output.PrintAndExit(&output.ListResponse{ - Status: "ok", - Deploys: []output.DeployInfo{}, - }) - return nil - }, -} - -var statusV2Cmd = &cobra.Command{ - Use: "status NAME", - Short: "Check status of a deployment", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) - return nil - }, -} - -var logsV2Cmd = &cobra.Command{ - Use: "logs NAME", - Short: "View logs for a deployment", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) - return nil - }, -} - -var removeV2Cmd = &cobra.Command{ - Use: "remove NAME", - Short: "Remove a deployment", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) - return nil - }, -} +// Subcommands (list, status, logs, remove) are defined in commands_v2.go var hostV2Cmd = &cobra.Command{ Use: "host", -- cgit v1.2.3