diff options
| author | Clawd <ai@clawd.bot> | 2026-02-15 18:53:55 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-15 18:53:55 -0800 |
| commit | d6740a0be72a776db555d4bb6ccfa4a04da6570a (patch) | |
| tree | 27fc1d0306c5f57d27b5fb6295563e0102c4f7a6 /cmd/ship/root_v2.go | |
| parent | a7436dfcc01a599bbb99a810bd59e92b21252c78 (diff) | |
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
Diffstat (limited to 'cmd/ship/root_v2.go')
| -rw-r--r-- | cmd/ship/root_v2.go | 48 |
1 files changed, 1 insertions, 47 deletions
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 { | |||
| 82 | return nil | 82 | return nil |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | // Placeholder subcommands - to be implemented | 85 | // Subcommands (list, status, logs, remove) are defined in commands_v2.go |
| 86 | |||
| 87 | var listV2Cmd = &cobra.Command{ | ||
| 88 | Use: "list", | ||
| 89 | Short: "List all deployments", | ||
| 90 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 91 | // TODO: implement | ||
| 92 | output.PrintAndExit(&output.ListResponse{ | ||
| 93 | Status: "ok", | ||
| 94 | Deploys: []output.DeployInfo{}, | ||
| 95 | }) | ||
| 96 | return nil | ||
| 97 | }, | ||
| 98 | } | ||
| 99 | |||
| 100 | var statusV2Cmd = &cobra.Command{ | ||
| 101 | Use: "status NAME", | ||
| 102 | Short: "Check status of a deployment", | ||
| 103 | Args: cobra.ExactArgs(1), | ||
| 104 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 105 | // TODO: implement | ||
| 106 | output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) | ||
| 107 | return nil | ||
| 108 | }, | ||
| 109 | } | ||
| 110 | |||
| 111 | var logsV2Cmd = &cobra.Command{ | ||
| 112 | Use: "logs NAME", | ||
| 113 | Short: "View logs for a deployment", | ||
| 114 | Args: cobra.ExactArgs(1), | ||
| 115 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 116 | // TODO: implement | ||
| 117 | output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) | ||
| 118 | return nil | ||
| 119 | }, | ||
| 120 | } | ||
| 121 | |||
| 122 | var removeV2Cmd = &cobra.Command{ | ||
| 123 | Use: "remove NAME", | ||
| 124 | Short: "Remove a deployment", | ||
| 125 | Args: cobra.ExactArgs(1), | ||
| 126 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 127 | // TODO: implement | ||
| 128 | output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) | ||
| 129 | return nil | ||
| 130 | }, | ||
| 131 | } | ||
| 132 | 86 | ||
| 133 | var hostV2Cmd = &cobra.Command{ | 87 | var hostV2Cmd = &cobra.Command{ |
| 134 | Use: "host", | 88 | Use: "host", |
