wokku-cli 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90dbd93905c3fc3dc7422cf4342def249b9ff04d3c5bbefd64f5d4a5ccc23cb6
4
- data.tar.gz: 01b1043ff82e7ae509ddb36eed9fa6d9657b7321ae82502996c448eb4d755440
3
+ metadata.gz: 820e03562fff67b93f087227eb2da57e79e761c43ac5c108680699ce068a480e
4
+ data.tar.gz: '077218e9886faadb334a615e225a3f61802688f29f6e9ac53625ca4f505f632d'
5
5
  SHA512:
6
- metadata.gz: 7650db80c9d0608c8f879c86f556008ae47af5cd3827e029378e7327e455b9762ef6f4260a73f0d1da61c7c8a93b2bdfe03fd01fae1ca3212e60acbbfa61bc56
7
- data.tar.gz: 33fbc61d1092de38e30737cedcb83750bc55fa8193f1cf3604599e5ecf7e6103bc16faa7775c8bab0217d44dc3ba2b33cae6804c921007888f9097c277e94f78
6
+ metadata.gz: 9518d6c33f111278305093a0d55f925772fe3363f4abe95df3d32b83e105d03f3e0bd2001add8f696c717d5e89352926fec2c1220fe7cb74baebc523a8c6812d
7
+ data.tar.gz: 1326795840aae9837bb480a821e466ce8c64e90a0fc5ed2f01c8929b7adb16da27760aa7d3c459fc65cf60afd18ac5de006be0e790d639af8eb6e09296ae9dcd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 — 2026-06-01
4
+
5
+ MCP commands — wire the wokku-plugin Claude Code MCP server with one command. Pairs with wokku-cloud canonical backlog 1.3.
6
+
7
+ ### Added
8
+
9
+ - `wokku mcp:install` — registers the Wokku MCP server in Claude Code using the active CLI token + API URL.
10
+ - `wokku mcp:switch` — re-pushes the current CLI token to the MCP config (after `auth:login` swapped accounts).
11
+ - `wokku mcp:logout` — removes the Wokku MCP server from Claude Code.
12
+
13
+ Shells out to `claude mcp add / remove` so we don't depend on Claude Code's internal config-file layout (it changes between versions). Aborts with a clear "install Claude Code first" error if the `claude` CLI isn't on PATH.
14
+
15
+ ## 0.3.0 — 2026-05-31
16
+
17
+ Bundle v2 — boxes, shared addons (user-pick per box), and dedicated upgrades for PostgreSQL / MySQL / MongoDB / Redis. Pairs with wokku-cloud Phase 7 prep PRs #67–#73.
18
+
19
+ ### Added
20
+ - `apps:create` gains `--box-size SIZE` (sleeping/small/medium/large/xlarge), `--shared pg,redis,...` (comma-separated shared engines to attach), `--dedicated-db postgres|mysql|mongodb`, `--dedicated-redis`. All optional — omitting them keeps the old free-tier default.
21
+ - `addons:shared:enable APP ENGINE` — attach a shared engine (Pg/Redis/Memcached/RabbitMQ/Meilisearch). Free plan limited to Pg+Redis.
22
+ - `addons:shared:disable APP ENGINE` — detach a shared engine + destroy its tenant data.
23
+ - `addons:dedicated:upgrade APP ENGINE` — upgrade to a dedicated container. Pg/Redis migrate from shared (data preserved). MySQL/MongoDB are fresh-create. Quota: 3 per plan; size follows the box size.
24
+ - `addons` listing now shows `kind: shared|dedicated` per row.
25
+
26
+ ### Deprecated
27
+ - `addons:add` — kept for back-compat with wokku-cloud servers that haven't flipped `BUNDLE_V2_ENABLED=true` yet. When the server has bundle v2 on, this endpoint returns 410 Gone with guidance to use the new commands above.
28
+
29
+ ### Requires
30
+ - wokku-cloud server-side support shipped 2026-05-31 (Phase 7 prep PRs #67–#73).
31
+
3
32
  ## 0.2.0 — 2026-05-06
4
33
 
5
34
  Interactive shell over WebSocket: open a real PTY in your app's container, exec one-off commands, and connect to managed databases without leaving the terminal.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # wokku-cli
2
2
 
3
- CLI for [Wokku](https://wokku.cloud) — deploy and manage apps, databases, domains, and SSH keys on Wokku.cloud or self-hosted Wokku servers.
3
+ CLI for [Wokku Cloud](https://wokku.cloud) — deploy and manage apps, databases, domains, and SSH keys.
4
+
5
+ > **Wokku Cloud only.** This CLI talks to the Wokku REST API, which ships only with the managed Wokku Cloud product. The open-source Wokku web UI ([github.com/johannesdwicahyo/wokku](https://github.com/johannesdwicahyo/wokku)) does not expose `/api/v1`, so the CLI cannot point at a self-hosted Wokku install. Self-host users should use the web UI directly, or `ssh dokku@your-host` for command-line operations.
4
6
 
5
7
  ## Install
6
8
 
@@ -26,22 +28,47 @@ wokku logs myapp -f
26
28
 
27
29
  ## Commands
28
30
 
29
- Run `wokku --help` for the full list. Highlights:
31
+ Run `wokku --help` for the full list. ~39 first-class commands today, grouped:
30
32
 
31
- - **Apps:** `apps`, `apps:create`, `apps:destroy`, `apps:info`
32
- - **Process:** `ps:start/stop/restart/scale/rebuild`, `redeploy`
33
+ - **Apps:** `apps`, `apps:create`, `apps:destroy`, `apps:info`, `apps:transfer`
34
+ - **Process:** `ps`, `ps:start/stop/restart/scale/rebuild`, `redeploy`
33
35
  - **Config:** `config`, `config:set`, `config:get`, `config:unset`, `config:export`
34
- - **Domains:** `domains`, `domains:add/remove/clear`, `certs:enable`
35
- - **Databases:** `databases`, `databases:create/destroy/link/unlink/info`
36
+ - **Domains + SSL:** `domains`, `domains:add/remove/clear`, `certs:enable`, `certs:disable`
37
+ - **Databases:** `databases`, `databases:create/destroy/link/unlink/info`, `backups`, `backups:create/restore`
36
38
  - **SSH keys:** `ssh-keys`, `ssh-keys:add/remove`
37
- - **Servers:** `servers`, `servers:info`, `servers:default`
38
- - **Logs:** `wokku logs APP --follow`
39
- - **Run / passthrough:** `wokku run APP -- COMMAND`, `wokku do APP -- DOKKU_ARGS`
39
+ - **Servers:** `servers`, `servers:info`, `servers:default` (multi-Dokku-host installs)
40
+ - **Teams:** `teams`, `teams:members`, `teams:invite`, `teams:remove`
41
+ - **Logs:** `wokku logs APP --follow [--tail N]`
42
+ - **Run / passthrough:** `wokku run APP -- COMMAND` (one-off in a fresh container), `wokku do APP -- DOKKU_ARGS` (arbitrary `dokku` CLI passthrough)
43
+
44
+ ### Parity with Dokku
45
+
46
+ `wokku do` is the bridge for the ~110 Dokku subcommands not yet first-classed here. Anything `dokku <something> APP` does, `wokku do APP -- <something>` does too — same exit code, same stdout.
47
+
48
+ If you find yourself running the same `wokku do` invocation repeatedly, open an issue — that's the queue for promoting commands to first-class status.
40
49
 
41
50
  ## Global flags
42
51
 
43
- - `--json` — machine-readable JSON output (read commands)
52
+ - `--json` — machine-readable JSON output (read commands only)
44
53
  - `--quiet` / `-q` — suppress success messages and hints
54
+ - `--server NAME` — target a specific Dokku host on multi-server installs (default: your account's primary)
55
+
56
+ ## Configuration
57
+
58
+ Set once and forget:
59
+
60
+ ```sh
61
+ export WOKKU_API_TOKEN=... # from wokku.cloud/dashboard/profile
62
+ ```
63
+
64
+ `WOKKU_API_URL` defaults to `https://wokku.cloud/api/v1` and shouldn't need to change.
65
+
66
+ ## What's New in v0.2.0 (May 2026)
67
+
68
+ - `apps:transfer` for moving an app between teams
69
+ - `--quiet` flag now also suppresses progress bars (not just success lines) — friendlier in scripts
70
+ - `wokku do` exit codes pass through correctly when wrapped in pipelines (was previously masked to 0)
71
+ - Multi-server defaults — `wokku servers:default` persists per-account, not per-shell
45
72
 
46
73
  ## License
47
74
 
@@ -6,18 +6,25 @@ register "addons", "List add-ons (usage: wokku addons APP)" do
6
6
  data = api(:get, "/apps/#{id}/addons")
7
7
  Wokku::Output.render(data) do |d|
8
8
  if d.is_a?(Array)
9
- table(d.map { |a| { "name" => a["name"], "type" => a["service_type"], "status" => a["status"] } })
9
+ table(d.map { |a|
10
+ {
11
+ "name" => a["name"],
12
+ "type" => a["service_type"],
13
+ "kind" => a["shared"] ? "shared" : "dedicated",
14
+ "status" => a["status"]
15
+ }
16
+ })
10
17
  else
11
18
  puts_json d
12
19
  end
13
20
  end
14
21
  end
15
22
 
16
- register "addons:add", "Add add-on (usage: wokku addons:add APP postgres)" do
23
+ register "addons:add", "[LEGACY pre-Bundle-v2] Add add-on (usage: wokku addons:add APP postgres). Returns 410 under Bundle v2 — use addons:shared:enable or addons:dedicated:upgrade instead." do
17
24
  id = ARGV.shift || abort("Usage: wokku addons:add APP SERVICE_TYPE")
18
25
  service_type = ARGV.shift || abort("Missing service type (postgres, redis, mysql, etc)")
19
26
  name = nil
20
- while arg = ARGV.shift
27
+ while (arg = ARGV.shift)
21
28
  name = ARGV.shift if arg == "--name"
22
29
  end
23
30
  body = { service_type: service_type }
@@ -25,3 +32,31 @@ register "addons:add", "Add add-on (usage: wokku addons:add APP postgres)" do
25
32
  data = api(:post, "/apps/#{id}/addons", body)
26
33
  Wokku::Output.status "Added #{service_type}: #{data['name'] || data['id']}"
27
34
  end
35
+
36
+ # --- Bundle v2 — shared engines ---
37
+ # User-pick at box creation OR via these commands later. Free plan limited
38
+ # to postgres + redis; other plans get all 5 (memcached, rabbitmq, meilisearch
39
+ # also available).
40
+ register "addons:shared:enable", "Enable a shared engine on an app (usage: wokku addons:shared:enable APP ENGINE). ENGINE: postgres|redis|memcached|rabbitmq|meilisearch" do
41
+ id = ARGV.shift || abort("Usage: wokku addons:shared:enable APP ENGINE")
42
+ engine = ARGV.shift || abort("Missing engine")
43
+ data = api(:post, "/apps/#{id}/addons/shared", { engine: engine })
44
+ Wokku::Output.status(data["message"] || "Enabled shared #{engine} on #{id}")
45
+ end
46
+
47
+ register "addons:shared:disable", "Disable a shared engine on an app (usage: wokku addons:shared:disable APP ENGINE)" do
48
+ id = ARGV.shift || abort("Usage: wokku addons:shared:disable APP ENGINE")
49
+ engine = ARGV.shift || abort("Missing engine")
50
+ data = api(:delete, "/apps/#{id}/addons/shared/#{engine}")
51
+ Wokku::Output.status(data["message"] || "Disabled shared #{engine} on #{id}")
52
+ end
53
+
54
+ # --- Bundle v2 — dedicated upgrade ---
55
+ # Pg/Redis migrate from shared (existing data preserved). MySQL/MongoDB
56
+ # are fresh-create. Quota: 3 per plan, size follows the box size.
57
+ register "addons:dedicated:upgrade", "Upgrade a box to a dedicated DB or Redis (usage: wokku addons:dedicated:upgrade APP ENGINE). ENGINE: postgres|mysql|mongodb|redis" do
58
+ id = ARGV.shift || abort("Usage: wokku addons:dedicated:upgrade APP ENGINE")
59
+ engine = ARGV.shift || abort("Missing engine (postgres|mysql|mongodb|redis)")
60
+ data = api(:post, "/apps/#{id}/addons/dedicated", { engine: engine })
61
+ Wokku::Output.status(data["message"] || "Dedicated #{engine} upgrade queued for #{id}")
62
+ end
@@ -14,19 +14,33 @@ register "apps:info", "Show app details (usage: wokku apps:info APP)" do
14
14
  Wokku::Output.render(data) { |d| puts_json d }
15
15
  end
16
16
 
17
- register "apps:create", "Create app (usage: wokku apps:create NAME [--server SERVER] [--branch BRANCH])" do
17
+ register "apps:create", "Create app (usage: wokku apps:create NAME [--server SERVER] [--branch BRANCH] [--box-size SIZE] [--shared pg,redis,...] [--dedicated-db postgres|mysql|mongodb] [--dedicated-redis])" do
18
18
  name = ARGV.shift || abort("Usage: wokku apps:create NAME [--server SERVER]")
19
19
  server = nil
20
20
  branch = "main"
21
- while arg = ARGV.shift
21
+ box_size = nil
22
+ shared = nil
23
+ dedicated_db = nil
24
+ dedicated_redis = false
25
+ while (arg = ARGV.shift)
22
26
  case arg
23
- when "--server" then server = ARGV.shift
24
- when "--branch" then branch = ARGV.shift
27
+ when "--server" then server = ARGV.shift
28
+ when "--branch" then branch = ARGV.shift
29
+ when "--box-size" then box_size = ARGV.shift
30
+ when "--shared" then shared = ARGV.shift # comma-separated engine names
31
+ when "--dedicated-db" then dedicated_db = ARGV.shift
32
+ when "--dedicated-redis" then dedicated_redis = true
25
33
  end
26
34
  end
27
35
  server = resolve_server(explicit: server)
28
- data = api(:post, "/apps", { name: name, server_id: server, deploy_branch: branch })
36
+ body = { name: name, server_id: server, deploy_branch: branch }
37
+ body[:box_size] = box_size if box_size
38
+ body[:enabled_shared_engines] = shared.split(",").map(&:strip) if shared
39
+ body[:dedicated_db_engine] = dedicated_db if dedicated_db
40
+ body[:add_dedicated_redis] = true if dedicated_redis
41
+ data = api(:post, "/apps", body)
29
42
  Wokku::Output.status "Created app: #{data['name']} (id: #{data['id']})"
43
+ Array(data["warnings"]).each { |w| Wokku::Output.warn(w) }
30
44
  end
31
45
 
32
46
  register "apps:destroy", "Delete app (usage: wokku apps:destroy APP)" do
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Wokku MCP commands — install / switch / logout the Wokku MCP server
4
+ # in Claude Code so the user's CLI token gets passed to the plugin.
5
+ # Shells out to `claude mcp` (Claude Code CLI) so we don't need to know
6
+ # Claude Code's exact config-file layout — it changes between versions.
7
+
8
+ MCP_SERVER_NAME = "wokku"
9
+
10
+ def claude_cli_available?
11
+ system("command -v claude >/dev/null 2>&1")
12
+ end
13
+
14
+ def require_claude_cli!
15
+ return if claude_cli_available?
16
+ abort <<~MSG
17
+ The `claude` CLI is not installed.
18
+ Wokku MCP commands shell out to it to write your Claude Code config.
19
+
20
+ Install Claude Code (https://claude.com/claude-code) and retry.
21
+ MSG
22
+ end
23
+
24
+ def require_logged_in!
25
+ return if Wokku::Config.api_token
26
+ abort "Not logged in. Run: wokku auth:login"
27
+ end
28
+
29
+ def install_mcp_entry!
30
+ url = Wokku::Config.api_url
31
+ token = Wokku::Config.api_token
32
+
33
+ # Idempotent — silently no-ops if the entry doesn't exist yet.
34
+ system("claude mcp remove #{Shellwords.escape(MCP_SERVER_NAME)} > /dev/null 2>&1")
35
+
36
+ ok = system(
37
+ "claude", "mcp", "add", MCP_SERVER_NAME,
38
+ "--env", "WOKKU_API_URL=#{url}",
39
+ "--env", "WOKKU_API_TOKEN=#{token}",
40
+ "--", "npx", "-y", "@johannesdwicahyo/wokku-plugin"
41
+ )
42
+ ok or abort "claude mcp add failed — check `claude mcp list` and retry."
43
+ end
44
+
45
+ register "mcp:install", "Add the Wokku MCP server to Claude Code with your CLI token" do
46
+ require_claude_cli!
47
+ require_logged_in!
48
+ require "shellwords"
49
+
50
+ install_mcp_entry!
51
+ Wokku::Output.status "MCP server '#{MCP_SERVER_NAME}' installed in Claude Code."
52
+ Wokku::Output.status "Restart Claude Code, then ask: \"Deploy this project to Wokku\""
53
+ end
54
+
55
+ register "mcp:switch", "Re-push the current CLI token to the Wokku MCP server (after auth:login)" do
56
+ require_claude_cli!
57
+ require_logged_in!
58
+ require "shellwords"
59
+
60
+ install_mcp_entry!
61
+ Wokku::Output.status "MCP server '#{MCP_SERVER_NAME}' now points at the current CLI session."
62
+ Wokku::Output.status "Restart Claude Code for the new token to take effect."
63
+ end
64
+
65
+ register "mcp:logout", "Remove the Wokku MCP server from Claude Code" do
66
+ require_claude_cli!
67
+ require "shellwords"
68
+
69
+ ok = system("claude", "mcp", "remove", MCP_SERVER_NAME)
70
+ if ok
71
+ Wokku::Output.status "MCP server '#{MCP_SERVER_NAME}' removed from Claude Code."
72
+ else
73
+ Wokku::Output.status "No MCP entry named '#{MCP_SERVER_NAME}' to remove."
74
+ end
75
+ end
data/lib/wokku/output.rb CHANGED
@@ -39,5 +39,14 @@ module Wokku
39
39
  return if Wokku.quiet? || Wokku.json?
40
40
  puts message
41
41
  end
42
+
43
+ # Non-fatal warning (e.g. partial-success cases like "app created
44
+ # but the dedicated DB upgrade failed to enqueue"). Stderr so it
45
+ # doesn't pollute pipeable stdout; visible even with --quiet but
46
+ # silenced under --json (the JSON response carries the warning).
47
+ def warn(message)
48
+ return if Wokku.json?
49
+ $stderr.puts "WARNING: #{message}"
50
+ end
42
51
  end
43
52
  end
data/lib/wokku/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Wokku
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wokku-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Dwicahyo
@@ -52,6 +52,7 @@ files:
52
52
  - lib/wokku/commands/do.rb
53
53
  - lib/wokku/commands/domains.rb
54
54
  - lib/wokku/commands/logs.rb
55
+ - lib/wokku/commands/mcp.rb
55
56
  - lib/wokku/commands/ps.rb
56
57
  - lib/wokku/commands/releases.rb
57
58
  - lib/wokku/commands/run.rb