hiiro 0.1.177 → 0.1.178
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 +4 -4
- data/lib/hiiro/service_manager.rb +58 -2
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +12 -16
- data/obsidian_slides.md +168 -6
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de1d90b71b5d5e6058baf2b4ad0c1399e497c601332e2f7e77bc699a015bb122
|
|
4
|
+
data.tar.gz: 9d87f01f8e5e351a58661be8e9f662b6a3580393cda91a3414b5f04fa87f4e1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db6fb00b7dbaa5804f9d2388da8843323c95cc1f61bd360672a40428a3fe1c2465cd6cad84ede33e3a63a6ade561f409dd7653a50da498f9062d190eece07d61
|
|
7
|
+
data.tar.gz: 723c8a476856131eb9938472ff7026a1dd1f5ab99bfd54c17297a9650dd88332ef99ed98f6dd50879ce4897c56b6dc6821f7fdd201e3fd3a22307fa73a9425c7
|
|
@@ -111,6 +111,50 @@ class Hiiro
|
|
|
111
111
|
true
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
def stop_group(name)
|
|
115
|
+
group = find_group(name)
|
|
116
|
+
unless group
|
|
117
|
+
puts "Group '#{name}' not found"
|
|
118
|
+
return false
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
members = group[:services]
|
|
122
|
+
unless members && !members.empty?
|
|
123
|
+
puts "Group '#{group[:name]}' has no services"
|
|
124
|
+
return false
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
puts "Stopping group '#{group[:name]}'..."
|
|
128
|
+
|
|
129
|
+
members.each do |member|
|
|
130
|
+
member_name = member['name'] || member[:name]
|
|
131
|
+
stop(member_name)
|
|
132
|
+
end
|
|
133
|
+
true
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def reset_group(name)
|
|
137
|
+
group = find_group(name)
|
|
138
|
+
unless group
|
|
139
|
+
puts "Group '#{name}' not found"
|
|
140
|
+
return false
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
members = group[:services]
|
|
144
|
+
unless members && !members.empty?
|
|
145
|
+
puts "Group '#{group[:name]}' has no services"
|
|
146
|
+
return false
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
puts "Resetting group '#{group[:name]}'..."
|
|
150
|
+
|
|
151
|
+
members.each do |member|
|
|
152
|
+
member_name = member['name'] || member[:name]
|
|
153
|
+
reset(member_name)
|
|
154
|
+
end
|
|
155
|
+
true
|
|
156
|
+
end
|
|
157
|
+
|
|
114
158
|
def running?(name)
|
|
115
159
|
state = load_state
|
|
116
160
|
state.key?(name)
|
|
@@ -477,7 +521,13 @@ class Hiiro
|
|
|
477
521
|
next unless svc_name
|
|
478
522
|
end
|
|
479
523
|
|
|
480
|
-
|
|
524
|
+
# Check if it's a group or individual service
|
|
525
|
+
group = sm.find_group(svc_name)
|
|
526
|
+
if group
|
|
527
|
+
sm.stop_group(svc_name)
|
|
528
|
+
else
|
|
529
|
+
sm.stop(svc_name)
|
|
530
|
+
end
|
|
481
531
|
end
|
|
482
532
|
|
|
483
533
|
h.add_subcmd(:reset) do |svc_name=nil|
|
|
@@ -491,7 +541,13 @@ class Hiiro
|
|
|
491
541
|
next unless svc_name
|
|
492
542
|
end
|
|
493
543
|
|
|
494
|
-
|
|
544
|
+
# Check if it's a group or individual service
|
|
545
|
+
group = sm.find_group(svc_name)
|
|
546
|
+
if group
|
|
547
|
+
sm.reset_group(svc_name)
|
|
548
|
+
else
|
|
549
|
+
sm.reset(svc_name)
|
|
550
|
+
end
|
|
495
551
|
end
|
|
496
552
|
|
|
497
553
|
h.add_subcmd(:clean) do
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
|
@@ -486,34 +486,30 @@ class Hiiro
|
|
|
486
486
|
cmd&.run(*args)
|
|
487
487
|
end
|
|
488
488
|
|
|
489
|
+
def subcmd_result
|
|
490
|
+
return nil unless subcmd
|
|
491
|
+
@subcmd_result ||= Matcher.by_prefix(all_runners, subcmd.to_s, key: :subcommand_name)
|
|
492
|
+
end
|
|
493
|
+
|
|
489
494
|
def exact_runner
|
|
490
|
-
|
|
495
|
+
subcmd_result&.exact_match&.item
|
|
491
496
|
end
|
|
492
497
|
|
|
493
498
|
def unambiguous_runner
|
|
494
|
-
return nil
|
|
495
|
-
|
|
499
|
+
return nil unless subcmd_result
|
|
496
500
|
matches = matching_runners
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
nil
|
|
501
|
+
matches.first if matches.count == 1
|
|
500
502
|
end
|
|
501
503
|
|
|
502
504
|
def ambiguous_matches
|
|
503
|
-
return []
|
|
504
|
-
|
|
505
|
+
return [] unless subcmd_result
|
|
505
506
|
matches = matching_runners
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
[]
|
|
507
|
+
matches.count > 1 ? matches : []
|
|
509
508
|
end
|
|
510
509
|
|
|
511
510
|
def matching_runners
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
def all_matching_runners
|
|
516
|
-
all_runners.select { |r| r.match?(subcmd) }
|
|
511
|
+
return [] unless subcmd_result
|
|
512
|
+
remove_child_runners(subcmd_result.matches.map(&:item))
|
|
517
513
|
end
|
|
518
514
|
|
|
519
515
|
def remove_child_runners(list)
|
data/obsidian_slides.md
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
## `hiiro`
|
|
2
2
|
|
|
3
3
|
New AI Workflow Utilities
|
|
4
|
-
---
|
|
5
|
-
> Technology is supposed to make our lives easier, allowing us to do things more quickly and efficiently.
|
|
6
|
-
> - James Surowiecki
|
|
7
|
-
|
|
8
4
|
---
|
|
9
5
|
#### Pain Points
|
|
10
6
|
|
|
11
7
|
Thanks to AI, some pain points are becoming increasingly more common.
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
I've added 2 new features to `hiiro` that help to relieve some of the pain related to these issues.
|
|
9
|
+
I've added some new features to `hiiro` that help to relieve some of the pain related to these issues.
|
|
15
10
|
|
|
16
11
|
---
|
|
17
12
|
#### Pain Points (cont'd)
|
|
@@ -23,3 +18,170 @@ I've added 2 new features to `hiiro` that help to relieve some of the pain relat
|
|
|
23
18
|
- `h service`
|
|
24
19
|
|
|
25
20
|
---
|
|
21
|
+
#### hiiro recap
|
|
22
|
+
|
|
23
|
+
hiiro is...
|
|
24
|
+
|
|
25
|
+
- a ruby lib for quickly making cli tools that are:
|
|
26
|
+
- subcommand driven
|
|
27
|
+
- infinitely extensible
|
|
28
|
+
- discoverable
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
#!/usr/bin/env ruby
|
|
32
|
+
|
|
33
|
+
require "hiiro"
|
|
34
|
+
|
|
35
|
+
Hiiro.run do
|
|
36
|
+
add_subcmd(:hello) {
|
|
37
|
+
puts "hello world"
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
#### `h task` & `h subtask`
|
|
44
|
+
|
|
45
|
+
abstracts away git worktrees and tmux sessions
|
|
46
|
+
as tasks
|
|
47
|
+
|
|
48
|
+
- no need to...
|
|
49
|
+
- manually manage git worktrees
|
|
50
|
+
- or use tmux to create/switch to different sessions
|
|
51
|
+
|
|
52
|
+
each tmux session is:
|
|
53
|
+
- automatically scoped to the associated worktree
|
|
54
|
+
- no need to remember where different worktrees are located
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
#### `h task` & `h subtask` (cont'd)
|
|
59
|
+
|
|
60
|
+
main commands:
|
|
61
|
+
|
|
62
|
+
- `h task ls`
|
|
63
|
+
- `h task start TASK_NAME [APP_NAME]`
|
|
64
|
+
- `h task switch TASK_NAME`
|
|
65
|
+
- `h task stop TASK_NAME`
|
|
66
|
+
- `h task cd APP_NAME`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
### `h queue` - Context Switching
|
|
70
|
+
|
|
71
|
+
I recently added `h queue`
|
|
72
|
+
|
|
73
|
+
It is basically a daemon that watches for new "prompts"
|
|
74
|
+
to hit the queue. When it has one, it kicks off a
|
|
75
|
+
new claude session with that prompt.
|
|
76
|
+
|
|
77
|
+
The sessions are added as new windows to the `hq`
|
|
78
|
+
tmux session.
|
|
79
|
+
|
|
80
|
+
Easily switch to that tmux session with: `h queue session`
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
### `h queue` (cont'd)
|
|
84
|
+
|
|
85
|
+
main subcommands:
|
|
86
|
+
|
|
87
|
+
- `h queue watch` - start the daemon
|
|
88
|
+
- `h queue ls` - list prompts and their status
|
|
89
|
+
- `h queue add [optional_prompt]` - open tempfile in EDITOR, on quit, queue prompt
|
|
90
|
+
- `h queue attach` - jump to active claude session from a list
|
|
91
|
+
- `h queue session` - jump to main tmux session with default queue
|
|
92
|
+
|
|
93
|
+
task integration:
|
|
94
|
+
|
|
95
|
+
- `h task queue [-t TASK_NAME] queue_command`
|
|
96
|
+
- `h task queue add` - queue prompt in current task (worktree/tmux session)
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
### `h queue` (cont'd)
|
|
100
|
+
|
|
101
|
+
How does this help with context switching?
|
|
102
|
+
|
|
103
|
+
You don't have to leave what you're doing to generate a prompt in a specific
|
|
104
|
+
context.
|
|
105
|
+
|
|
106
|
+
I can be in vim, looking at files, and kick off a prompt without leaving vim.
|
|
107
|
+
|
|
108
|
+
I can be in one task, and fire prompts specific to another task's
|
|
109
|
+
worktree/branch and not have to worry about explicitly giving that info to
|
|
110
|
+
claude.
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
#### `h service`
|
|
115
|
+
|
|
116
|
+
If I'm ever asked to demo something...I immediately get nervous. A million
|
|
117
|
+
questions start running thru my head.
|
|
118
|
+
|
|
119
|
+
- Do I already have a server running?
|
|
120
|
+
- If so, what worktree/branch is it using?
|
|
121
|
+
- Which tmux session/window/pane is it in?
|
|
122
|
+
|
|
123
|
+
Because, if there is a server running but...
|
|
124
|
+
it's in the wrong worktree or branch...
|
|
125
|
+
then i have to find it and kill it
|
|
126
|
+
|
|
127
|
+
when you have 60 tmux panes...broken out into
|
|
128
|
+
8 different tmux sessions...just finding it
|
|
129
|
+
to kill it will take time.
|
|
130
|
+
|
|
131
|
+
And then to test something like the SA Form,
|
|
132
|
+
you then have to spin up 3-4 services:
|
|
133
|
+
- ipp web
|
|
134
|
+
- mesh
|
|
135
|
+
- customers backend rpc
|
|
136
|
+
- partners rpc
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
#### `h service` (cont'd)
|
|
140
|
+
|
|
141
|
+
the second issue with services is...
|
|
142
|
+
|
|
143
|
+
only running one instance of each service (for now)
|
|
144
|
+
|
|
145
|
+
if an instance a service is already running
|
|
146
|
+
and you try to start a new one, then either:
|
|
147
|
+
|
|
148
|
+
1. it will listen on the next available port
|
|
149
|
+
2. it will error and not start the service
|
|
150
|
+
|
|
151
|
+
the ports of other services are configured via
|
|
152
|
+
`.env` files. so it will likely talk to the
|
|
153
|
+
wrong services
|
|
154
|
+
|
|
155
|
+
so...
|
|
156
|
+
|
|
157
|
+
`h service` will only spawn one instance of each service
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
#### `h service` (cont'd)
|
|
161
|
+
|
|
162
|
+
the third minor issue with services is...
|
|
163
|
+
|
|
164
|
+
different configurations.
|
|
165
|
+
|
|
166
|
+
- sometimes we want to use staging as an endpoint
|
|
167
|
+
- other times we want to use a local server
|
|
168
|
+
|
|
169
|
+
ideally, choosing which variation should be easy
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
#### service groups
|
|
173
|
+
|
|
174
|
+
it's also really easy to configure service groups
|
|
175
|
+
and specify which .env variation you want
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
#### main commands
|
|
179
|
+
|
|
180
|
+
- `h service ls`
|
|
181
|
+
- `h service start SERVICE_NAME`
|
|
182
|
+
- `h service stop [SERVICE_NAME]`
|
|
183
|
+
- `h service reset [SERVICE_NAME]`
|
|
184
|
+
- `h service attach [SERVICE_NAME]`
|
|
185
|
+
- `h service config`
|
|
186
|
+
- `h service add`
|
|
187
|
+
- `h service rm` # or remove
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiiro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.178
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-07 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: pry
|
|
@@ -185,6 +186,7 @@ metadata:
|
|
|
185
186
|
homepage_uri: https://github.com/unixsuperhero/hiiro
|
|
186
187
|
source_code_uri: https://github.com/unixsuperhero/hiiro
|
|
187
188
|
changelog_uri: https://github.com/unixsuperhero/hiiro/blob/main/CHANGELOG.md
|
|
189
|
+
post_install_message:
|
|
188
190
|
rdoc_options: []
|
|
189
191
|
require_paths:
|
|
190
192
|
- lib
|
|
@@ -199,7 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
199
201
|
- !ruby/object:Gem::Version
|
|
200
202
|
version: '0'
|
|
201
203
|
requirements: []
|
|
202
|
-
rubygems_version:
|
|
204
|
+
rubygems_version: 3.3.7
|
|
205
|
+
signing_key:
|
|
203
206
|
specification_version: 4
|
|
204
207
|
summary: A lightweight CLI framework for Ruby
|
|
205
208
|
test_files: []
|