wokku-cli 0.7.0 → 0.9.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: 4dc872124bc4d78ef3fa77530026b1b3b8dc9ca48465b575660bbfa6b872cd00
4
- data.tar.gz: 100d67fadebf85a3f0dd758072bca38fa55e6a3892da888adabd3e73200e6b3d
3
+ metadata.gz: b3597333cab6700ca27a5956994611fae266fb1d575b34063e4aa3b0ce81f224
4
+ data.tar.gz: ef1d8138fe50d785d24fbbce69cd0121f9840f1d15b440b3bcc0b6cfaf3d9627
5
5
  SHA512:
6
- metadata.gz: bd282ef31062f4581c95d513d4debe4692d7f8e26f0465809a43b1b0c6f2ebc870c3a9c4ebe35550d5061f8d026ae4e53a75a28c7524dc9d7b51508ec8b47008
7
- data.tar.gz: 667e796d0392e32f04923a62c20e8257e2c964e09cbe65605bebf2c88a76a1775606a64ea294b11e56ba7252388b727d49cef40fb8f3b15915d159ff14c3bb01
6
+ metadata.gz: 2ac21809795e4cdc1995864fe9e9c3938a4767ff9804b7d9d65445976be5795a379654aa95050443796872044fa526e9f38abeab38e02e5243610f8d67cdab7c
7
+ data.tar.gz: f56048c0cdefd8e318ca8f33f8143d6c0862346b9543d0c5f7704a2ea718b18736acce9361f6933cfb960988acb1b6c40504b8962b9c5a5ae466834c73784250
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 — 2026-11-01
4
+
5
+ - `transfers`, `transfers:accept ID`, `transfers:decline ID`, `transfers:cancel ID` — finish an app transfer without the dashboard.
6
+ - `teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin` — change a member's role.
7
+ - `notifications:test ID` — send a sample message to a notification channel.
8
+ - `databases:resize DB --cpu --memory --disk` and `databases:retry DB`.
9
+ - `billing:invoices` — list invoices; unpaid ones print a link to pay in the dashboard.
10
+
11
+ ## 0.8.0 — 2026-10-23
12
+
13
+ - `incidents [--all] [--app APP]`, `incidents:info ID` — what is down now and recent outages.
14
+ - `alerts:mutes`, `alerts:mute [--app APP] [--event EVENT] [--for 1h|8h|1d]`, `alerts:unmute ID` — per-person push mutes.
15
+ - Coverage gate no longer needs ignores for `dynos.update`/`dynos.replace`/`servers.dokku` (deprecated in the contract).
16
+
3
17
  ## 0.7.0 — 2026-10-23
4
18
 
5
19
  Full API parity for everything customers can do (CI now fails if the CLI falls behind the API contract).
@@ -48,3 +48,34 @@ register "apps:transfer", "Initiate an app transfer to another user (they accept
48
48
  email = data.is_a?(Hash) ? data["recipient_email"] : recipient
49
49
  Wokku::Output.status "Transfer requested. #{email} will receive an email."
50
50
  end
51
+
52
+ register "transfers", "List app transfers waiting on you or on someone else (usage: wokku transfers)" do
53
+ data = api(:get, "/app_transfers")
54
+ data = {} unless data.is_a?(Hash)
55
+ incoming = Array(data["incoming"])
56
+ outgoing = Array(data["outgoing"])
57
+ if incoming.empty? && outgoing.empty?
58
+ Wokku::Output.status "no pending transfers"
59
+ next
60
+ end
61
+ incoming.each { |t| Wokku::Output.status "#{t['id']} incoming #{t['app_name']} from #{t['from_email']} expires #{t['expires_at']}" }
62
+ outgoing.each { |t| Wokku::Output.status "#{t['id']} outgoing #{t['app_name']} to #{t['to_email']} expires #{t['expires_at']}" }
63
+ end
64
+
65
+ register "transfers:accept", "Accept an app transferred to you (usage: wokku transfers:accept TRANSFER_ID)" do
66
+ id = ARGV.shift || abort("Usage: wokku transfers:accept TRANSFER_ID (find it with `wokku transfers`)")
67
+ data = api(:post, "/app_transfers/#{id}/accept")
68
+ Wokku::Output.status "#{data.is_a?(Hash) ? data['app_name'] : 'The app'} is now yours."
69
+ end
70
+
71
+ register "transfers:decline", "Decline an app transferred to you (usage: wokku transfers:decline TRANSFER_ID)" do
72
+ id = ARGV.shift || abort("Usage: wokku transfers:decline TRANSFER_ID (find it with `wokku transfers`)")
73
+ api(:post, "/app_transfers/#{id}/decline")
74
+ Wokku::Output.status "Transfer declined."
75
+ end
76
+
77
+ register "transfers:cancel", "Cancel a transfer you started (usage: wokku transfers:cancel TRANSFER_ID)" do
78
+ id = ARGV.shift || abort("Usage: wokku transfers:cancel TRANSFER_ID (find it with `wokku transfers`)")
79
+ api(:delete, "/app_transfers/#{id}")
80
+ Wokku::Output.status "Transfer cancelled."
81
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # --- Billing (plan; checkout/portal stay in the dashboard) ---
3
+ # --- Billing (plan + invoices; paying stays in the dashboard) ---
4
4
 
5
5
  register "billing:plan", "Show your current Wokku plan + limits (usage: wokku billing:plan)" do
6
6
  data = api(:get, "/billing/current_plan")
@@ -13,3 +13,17 @@ end
13
13
  register "billing:usage", "Retired — usage is now per resource (see billing:plan)" do
14
14
  abort "billing:usage is retired — usage is now per resource; see wokku billing:plan or the dashboard"
15
15
  end
16
+
17
+ register "billing:invoices", "List your invoices; pay unpaid ones in the dashboard (usage: wokku billing:invoices)" do
18
+ data = api(:get, "/billing/invoices")
19
+ rows = data.is_a?(Array) ? data : []
20
+ if rows.empty?
21
+ Wokku::Output.status "no invoices"
22
+ next
23
+ end
24
+ rows.each do |i|
25
+ line = "#{i['reference']} #{i['period']} Rp#{i['amount_idr'].to_i.to_s.reverse.scan(/\d{1,3}/).join('.').reverse} #{i['status']}"
26
+ line += " pay: #{i['pay_url']}" if i["pay_url"]
27
+ Wokku::Output.status line
28
+ end
29
+ end
@@ -91,3 +91,24 @@ register "databases:import", "Import a dump — overwrites the database (usage:
91
91
  data = api_upload(:post, "/databases/#{db}/import", file)
92
92
  Wokku::Output.status(data.is_a?(Hash) && data["message"] ? data["message"] : "Imported.")
93
93
  end
94
+
95
+ register "databases:resize", "Resize a dedicated database; disk only grows (usage: wokku databases:resize DB --cpu 0.5 --memory 1024 --disk 10)" do
96
+ id = ARGV.shift || abort("Usage: wokku databases:resize DB --cpu CPU --memory MB --disk GB")
97
+ body = {}
98
+ while arg = ARGV.shift
99
+ case arg
100
+ when "--cpu" then body[:cpu] = ARGV.shift
101
+ when "--memory" then body[:memory_mb] = ARGV.shift.to_i
102
+ when "--disk" then body[:disk_gb] = ARGV.shift.to_i
103
+ end
104
+ end
105
+ abort "Pass --cpu, --memory and --disk (see `wokku databases:info #{id}` for the current size)" unless body.size == 3
106
+ data = api(:patch, "/databases/#{id}/resize", body)
107
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Resizing.")
108
+ end
109
+
110
+ register "databases:retry", "Retry provisioning a database stuck in error (usage: wokku databases:retry DB)" do
111
+ id = ARGV.shift || abort("Usage: wokku databases:retry DB")
112
+ data = api(:post, "/databases/#{id}/retry")
113
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Retrying.")
114
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "time"
4
+ require "uri"
5
+
6
+ # --- Incidents & alert mutes ---
7
+ # Command files are required at top level, so helper names are prefixed to stay out of the global namespace.
8
+ def incidents_rows(list)
9
+ list.map do |x|
10
+ { "id" => x["id"], "subject" => x["app_name"] || "server #{x['server_id']}", "reason" => x["reason"],
11
+ "started" => x["started_at"].to_s[0..18], "status" => x["open"] ? "OPEN" : "resolved after #{x['duration_seconds']}s" }
12
+ end
13
+ end
14
+
15
+ def incidents_flag_value(name)
16
+ i = ARGV.index(name) or return nil
17
+ ARGV.delete_at(i)
18
+ ARGV.delete_at(i) || abort("Missing value for #{name}")
19
+ end
20
+
21
+ register "incidents", "List incidents (usage: wokku incidents [--all] [--app APP])" do
22
+ query = { state: ARGV.delete("--all") ? "all" : "open" }
23
+ app = incidents_flag_value("--app")
24
+ query[:app_id] = app if app
25
+ data = api(:get, "/incidents?#{URI.encode_www_form(query)}")
26
+ Wokku::Output.render(data) do |d|
27
+ next puts_json(d) unless d.is_a?(Array)
28
+ d.empty? ? puts("No incidents.") : table(incidents_rows(d))
29
+ end
30
+ end
31
+
32
+ register "incidents:info", "Show one incident (usage: wokku incidents:info ID)" do
33
+ id = ARGV.shift || abort("Usage: wokku incidents:info ID")
34
+ data = api(:get, "/incidents/#{id}")
35
+ Wokku::Output.render(data) { |d| puts_json d }
36
+ end
37
+
38
+ register "alerts:mutes", "List your push alert mutes (usage: wokku alerts:mutes)" do
39
+ data = api(:get, "/alert_mutes")
40
+ Wokku::Output.render(data) do |d|
41
+ next puts_json(d) unless d.is_a?(Array)
42
+ next puts("No mutes.") if d.empty?
43
+ table(d.map { |m| { "id" => m["id"], "app" => m["app_name"] || "(all apps)", "event" => m["event"] || "(all events)", "until" => m["until"].to_s[0..18].then { |u| u.empty? ? "(until unmuted)" : u } } })
44
+ end
45
+ end
46
+
47
+ MUTE_UNITS = { "m" => 60, "h" => 3600, "d" => 86_400 }.freeze
48
+
49
+ register "alerts:mute", "Mute push alerts on your phone (usage: wokku alerts:mute [--app APP] [--event EVENT] [--for 1h|8h|1d])" do
50
+ usage = "Usage: wokku alerts:mute [--app APP] [--event EVENT] [--for 1h|8h|1d]"
51
+ body = { app_id: incidents_flag_value("--app"), event: incidents_flag_value("--event") }.compact
52
+ abort "#{usage} (give --app and/or --event)" if body.empty?
53
+ if (span = incidents_flag_value("--for"))
54
+ m = span.match(/\A(\d+)([mhd])\z/) || abort("#{usage} (--for looks like 30m, 8h or 1d)")
55
+ body[:until] = (Time.now + m[1].to_i * MUTE_UNITS[m[2]]).utc.iso8601
56
+ end
57
+ data = api(:post, "/alert_mutes", body)
58
+ Wokku::Output.render(data) { |d| Wokku::Output.status "Muted (#{d['id']})." }
59
+ end
60
+
61
+ register "alerts:unmute", "Remove a push alert mute (usage: wokku alerts:unmute ID)" do
62
+ id = ARGV.shift || abort("Usage: wokku alerts:unmute ID")
63
+ api(:delete, "/alert_mutes/#{id}")
64
+ Wokku::Output.status "Unmuted."
65
+ end
@@ -47,3 +47,9 @@ register "notifications:remove", "Remove a notification (usage: wokku notificati
47
47
  message = data.is_a?(Hash) ? data["message"] : nil
48
48
  Wokku::Output.status(message || "Notification removed.")
49
49
  end
50
+
51
+ register "notifications:test", "Send a test message to a notification channel (usage: wokku notifications:test NOTIFICATION_ID)" do
52
+ id = ARGV.shift || abort("Usage: wokku notifications:test NOTIFICATION_ID")
53
+ data = api(:post, "/notifications/#{id}/test")
54
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Test notification queued.")
55
+ end
@@ -57,3 +57,11 @@ register "teams:members:remove", "Remove a member from a team (usage: wokku team
57
57
  api(:delete, "/teams/#{team_id}/members/#{membership_id}")
58
58
  Wokku::Output.status "Member removed."
59
59
  end
60
+
61
+ register "teams:members:role", "Change a member's role (usage: wokku teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin)" do
62
+ team_id = ARGV.shift || abort("Usage: wokku teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin")
63
+ membership_id = ARGV.shift || abort("Missing MEMBERSHIP_ID. Get it from `wokku teams:members TEAM_ID`.")
64
+ role = ARGV.shift || abort("Missing role: viewer, member or admin")
65
+ data = api(:patch, "/teams/#{team_id}/members/#{membership_id}", { role: role })
66
+ Wokku::Output.status "#{data.is_a?(Hash) ? data['email'] : 'Member'} is now #{data.is_a?(Hash) ? data['role'] : role}."
67
+ end
data/lib/wokku/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Wokku
3
- VERSION = "0.7.0"
3
+ VERSION = "0.9.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.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Dwicahyo
@@ -60,6 +60,7 @@ files:
60
60
  - lib/wokku/commands/domains.rb
61
61
  - lib/wokku/commands/github.rb
62
62
  - lib/wokku/commands/https.rb
63
+ - lib/wokku/commands/incidents.rb
63
64
  - lib/wokku/commands/logs.rb
64
65
  - lib/wokku/commands/maintenance.rb
65
66
  - lib/wokku/commands/mcp.rb