rogiq 0.1.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 +7 -0
- data/exe/rogiq +49 -0
- data/lib/rogiq/cli.rb +51 -0
- data/lib/rogiq/commands/accounts.rb +114 -0
- data/lib/rogiq/commands/ai.rb +71 -0
- data/lib/rogiq/commands/auth.rb +194 -0
- data/lib/rogiq/commands/base.rb +26 -0
- data/lib/rogiq/commands/billing.rb +90 -0
- data/lib/rogiq/commands/billing_stripe.rb +15 -0
- data/lib/rogiq/commands/clients.rb +117 -0
- data/lib/rogiq/commands/content.rb +71 -0
- data/lib/rogiq/commands/diagnose.rb +134 -0
- data/lib/rogiq/commands/jobs.rb +126 -0
- data/lib/rogiq/commands/queue.rb +115 -0
- data/lib/rogiq/commands/security.rb +33 -0
- data/lib/rogiq/commands/seo.rb +49 -0
- data/lib/rogiq/commands/seo_audit.rb +51 -0
- data/lib/rogiq/commands/status.rb +166 -0
- data/lib/rogiq/commands/sync.rb +60 -0
- data/lib/rogiq/config_store.rb +59 -0
- data/lib/rogiq/formatters.rb +103 -0
- data/lib/rogiq/helpers.rb +53 -0
- data/lib/rogiq/http_api.rb +81 -0
- data/lib/rogiq/rails_loader.rb +22 -0
- data/lib/rogiq/remote/accounts.rb +38 -0
- data/lib/rogiq/remote/ai.rb +50 -0
- data/lib/rogiq/remote/billing.rb +39 -0
- data/lib/rogiq/remote/clients.rb +44 -0
- data/lib/rogiq/remote/command_base.rb +41 -0
- data/lib/rogiq/remote/content.rb +37 -0
- data/lib/rogiq/remote/diagnose.rb +24 -0
- data/lib/rogiq/remote/jobs.rb +52 -0
- data/lib/rogiq/remote/queue.rb +72 -0
- data/lib/rogiq/remote/security.rb +26 -0
- data/lib/rogiq/remote/seo.rb +32 -0
- data/lib/rogiq/remote/status.rb +35 -0
- data/lib/rogiq/remote/sync.rb +49 -0
- data/lib/rogiq/remote_cli.rb +73 -0
- data/lib/rogiq/version.rb +5 -0
- metadata +96 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Billing < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "coins IDENTIFIER", "Rogue coin wallet + recent transactions"
|
|
9
|
+
def coins(identifier)
|
|
10
|
+
emit(api.get("/api/v1/cli/billing/coins", { identifier: identifier }))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "overages", "Pending usage overages (all accounts)"
|
|
14
|
+
method_option :limit, type: :numeric, default: 50
|
|
15
|
+
def overages
|
|
16
|
+
emit(api.get("/api/v1/cli/billing/overages", { limit: options[:limit] }))
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc "invoices IDENTIFIER", "Recent invoices"
|
|
20
|
+
method_option :limit, type: :numeric, default: 20
|
|
21
|
+
def invoices(identifier)
|
|
22
|
+
emit(api.get("/api/v1/cli/billing/invoices", { identifier: identifier, limit: options[:limit] }))
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
desc "summary", "Enqueue Billing::DailyBillingSummaryJob (Slack)"
|
|
26
|
+
method_option :date, type: :string, desc: "YYYY-MM-DD (optional)"
|
|
27
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
28
|
+
def summary
|
|
29
|
+
unless options[:yes]
|
|
30
|
+
exit 1 unless yes?("Enqueue Billing::DailyBillingSummaryJob?")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
body = { confirm: true }
|
|
34
|
+
body[:date] = options[:date] unless options[:date].to_s.strip.empty?
|
|
35
|
+
emit(api.post("/api/v1/cli/billing/summary", body))
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Clients < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "list", "List recent clients"
|
|
9
|
+
method_option :limit, type: :numeric, default: 25, aliases: "-n"
|
|
10
|
+
method_option :search, type: :string
|
|
11
|
+
def list
|
|
12
|
+
q = { limit: options[:limit] }
|
|
13
|
+
q[:search] = options[:search] unless options[:search].to_s.strip.empty?
|
|
14
|
+
emit(api.get("/api/v1/cli/clients/list", q))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
desc "show IDENTIFIER", "Show client by id, uuid, name, or account slug"
|
|
18
|
+
def show(identifier)
|
|
19
|
+
emit(api.get("/api/v1/cli/clients/show", { identifier: identifier }))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
desc "research_status IDENTIFIER", "client_settings research_status JSON"
|
|
23
|
+
map "research-status" => :research_status
|
|
24
|
+
def research_status(identifier)
|
|
25
|
+
emit(api.get("/api/v1/cli/clients/research_status", { identifier: identifier }))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "settings IDENTIFIER", "List client_settings rows"
|
|
29
|
+
def settings(identifier)
|
|
30
|
+
emit(api.get("/api/v1/cli/clients/settings", { identifier: identifier }))
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
desc "onboarding IDENTIFIER", "Latest onboarding evaluation / version"
|
|
34
|
+
def onboarding(identifier)
|
|
35
|
+
emit(api.get("/api/v1/cli/clients/onboarding", { identifier: identifier }))
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
desc "subdomain IDENTIFIER", "Account slug + custom domains"
|
|
39
|
+
def subdomain(identifier)
|
|
40
|
+
emit(api.get("/api/v1/cli/clients/subdomain", { identifier: identifier }))
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "thor"
|
|
4
|
+
|
|
5
|
+
require "rogiq/formatters"
|
|
6
|
+
require "rogiq/http_api"
|
|
7
|
+
|
|
8
|
+
module RogIQ
|
|
9
|
+
module Remote
|
|
10
|
+
class CommandBase < Thor
|
|
11
|
+
class_option :format,
|
|
12
|
+
aliases: "-f",
|
|
13
|
+
type: :string,
|
|
14
|
+
default: "table",
|
|
15
|
+
enum: %w[table json],
|
|
16
|
+
desc: "Output format"
|
|
17
|
+
class_option :quiet,
|
|
18
|
+
type: :boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
desc: "Suppress non-error output"
|
|
21
|
+
|
|
22
|
+
no_tasks do
|
|
23
|
+
def fmt
|
|
24
|
+
@fmt ||= RogIQ::Formatters.new(format: options[:format], quiet: options[:quiet])
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def api
|
|
28
|
+
@api ||= RogIQ::HttpApi.from_config!
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def emit(data)
|
|
32
|
+
if data.is_a?(Hash) && data["headers"] && data["rows"]
|
|
33
|
+
fmt.output(headers: data["headers"], rows: data["rows"])
|
|
34
|
+
else
|
|
35
|
+
fmt.output(data)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Content < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "status IDENTIFIER", "ContentItem counts by state"
|
|
9
|
+
def status(identifier)
|
|
10
|
+
emit(api.get("/api/v1/cli/content/status", { identifier: identifier }))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "heal IDENTIFIER", "Enqueue DataHealingOrchestratorJob for a client"
|
|
14
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
15
|
+
def heal(identifier)
|
|
16
|
+
unless options[:yes]
|
|
17
|
+
exit 1 unless yes?("Enqueue DataHealingOrchestratorJob for #{identifier}?")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
emit(api.post("/api/v1/cli/content/heal", { identifier: identifier, confirm: true }))
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "publish_queue", "Scheduled content publications (future)"
|
|
24
|
+
map "publish-queue" => :publish_queue
|
|
25
|
+
method_option :limit, type: :numeric, default: 40
|
|
26
|
+
def publish_queue
|
|
27
|
+
emit(api.get("/api/v1/cli/content/publish_queue", { limit: options[:limit] }))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
desc "failed IDENTIFIER", "Content items in failed or rejected state"
|
|
31
|
+
method_option :limit, type: :numeric, default: 30
|
|
32
|
+
def failed(identifier)
|
|
33
|
+
emit(api.get("/api/v1/cli/content/failed", { identifier: identifier, limit: options[:limit] }))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Diagnose < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "emergency IDENTIFIER", "Client diagnostic (research, queue jobs, settings)"
|
|
9
|
+
def emergency(identifier)
|
|
10
|
+
emit(api.get("/api/v1/cli/diagnose/emergency", { identifier: identifier }))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "migrations", "Pending schema migrations"
|
|
14
|
+
def migrations
|
|
15
|
+
emit(api.get("/api/v1/cli/diagnose/migrations"))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "pinecone", "Pinecone configuration summary"
|
|
19
|
+
def pinecone
|
|
20
|
+
emit(api.get("/api/v1/cli/diagnose/pinecone"))
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "cgi"
|
|
4
|
+
|
|
5
|
+
require "rogiq/remote/command_base"
|
|
6
|
+
|
|
7
|
+
module RogIQ
|
|
8
|
+
module Remote
|
|
9
|
+
class Jobs < RogIQ::Remote::CommandBase
|
|
10
|
+
desc "list", "Summarize Solid Queue job states"
|
|
11
|
+
method_option :failed, type: :boolean, default: false
|
|
12
|
+
method_option :class, type: :string, desc: "Filter by Active Job class name"
|
|
13
|
+
method_option :limit, type: :numeric, default: 50
|
|
14
|
+
def list
|
|
15
|
+
q = {}
|
|
16
|
+
q[:failed] = true if options[:failed]
|
|
17
|
+
q[:class_name] = options[:class] unless options[:class].to_s.strip.empty?
|
|
18
|
+
q[:limit] = options[:limit] if options[:failed]
|
|
19
|
+
emit(api.get("/api/v1/cli/jobs/list", q))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
desc "detail ID", "Show full error / metadata for a failed execution"
|
|
23
|
+
map "inspect" => :detail
|
|
24
|
+
def detail(id)
|
|
25
|
+
emit(api.get("/api/v1/cli/jobs/detail/#{seg(id)}"))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "retry ID", "Retry a failed execution"
|
|
29
|
+
map "retry" => :retry_job
|
|
30
|
+
def retry_job(id)
|
|
31
|
+
emit(api.post("/api/v1/cli/jobs/retry/#{seg(id)}"))
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
desc "discard ID", "Discard a failed execution"
|
|
35
|
+
map "discard" => :discard_one
|
|
36
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
37
|
+
def discard_one(id)
|
|
38
|
+
unless options[:yes]
|
|
39
|
+
exit 1 unless yes?("Discard failed execution #{id}?")
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
emit(api.post("/api/v1/cli/jobs/discard/#{seg(id)}", { confirm: true }))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
private
|
|
46
|
+
|
|
47
|
+
def seg(id)
|
|
48
|
+
CGI.escape(id.to_s).gsub("+", "%20")
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "cgi"
|
|
4
|
+
|
|
5
|
+
require "rogiq/remote/command_base"
|
|
6
|
+
|
|
7
|
+
module RogIQ
|
|
8
|
+
module Remote
|
|
9
|
+
class Queue < RogIQ::Remote::CommandBase
|
|
10
|
+
desc "stats", "Solid Queue counts"
|
|
11
|
+
method_option :by_class, type: :boolean, default: false, aliases: "-c", desc: "Break down unfinished jobs by class"
|
|
12
|
+
def stats
|
|
13
|
+
q = {}
|
|
14
|
+
q[:by_class] = true if options[:by_class]
|
|
15
|
+
emit(api.get("/api/v1/cli/queue/stats", q))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "flush", "Discard failed executions"
|
|
19
|
+
method_option :class, type: :string, required: false, desc: "Limit to Active Job class name"
|
|
20
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
21
|
+
def flush
|
|
22
|
+
unless options[:yes]
|
|
23
|
+
exit 1 unless yes?("Discard failed executions?")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
body = { confirm: true }
|
|
27
|
+
body[:class_name] = options[:class] unless options[:class].to_s.strip.empty?
|
|
28
|
+
emit(api.post("/api/v1/cli/queue/flush", body))
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
desc "retry_all", "Retry all failed jobs"
|
|
32
|
+
map "retry-all" => :retry_all
|
|
33
|
+
method_option :class, type: :string, required: false
|
|
34
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
35
|
+
def retry_all
|
|
36
|
+
unless options[:yes]
|
|
37
|
+
exit 1 unless yes?("Retry all failed jobs?")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
body = { confirm: true }
|
|
41
|
+
body[:class_name] = options[:class] unless options[:class].to_s.strip.empty?
|
|
42
|
+
emit(api.post("/api/v1/cli/queue/retry_all", body))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc "pause QUEUE_NAME", "Pause a queue"
|
|
46
|
+
def pause(queue_name)
|
|
47
|
+
emit(api.post("/api/v1/cli/queue/pause/#{escape_queue_path(queue_name)}"))
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
desc "resume QUEUE_NAME", "Resume a queue"
|
|
51
|
+
def resume(queue_name)
|
|
52
|
+
emit(api.post("/api/v1/cli/queue/resume/#{escape_queue_path(queue_name)}"))
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
desc "drain", "Clear ready/scheduled/blocked (dangerous)"
|
|
56
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
57
|
+
def drain
|
|
58
|
+
unless options[:yes]
|
|
59
|
+
exit 1 unless yes?("Clear ready, scheduled, and blocked executions?")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
emit(api.post("/api/v1/cli/queue/drain", { confirm: true }))
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
def escape_queue_path(name)
|
|
68
|
+
CGI.escape(name.to_s).gsub("+", "%20")
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Security < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "policy", "SecurityPolicy settings across all accounts"
|
|
9
|
+
def policy
|
|
10
|
+
emit(api.get("/api/v1/cli/security/policy"))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "scan", "Run Brakeman locally (source required — cannot run remotely)"
|
|
14
|
+
def scan
|
|
15
|
+
fmt.error_msg("'security scan' must run locally (static analysis needs source). Use: ROGIQ_LOCAL=1 rogiq security scan")
|
|
16
|
+
exit 1
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc "audit", "Run bundler-audit locally (cannot run remotely)"
|
|
20
|
+
def audit
|
|
21
|
+
fmt.error_msg("'security audit' must run locally. Use: ROGIQ_LOCAL=1 rogiq security audit")
|
|
22
|
+
exit 1
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Seo < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "keywords IDENTIFIER", "SEO track keywords for a client"
|
|
9
|
+
def keywords(identifier)
|
|
10
|
+
emit(api.get("/api/v1/cli/seo/keywords", { identifier: identifier }))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "insights IDENTIFIER", "Search insight counts by status"
|
|
14
|
+
def insights(identifier)
|
|
15
|
+
emit(api.get("/api/v1/cli/seo/insights", { identifier: identifier }))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "audit_run IDENTIFIER", "Kick off a new SEO module audit run"
|
|
19
|
+
map "audit-run" => :audit_run
|
|
20
|
+
def audit_run(identifier)
|
|
21
|
+
emit(api.post("/api/v1/cli/seo/audit_run", { identifier: identifier }))
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc "audit_status IDENTIFIER", "Recent SEO audit run statuses"
|
|
25
|
+
map "audit-status" => :audit_status
|
|
26
|
+
method_option :limit, type: :numeric, default: 15
|
|
27
|
+
def audit_status(identifier)
|
|
28
|
+
emit(api.get("/api/v1/cli/seo/audit_status", { identifier: identifier, limit: options[:limit] }))
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Status < RogIQ::Remote::CommandBase
|
|
8
|
+
default_task :dashboard
|
|
9
|
+
|
|
10
|
+
desc "dashboard", "System health (remote)"
|
|
11
|
+
method_option :ping, type: :boolean, default: false, desc: "HTTP GET /up only"
|
|
12
|
+
method_option :queues, type: :boolean, default: false
|
|
13
|
+
method_option :db, type: :boolean, default: false
|
|
14
|
+
method_option :redis, type: :boolean, default: false
|
|
15
|
+
method_option :ai, type: :boolean, default: false
|
|
16
|
+
method_option :host, type: :string, default: nil, desc: "Base URL for --ping"
|
|
17
|
+
|
|
18
|
+
def dashboard
|
|
19
|
+
if options[:ping]
|
|
20
|
+
q = { ping: true }
|
|
21
|
+
q[:host] = options[:host] unless options[:host].to_s.strip.empty?
|
|
22
|
+
emit(api.get("/api/v1/cli/status/dashboard", q))
|
|
23
|
+
return
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
q = {}
|
|
27
|
+
q[:queues] = true if options[:queues]
|
|
28
|
+
q[:db] = true if options[:db]
|
|
29
|
+
q[:redis] = true if options[:redis]
|
|
30
|
+
q[:ai] = true if options[:ai]
|
|
31
|
+
emit(api.get("/api/v1/cli/status/dashboard", q))
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rogiq/remote/command_base"
|
|
4
|
+
|
|
5
|
+
module RogIQ
|
|
6
|
+
module Remote
|
|
7
|
+
class Sync < RogIQ::Remote::CommandBase
|
|
8
|
+
desc "wordpress IDENTIFIER", "Enqueue WordPress taxonomy + author sync"
|
|
9
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
10
|
+
def wordpress(identifier)
|
|
11
|
+
unless options[:yes]
|
|
12
|
+
exit 1 unless yes?("Enqueue WordPress sync for #{identifier}?")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
emit(api.post("/api/v1/cli/sync/wordpress", { identifier: identifier, confirm: true }))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "integrations IDENTIFIER", "Enqueue Integrations::SyncJob for each client integration"
|
|
19
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
20
|
+
def integrations(identifier)
|
|
21
|
+
unless options[:yes]
|
|
22
|
+
exit 1 unless yes?("Enqueue integration sync for #{identifier}?")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
emit(api.post("/api/v1/cli/sync/integrations", { identifier: identifier, confirm: true }))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "postman", "Invoke postman:sync Rake task on the server"
|
|
29
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
30
|
+
def postman
|
|
31
|
+
unless options[:yes]
|
|
32
|
+
exit 1 unless yes?("Run postman:sync on the server?")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
emit(api.post("/api/v1/cli/sync/postman", { confirm: true }))
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
desc "stripe", "Invoke stripe:ensure_subscription_prices Rake task on the server"
|
|
39
|
+
method_option :yes, type: :boolean, default: false, aliases: "-y"
|
|
40
|
+
def stripe
|
|
41
|
+
unless options[:yes]
|
|
42
|
+
exit 1 unless yes?("Run stripe:ensure_subscription_prices on the server?")
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
emit(api.post("/api/v1/cli/sync/stripe", { confirm: true }))
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "thor"
|
|
4
|
+
|
|
5
|
+
require "rogiq/version"
|
|
6
|
+
require "rogiq/remote/accounts"
|
|
7
|
+
require "rogiq/remote/ai"
|
|
8
|
+
require "rogiq/remote/billing"
|
|
9
|
+
require "rogiq/remote/clients"
|
|
10
|
+
require "rogiq/remote/content"
|
|
11
|
+
require "rogiq/remote/diagnose"
|
|
12
|
+
require "rogiq/remote/jobs"
|
|
13
|
+
require "rogiq/remote/queue"
|
|
14
|
+
require "rogiq/remote/security"
|
|
15
|
+
require "rogiq/remote/seo"
|
|
16
|
+
require "rogiq/remote/status"
|
|
17
|
+
require "rogiq/remote/sync"
|
|
18
|
+
|
|
19
|
+
module RogIQ
|
|
20
|
+
class RemoteCLI < Thor
|
|
21
|
+
package_name "RogIQ"
|
|
22
|
+
|
|
23
|
+
desc "version", "Print rogiq version"
|
|
24
|
+
map %w[--version -v] => :version
|
|
25
|
+
def version
|
|
26
|
+
puts RogIQ::VERSION
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
desc "status SUBCOMMAND ...", "System health (remote API)"
|
|
30
|
+
subcommand "status", RogIQ::Remote::Status
|
|
31
|
+
|
|
32
|
+
desc "queue SUBCOMMAND ...", "Solid Queue (remote API)"
|
|
33
|
+
subcommand "queue", RogIQ::Remote::Queue
|
|
34
|
+
|
|
35
|
+
desc "jobs SUBCOMMAND ...", "Solid Queue jobs (remote API)"
|
|
36
|
+
subcommand "jobs", RogIQ::Remote::Jobs
|
|
37
|
+
|
|
38
|
+
desc "clients SUBCOMMAND ...", "Clients (remote API)"
|
|
39
|
+
subcommand "clients", RogIQ::Remote::Clients
|
|
40
|
+
|
|
41
|
+
desc "accounts SUBCOMMAND ...", "Accounts (remote API)"
|
|
42
|
+
subcommand "accounts", RogIQ::Remote::Accounts
|
|
43
|
+
|
|
44
|
+
desc "ai SUBCOMMAND ...", "AI usage & models (remote API)"
|
|
45
|
+
subcommand "ai", RogIQ::Remote::Ai
|
|
46
|
+
|
|
47
|
+
desc "billing SUBCOMMAND ...", "Billing / coins / invoices (remote API)"
|
|
48
|
+
subcommand "billing", RogIQ::Remote::Billing
|
|
49
|
+
|
|
50
|
+
desc "diagnose SUBCOMMAND ...", "Diagnostics (remote API)"
|
|
51
|
+
subcommand "diagnose", RogIQ::Remote::Diagnose
|
|
52
|
+
|
|
53
|
+
desc "seo SUBCOMMAND ...", "SEO keywords, insights, audit (remote API)"
|
|
54
|
+
subcommand "seo", RogIQ::Remote::Seo
|
|
55
|
+
|
|
56
|
+
desc "content SUBCOMMAND ...", "Content pipeline (remote API)"
|
|
57
|
+
subcommand "content", RogIQ::Remote::Content
|
|
58
|
+
|
|
59
|
+
desc "sync SUBCOMMAND ...", "WordPress / integrations / Rake sync (remote API)"
|
|
60
|
+
subcommand "sync", RogIQ::Remote::Sync
|
|
61
|
+
|
|
62
|
+
desc "security SUBCOMMAND ...", "Security policy (remote API)"
|
|
63
|
+
subcommand "security", RogIQ::Remote::Security
|
|
64
|
+
|
|
65
|
+
long_desc <<~TXT
|
|
66
|
+
Commands call #{ENV.fetch("ROGIQ_API_URL", "https://api.rogiq.ai")}/api/v1/cli/* using ~/.rogiq/config.yml.
|
|
67
|
+
|
|
68
|
+
Authenticate: rogiq login
|
|
69
|
+
|
|
70
|
+
Run the full local Rails CLI from the api app directory: ROGIQ_LOCAL=1 rogiq ...
|
|
71
|
+
TXT
|
|
72
|
+
end
|
|
73
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rogiq
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- RogIQ
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: thor
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '1.2'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '1.2'
|
|
26
|
+
description: Remote CLI for RogIQ — manage queues, jobs, clients, billing, SEO, content,
|
|
27
|
+
and AI from any machine.
|
|
28
|
+
email:
|
|
29
|
+
- team@rogiq.com
|
|
30
|
+
executables:
|
|
31
|
+
- rogiq
|
|
32
|
+
extensions: []
|
|
33
|
+
extra_rdoc_files: []
|
|
34
|
+
files:
|
|
35
|
+
- exe/rogiq
|
|
36
|
+
- lib/rogiq/cli.rb
|
|
37
|
+
- lib/rogiq/commands/accounts.rb
|
|
38
|
+
- lib/rogiq/commands/ai.rb
|
|
39
|
+
- lib/rogiq/commands/auth.rb
|
|
40
|
+
- lib/rogiq/commands/base.rb
|
|
41
|
+
- lib/rogiq/commands/billing.rb
|
|
42
|
+
- lib/rogiq/commands/billing_stripe.rb
|
|
43
|
+
- lib/rogiq/commands/clients.rb
|
|
44
|
+
- lib/rogiq/commands/content.rb
|
|
45
|
+
- lib/rogiq/commands/diagnose.rb
|
|
46
|
+
- lib/rogiq/commands/jobs.rb
|
|
47
|
+
- lib/rogiq/commands/queue.rb
|
|
48
|
+
- lib/rogiq/commands/security.rb
|
|
49
|
+
- lib/rogiq/commands/seo.rb
|
|
50
|
+
- lib/rogiq/commands/seo_audit.rb
|
|
51
|
+
- lib/rogiq/commands/status.rb
|
|
52
|
+
- lib/rogiq/commands/sync.rb
|
|
53
|
+
- lib/rogiq/config_store.rb
|
|
54
|
+
- lib/rogiq/formatters.rb
|
|
55
|
+
- lib/rogiq/helpers.rb
|
|
56
|
+
- lib/rogiq/http_api.rb
|
|
57
|
+
- lib/rogiq/rails_loader.rb
|
|
58
|
+
- lib/rogiq/remote/accounts.rb
|
|
59
|
+
- lib/rogiq/remote/ai.rb
|
|
60
|
+
- lib/rogiq/remote/billing.rb
|
|
61
|
+
- lib/rogiq/remote/clients.rb
|
|
62
|
+
- lib/rogiq/remote/command_base.rb
|
|
63
|
+
- lib/rogiq/remote/content.rb
|
|
64
|
+
- lib/rogiq/remote/diagnose.rb
|
|
65
|
+
- lib/rogiq/remote/jobs.rb
|
|
66
|
+
- lib/rogiq/remote/queue.rb
|
|
67
|
+
- lib/rogiq/remote/security.rb
|
|
68
|
+
- lib/rogiq/remote/seo.rb
|
|
69
|
+
- lib/rogiq/remote/status.rb
|
|
70
|
+
- lib/rogiq/remote/sync.rb
|
|
71
|
+
- lib/rogiq/remote_cli.rb
|
|
72
|
+
- lib/rogiq/version.rb
|
|
73
|
+
homepage: https://api.rogiq.ai
|
|
74
|
+
licenses:
|
|
75
|
+
- MIT
|
|
76
|
+
metadata:
|
|
77
|
+
homepage_uri: https://api.rogiq.ai
|
|
78
|
+
source_code_uri: https://github.com/haley-marketing-group/rogIQ2
|
|
79
|
+
rdoc_options: []
|
|
80
|
+
require_paths:
|
|
81
|
+
- lib
|
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '3.2'
|
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
|
+
requirements:
|
|
89
|
+
- - ">="
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: '0'
|
|
92
|
+
requirements: []
|
|
93
|
+
rubygems_version: 4.0.8
|
|
94
|
+
specification_version: 4
|
|
95
|
+
summary: RogIQ operations CLI
|
|
96
|
+
test_files: []
|