silkedit 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.
Files changed (282) hide show
  1. checksums.yaml +7 -0
  2. data/.rbcli +0 -0
  3. data/CHANGELOG.md +3 -0
  4. data/CODE_OF_CONDUCT.md +132 -0
  5. data/README.md +302 -0
  6. data/Rakefile +8 -0
  7. data/exe/silkedit +14 -0
  8. data/lib/commands/backup_restore.rb +25 -0
  9. data/lib/commands/cheat.rb +19 -0
  10. data/lib/commands/edit_diff.rb +47 -0
  11. data/lib/commands/examples/command.rb +51 -0
  12. data/lib/commands/examples/script.rb +36 -0
  13. data/lib/commands/journal.rb +34 -0
  14. data/lib/commands/permasave_permaload.rb +62 -0
  15. data/lib/commands/scripts/.keep +0 -0
  16. data/lib/commands/unpack_repack.rb +27 -0
  17. data/lib/commands/zone_mkzone.rb +102 -0
  18. data/lib/config/config.rb +28 -0
  19. data/lib/config/envvars.rb +23 -0
  20. data/lib/config/hooks.rb +22 -0
  21. data/lib/config/logger.rb +36 -0
  22. data/lib/config/parser.rb +34 -0
  23. data/lib/config/updatechecker.rb +12 -0
  24. data/lib/silkedit/cheats/cheatengine.rb +34 -0
  25. data/lib/silkedit/cheats/hollow_knight_cheats.rb +5 -0
  26. data/lib/silkedit/cheats/merger.rb +103 -0
  27. data/lib/silkedit/cheats/silksong_cheats.rb +121 -0
  28. data/lib/silkedit/cheats/silksong_enemyjournal.rb +119 -0
  29. data/lib/silkedit/cheats/silksong_zoner.rb +98 -0
  30. data/lib/silkedit/config/savegame.yaml +13 -0
  31. data/lib/silkedit/config/silkedit.yaml +6 -0
  32. data/lib/silkedit/config/silksong/cheatdata.yaml +1145 -0
  33. data/lib/silkedit/config/silksong/enemylist.yaml +1418 -0
  34. data/lib/silkedit/config/silksong/old.yaml +4345 -0
  35. data/lib/silkedit/config/silksong/permasaves.yaml +10 -0
  36. data/lib/silkedit/config/silksong/unfinished.yaml +628 -0
  37. data/lib/silkedit/config/silksong/zones.yaml +1686 -0
  38. data/lib/silkedit/images/.keep +0 -0
  39. data/lib/silkedit/images/silksong/Aknid.png +0 -0
  40. data/lib/silkedit/images/silksong/Alita.png +0 -0
  41. data/lib/silkedit/images/silksong/Barnak.png +0 -0
  42. data/lib/silkedit/images/silksong/Beastfly.png +0 -0
  43. data/lib/silkedit/images/silksong/Bell_Beast.png +0 -0
  44. data/lib/silkedit/images/silksong/Bell_Eater.png +0 -0
  45. data/lib/silkedit/images/silksong/Bloatroach.png +0 -0
  46. data/lib/silkedit/images/silksong/Broodmother.png +0 -0
  47. data/lib/silkedit/images/silksong/Brushflit.png +0 -0
  48. data/lib/silkedit/images/silksong/Burning_Bug.png +0 -0
  49. data/lib/silkedit/images/silksong/Caranid.png +0 -0
  50. data/lib/silkedit/images/silksong/Choir_Bellbearer.png +0 -0
  51. data/lib/silkedit/images/silksong/Choir_Clapper.png +0 -0
  52. data/lib/silkedit/images/silksong/Choir_Elder.png +0 -0
  53. data/lib/silkedit/images/silksong/Choir_Flyer.png +0 -0
  54. data/lib/silkedit/images/silksong/Choir_Hornhead.png +0 -0
  55. data/lib/silkedit/images/silksong/Choir_Pouncer.png +0 -0
  56. data/lib/silkedit/images/silksong/Choristor.png +0 -0
  57. data/lib/silkedit/images/silksong/Clawmaiden.png +0 -0
  58. data/lib/silkedit/images/silksong/Clover_Dancers.png +0 -0
  59. data/lib/silkedit/images/silksong/Cloverstag.png +0 -0
  60. data/lib/silkedit/images/silksong/Cogwork_Choirbug.png +0 -0
  61. data/lib/silkedit/images/silksong/Cogwork_Clapper.png +0 -0
  62. data/lib/silkedit/images/silksong/Cogwork_Cleanser.png +0 -0
  63. data/lib/silkedit/images/silksong/Cogwork_Crawler.png +0 -0
  64. data/lib/silkedit/images/silksong/Cogwork_Dancers.png +0 -0
  65. data/lib/silkedit/images/silksong/Cogwork_Defender.png +0 -0
  66. data/lib/silkedit/images/silksong/Cogwork_Hauler.png +0 -0
  67. data/lib/silkedit/images/silksong/Cogwork_Spine.png +0 -0
  68. data/lib/silkedit/images/silksong/Cogwork_Underfly.png +0 -0
  69. data/lib/silkedit/images/silksong/Cogworker.png +0 -0
  70. data/lib/silkedit/images/silksong/Conchfly.png +0 -0
  71. data/lib/silkedit/images/silksong/Coral_Furm.png +0 -0
  72. data/lib/silkedit/images/silksong/Corrcrust_Karaka.png +0 -0
  73. data/lib/silkedit/images/silksong/Covetous_Pilgrim.png +0 -0
  74. data/lib/silkedit/images/silksong/Craggler.png +0 -0
  75. data/lib/silkedit/images/silksong/Cragglite.png +0 -0
  76. data/lib/silkedit/images/silksong/Craw.png +0 -0
  77. data/lib/silkedit/images/silksong/Craw_Juror.png +0 -0
  78. data/lib/silkedit/images/silksong/Crawfather.png +0 -0
  79. data/lib/silkedit/images/silksong/Crust_King_Khann.png +0 -0
  80. data/lib/silkedit/images/silksong/Crustcrag.png +0 -0
  81. data/lib/silkedit/images/silksong/Crustcrawler.png +0 -0
  82. data/lib/silkedit/images/silksong/Deep_Diver.png +0 -0
  83. data/lib/silkedit/images/silksong/Disgraced_Chef_Lugoli.png +0 -0
  84. data/lib/silkedit/images/silksong/Drapefly.png +0 -0
  85. data/lib/silkedit/images/silksong/Drapelord.png +0 -0
  86. data/lib/silkedit/images/silksong/Drapemite.png +0 -0
  87. data/lib/silkedit/images/silksong/Dreg_Catcher.png +0 -0
  88. data/lib/silkedit/images/silksong/Dreg_Husk.png +0 -0
  89. data/lib/silkedit/images/silksong/Dregwheel.png +0 -0
  90. data/lib/silkedit/images/silksong/Driftlin.png +0 -0
  91. data/lib/silkedit/images/silksong/Driznarga.png +0 -0
  92. data/lib/silkedit/images/silksong/Driznit.png +0 -0
  93. data/lib/silkedit/images/silksong/Ductsucker.png +0 -0
  94. data/lib/silkedit/images/silksong/Elder_Pilgrim.png +0 -0
  95. data/lib/silkedit/images/silksong/Envoy.png +0 -0
  96. data/lib/silkedit/images/silksong/Escalion.png +0 -0
  97. data/lib/silkedit/images/silksong/Father_of_the_Flame.png +0 -0
  98. data/lib/silkedit/images/silksong/Fertid.png +0 -0
  99. data/lib/silkedit/images/silksong/First_Sinner.png +0 -0
  100. data/lib/silkedit/images/silksong/Flapping_Fertid.png +0 -0
  101. data/lib/silkedit/images/silksong/Flintbeetle.png +0 -0
  102. data/lib/silkedit/images/silksong/Flintflame_Flyer.png +0 -0
  103. data/lib/silkedit/images/silksong/Flintstone_Flyer.png +0 -0
  104. data/lib/silkedit/images/silksong/Fluttermite.png +0 -0
  105. data/lib/silkedit/images/silksong/Forebrothers_Signis_&_Gron.png +0 -0
  106. data/lib/silkedit/images/silksong/Fourth_Chorus.png +0 -0
  107. data/lib/silkedit/images/silksong/Freshfly.png +0 -0
  108. data/lib/silkedit/images/silksong/Furm.png +0 -0
  109. data/lib/silkedit/images/silksong/Gahlia.png +0 -0
  110. data/lib/silkedit/images/silksong/Gargant_Gloom.png +0 -0
  111. data/lib/silkedit/images/silksong/Garpid.png +0 -0
  112. data/lib/silkedit/images/silksong/Giant_Drapemite.png +0 -0
  113. data/lib/silkedit/images/silksong/Gloomsac.png +0 -0
  114. data/lib/silkedit/images/silksong/Grand_Mother_Silk.png +0 -0
  115. data/lib/silkedit/images/silksong/Grand_Reed.png +0 -0
  116. data/lib/silkedit/images/silksong/Great_Conchfly.png +0 -0
  117. data/lib/silkedit/images/silksong/Groal_the_Great.png +0 -0
  118. data/lib/silkedit/images/silksong/Grom.png +0 -0
  119. data/lib/silkedit/images/silksong/Gromling.png +0 -0
  120. data/lib/silkedit/images/silksong/Guardfly.png +0 -0
  121. data/lib/silkedit/images/silksong/Gurr_the_Outcast.png +0 -0
  122. data/lib/silkedit/images/silksong/Hardbone_Elder.png +0 -0
  123. data/lib/silkedit/images/silksong/Hardbone_Hopper.png +0 -0
  124. data/lib/silkedit/images/silksong/Hoker.png +0 -0
  125. data/lib/silkedit/images/silksong/Huge_Flea.png +0 -0
  126. data/lib/silkedit/images/silksong/Imoba.png +0 -0
  127. data/lib/silkedit/images/silksong/Judge.png +0 -0
  128. data/lib/silkedit/images/silksong/Kai.png +0 -0
  129. data/lib/silkedit/images/silksong/Kakri.png +0 -0
  130. data/lib/silkedit/images/silksong/Karak_Gor.png +0 -0
  131. data/lib/silkedit/images/silksong/Karaka.png +0 -0
  132. data/lib/silkedit/images/silksong/Kilik.png +0 -0
  133. data/lib/silkedit/images/silksong/Kindanir.png +0 -0
  134. data/lib/silkedit/images/silksong/Lace.png +0 -0
  135. data/lib/silkedit/images/silksong/Lampbearer.png +0 -0
  136. data/lib/silkedit/images/silksong/Last_Claw.png +0 -0
  137. data/lib/silkedit/images/silksong/Last_Judge.png +0 -0
  138. data/lib/silkedit/images/silksong/Lavalarga.png +0 -0
  139. data/lib/silkedit/images/silksong/Lavalug.png +0 -0
  140. data/lib/silkedit/images/silksong/Leaf_Glider.png +0 -0
  141. data/lib/silkedit/images/silksong/Leaf_Roller.png +0 -0
  142. data/lib/silkedit/images/silksong/Lost_Garmond.png +0 -0
  143. data/lib/silkedit/images/silksong/Lost_Lace.png +0 -0
  144. data/lib/silkedit/images/silksong/Maestro.png +0 -0
  145. data/lib/silkedit/images/silksong/Marrowmaw.png +0 -0
  146. data/lib/silkedit/images/silksong/Massive_Mossgrub.png +0 -0
  147. data/lib/silkedit/images/silksong/Mawling.png +0 -0
  148. data/lib/silkedit/images/silksong/Memoria.png +0 -0
  149. data/lib/silkedit/images/silksong/Minister.png +0 -0
  150. data/lib/silkedit/images/silksong/Miremite.png +0 -0
  151. data/lib/silkedit/images/silksong/Mite.png +0 -0
  152. data/lib/silkedit/images/silksong/Mitemother.png +0 -0
  153. data/lib/silkedit/images/silksong/Mnemonid.png +0 -0
  154. data/lib/silkedit/images/silksong/Mnemonord.png +0 -0
  155. data/lib/silkedit/images/silksong/Moorwing.png +0 -0
  156. data/lib/silkedit/images/silksong/Mortician.png +0 -0
  157. data/lib/silkedit/images/silksong/Moss_Mother.png +0 -0
  158. data/lib/silkedit/images/silksong/Mossgrub.png +0 -0
  159. data/lib/silkedit/images/silksong/Mossmir.png +0 -0
  160. data/lib/silkedit/images/silksong/Mothleaf_Lagnia.png +0 -0
  161. data/lib/silkedit/images/silksong/Muckmaggot.png +0 -0
  162. data/lib/silkedit/images/silksong/Muckroach.png +0 -0
  163. data/lib/silkedit/images/silksong/Nuphar.png +0 -0
  164. data/lib/silkedit/images/silksong/Nyleth.png +0 -0
  165. data/lib/silkedit/images/silksong/Overgrown_Pilgrim.png +0 -0
  166. data/lib/silkedit/images/silksong/Palestag.png +0 -0
  167. data/lib/silkedit/images/silksong/Pendra.png +0 -0
  168. data/lib/silkedit/images/silksong/Pendragor.png +0 -0
  169. data/lib/silkedit/images/silksong/Penitent.png +0 -0
  170. data/lib/silkedit/images/silksong/Phacia.png +0 -0
  171. data/lib/silkedit/images/silksong/Phantom.png +0 -0
  172. data/lib/silkedit/images/silksong/Pharlid.png +0 -0
  173. data/lib/silkedit/images/silksong/Pharlid_Diver.png +0 -0
  174. data/lib/silkedit/images/silksong/Pilgrim_Bellbearer.png +0 -0
  175. data/lib/silkedit/images/silksong/Pilgrim_Groveller.png +0 -0
  176. data/lib/silkedit/images/silksong/Pilgrim_Guide.png +0 -0
  177. data/lib/silkedit/images/silksong/Pilgrim_Hiker.png +0 -0
  178. data/lib/silkedit/images/silksong/Pilgrim_Hornfly.png +0 -0
  179. data/lib/silkedit/images/silksong/Pilgrim_Hulk.png +0 -0
  180. data/lib/silkedit/images/silksong/Pilgrim_Pouncer.png +0 -0
  181. data/lib/silkedit/images/silksong/Pinstress.png +0 -0
  182. data/lib/silkedit/images/silksong/Plasmid.png +0 -0
  183. data/lib/silkedit/images/silksong/Plasmidas.png +0 -0
  184. data/lib/silkedit/images/silksong/Plasmified_Zango.png +0 -0
  185. data/lib/silkedit/images/silksong/Pokenabbin.png +0 -0
  186. data/lib/silkedit/images/silksong/Pollenica.png +0 -0
  187. data/lib/silkedit/images/silksong/Pond_Skipper.png +0 -0
  188. data/lib/silkedit/images/silksong/Pondcatcher.png +0 -0
  189. data/lib/silkedit/images/silksong/Puny_Penitent.png +0 -0
  190. data/lib/silkedit/images/silksong/Reed.png +0 -0
  191. data/lib/silkedit/images/silksong/Rhinogrund.png +0 -0
  192. data/lib/silkedit/images/silksong/Roachcatcher.png +0 -0
  193. data/lib/silkedit/images/silksong/Roachfeeder.png +0 -0
  194. data/lib/silkedit/images/silksong/Roachkeeper.png +0 -0
  195. data/lib/silkedit/images/silksong/Roachserver.png +0 -0
  196. data/lib/silkedit/images/silksong/Sandcarver.png +0 -0
  197. data/lib/silkedit/images/silksong/Savage_Beastfly.png +0 -0
  198. data/lib/silkedit/images/silksong/Scabfly.png +0 -0
  199. data/lib/silkedit/images/silksong/Scrollreader.png +0 -0
  200. data/lib/silkedit/images/silksong/Second_Sentinel.png +0 -0
  201. data/lib/silkedit/images/silksong/Servitor_Boran.png +0 -0
  202. data/lib/silkedit/images/silksong/Servitor_Ignim.png +0 -0
  203. data/lib/silkedit/images/silksong/Shadow_Charger.png +0 -0
  204. data/lib/silkedit/images/silksong/Shadow_Creeper_(Silksong).png +0 -0
  205. data/lib/silkedit/images/silksong/Shardillard.png +0 -0
  206. data/lib/silkedit/images/silksong/Shellwood_Gnat.png +0 -0
  207. data/lib/silkedit/images/silksong/Shrine_Guardian_Seth.png +0 -0
  208. data/lib/silkedit/images/silksong/Silk_Snipper.png +0 -0
  209. data/lib/silkedit/images/silksong/Sister_Splinter.png +0 -0
  210. data/lib/silkedit/images/silksong/Skarr_Scout.png +0 -0
  211. data/lib/silkedit/images/silksong/Skarr_Stalker.png +0 -0
  212. data/lib/silkedit/images/silksong/Skarrgard.png +0 -0
  213. data/lib/silkedit/images/silksong/Skarrlid.png +0 -0
  214. data/lib/silkedit/images/silksong/Skarrsinger_Karmelita.png +0 -0
  215. data/lib/silkedit/images/silksong/Skarrwing.png +0 -0
  216. data/lib/silkedit/images/silksong/Skrill.png +0 -0
  217. data/lib/silkedit/images/silksong/Skull_Brute.png +0 -0
  218. data/lib/silkedit/images/silksong/Skull_Scuttler.png +0 -0
  219. data/lib/silkedit/images/silksong/Skull_Tyrant.png +0 -0
  220. data/lib/silkedit/images/silksong/Skullwing.png +0 -0
  221. data/lib/silkedit/images/silksong/Slubberlug.png +0 -0
  222. data/lib/silkedit/images/silksong/Smelt_Shoveller.png +0 -0
  223. data/lib/silkedit/images/silksong/Smokerock_Sifter.png +0 -0
  224. data/lib/silkedit/images/silksong/Snitchfly.png +0 -0
  225. data/lib/silkedit/images/silksong/Spear_Skarr.png +0 -0
  226. data/lib/silkedit/images/silksong/Spinebeak_Kai.png +0 -0
  227. data/lib/silkedit/images/silksong/Spit_Squit.png +0 -0
  228. data/lib/silkedit/images/silksong/Splinter.png +0 -0
  229. data/lib/silkedit/images/silksong/Splinterbark.png +0 -0
  230. data/lib/silkedit/images/silksong/Splinterhorn.png +0 -0
  231. data/lib/silkedit/images/silksong/Squatcraw.png +0 -0
  232. data/lib/silkedit/images/silksong/Squatcraw_Juror.png +0 -0
  233. data/lib/silkedit/images/silksong/Squirrm.png +0 -0
  234. data/lib/silkedit/images/silksong/Steelspine_Kai.png +0 -0
  235. data/lib/silkedit/images/silksong/Stilkin.png +0 -0
  236. data/lib/silkedit/images/silksong/Stilkin_Trapper.png +0 -0
  237. data/lib/silkedit/images/silksong/Summoned_Saviour.png +0 -0
  238. data/lib/silkedit/images/silksong/Surgeon.png +0 -0
  239. data/lib/silkedit/images/silksong/Swamp_Squit.png +0 -0
  240. data/lib/silkedit/images/silksong/Tallcraw.png +0 -0
  241. data/lib/silkedit/images/silksong/Tallcraw_Juror.png +0 -0
  242. data/lib/silkedit/images/silksong/Tarmite.png +0 -0
  243. data/lib/silkedit/images/silksong/The_Unravelled.png +0 -0
  244. data/lib/silkedit/images/silksong/Thread_Raker.png +0 -0
  245. data/lib/silkedit/images/silksong/Tormented_Trobbio.png +0 -0
  246. data/lib/silkedit/images/silksong/Trobbio.png +0 -0
  247. data/lib/silkedit/images/silksong/Undercrank.png +0 -0
  248. data/lib/silkedit/images/silksong/Underloft.png +0 -0
  249. data/lib/silkedit/images/silksong/Underpoke.png +0 -0
  250. data/lib/silkedit/images/silksong/Underscrub.png +0 -0
  251. data/lib/silkedit/images/silksong/Undersweep.png +0 -0
  252. data/lib/silkedit/images/silksong/Underworker.png +0 -0
  253. data/lib/silkedit/images/silksong/Vaultborn.png +0 -0
  254. data/lib/silkedit/images/silksong/Vaultkeeper.png +0 -0
  255. data/lib/silkedit/images/silksong/Verdanir.png +0 -0
  256. data/lib/silkedit/images/silksong/Vicious_Caranid.png +0 -0
  257. data/lib/silkedit/images/silksong/Void_Mass.png +0 -0
  258. data/lib/silkedit/images/silksong/Void_Tendrils_(Silksong).png +0 -0
  259. data/lib/silkedit/images/silksong/Voltvyrm.png +0 -0
  260. data/lib/silkedit/images/silksong/Wardenfly.png +0 -0
  261. data/lib/silkedit/images/silksong/Watcher_at_the_Edge.png +0 -0
  262. data/lib/silkedit/images/silksong/Widow.png +0 -0
  263. data/lib/silkedit/images/silksong/Winged_Furm.png +0 -0
  264. data/lib/silkedit/images/silksong/Winged_Lifeseed.png +0 -0
  265. data/lib/silkedit/images/silksong/Winged_Pilgrim.png +0 -0
  266. data/lib/silkedit/images/silksong/Winged_Pilgrim_Bellbearer.png +0 -0
  267. data/lib/silkedit/images/silksong/Wingmould_(Silksong).png +0 -0
  268. data/lib/silkedit/images/silksong/Wisp.png +0 -0
  269. data/lib/silkedit/images/silksong/Wood_Wasp.png +0 -0
  270. data/lib/silkedit/images/silksong/Wraith.png +0 -0
  271. data/lib/silkedit/images/silksong/Yago.png +0 -0
  272. data/lib/silkedit/images/silksong/Yuma.png +0 -0
  273. data/lib/silkedit/images/silksong/Yumama.png +0 -0
  274. data/lib/silkedit/savegame/crypto.rb +25 -0
  275. data/lib/silkedit/savegame/diff.rb +158 -0
  276. data/lib/silkedit/savegame/packer.rb +75 -0
  277. data/lib/silkedit/savegame/savefile.rb +153 -0
  278. data/lib/silkedit/util/system.rb +37 -0
  279. data/lib/silkedit/version.rb +5 -0
  280. data/lib/silkedit.rb +9 -0
  281. data/sig/silkedit.rbs +4 -0
  282. metadata +504 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a4ee9527ffb968b57d0556c8242b44bfe50c69e78fe39734f92dcdf288efe6a1
4
+ data.tar.gz: 2eef2395c25e5a699230448b2ee31444cfee96654ad0572e6a4c9bd4cf5e26d8
5
+ SHA512:
6
+ metadata.gz: 1562247f9866ae1eeb45e751e743b258b75c2303515a92deeb4c5dac8313d90111afc6cbc8c9abd43ac994dd682d0c88f44c6fbf8b7db5b03042c0a800402adb
7
+ data.tar.gz: 4de97c89ccf2e6c35c43b79600b3f0500daeae87218c394601f9a4a4a87ca13124f3f1996bf2537b9e202afcbf02396d60637c912478d70636b284dd910972ce
data/.rbcli ADDED
File without changes
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [0.1.0] - 2025-10-22
2
+
3
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/README.md ADDED
@@ -0,0 +1,302 @@
1
+ # Silkedit
2
+
3
+ Silkedit is a tool that allows quick and easy editing of savefiles for Hollow Knight and Silksong.
4
+
5
+ It has built-in cheats, can zone the player to nearly any bench or spawn point in the game (such as spawning where you obtain a skill), can edit the enemy journal to quickly update all required kills, and can save and restore the state of savefiles to provide you with a much larger save capacity.
6
+
7
+ What's useful to note is that the game has a few seconds in between when you exit a game and when the main menu gets loaded during which you can apply cheats to your savefile. This means that you don't have to exit out of the game to reload your cheats - just quit to the main menu and run silkedit before it loads.
8
+
9
+ Basic usage:
10
+
11
+ ```bash
12
+ # Either supply the savegame number directly...
13
+ silkedit -s 1 cheat max_health max_silk quill_purple
14
+
15
+ # ...or keep it in an environment variable
16
+ export SILKEDIT_SAVENUM=1
17
+ silkedit cheat max_health max_silk quill_purple
18
+
19
+ # Un-kill your character, even in Silk Soul Mode
20
+ silkedit cheat unkill
21
+
22
+ # List all cheats and zones
23
+ silkedit cheat -l
24
+ silkedit zone -l
25
+
26
+ # Spawn at a different point when reloading the game
27
+ silkedit zone terminus
28
+
29
+ # Analyze or edit your enemy kill records
30
+ # If you have a terminal emulator compatible with `imgcat`
31
+ # (such as iterm2), images of the enemies will also be displayed.
32
+ silkedit journal listall
33
+ silkedit journal listmissing
34
+ silkedit journal killsonly
35
+ silkedit journal complete
36
+
37
+ # Or load up a pre-defined savefile to any slot
38
+ silkedit permaload -n act3complete
39
+ ```
40
+
41
+ All available commands:
42
+ ```
43
+ $ silkedit -h
44
+ backup Backs up the savefile
45
+ restore Restore a backup to the savefile. Providing no parameters restores the latest backup.
46
+ cheat Applies one or more cheats to the selected savefile
47
+ edit Edit the savefile directly
48
+ diff Diffs the current savegame against the latest backup, a specified backup, or a different save
49
+ journal Manages the journal of enemy kills
50
+ permasave Saves a local copy of a game into the config to restore later.
51
+ permaload Restores a permasave into the slot
52
+ unpack Unpacks a save file or backup to JSON/YAML for manual editing
53
+ repack Packs the JSON/YAML to the savefile
54
+ zone Zones the character to a different respawn point
55
+ mkzone Adds a new spawn point to the library
56
+ ```
57
+
58
+ Available cheats:
59
+
60
+ ```
61
+ $ silkedit cheat -l
62
+ all_abilities
63
+ all_crest_unlocks
64
+ all_crests
65
+ all_eva_upgrades
66
+ all_fasttravel
67
+ all_fleas
68
+ all_maps
69
+ all_spells
70
+ all_tools
71
+ complete_mushroom_quest
72
+ easy_dice_game_win
73
+ easy_flea_games_win
74
+ give_consumables
75
+ give_farsight
76
+ max_everything
77
+ max_health
78
+ max_liquids
79
+ max_rosaries
80
+ max_shards
81
+ max_silk
82
+ max_tool_upgrades
83
+ max_weapon
84
+ quill_none
85
+ quill_purple
86
+ quill_red
87
+ quill_white
88
+ refresh
89
+ toggle_cloakless
90
+ toggle_flea_reveal
91
+ toggle_map_reveal
92
+ toggle_permadeath_mode
93
+ unkill
94
+ unlock_terminus_door
95
+ ```
96
+
97
+ Available Spawn Points
98
+
99
+ Note: The act shown is the expected act in the game when you'd normally get there. In most cases, however, you can ignore it and spawn anywhere during any act. Notable exceptions are the flea games during Act 1/2, or fleatopia during act 3. These will cause glitches.
100
+
101
+ ```
102
+ $ silkedit zone -l
103
+ Shortcuts:
104
+ bonebottom greymoor blastedsteps spa fleatopia
105
+ druid halfwayhome pinstress highhalls fleagames
106
+ marrow yarnaby sinnersroad terminus surface
107
+ docks bellhart bilewater architect weavenest_a
108
+ sauna bellhome exhaustorgan faypeak weavenest_c
109
+ farfields widow ducts fleacamp1 abyss
110
+ seamstress shellwood cogcore fleacamp2
111
+ huntersmarch alchemist songclave fleacamp3
112
+
113
+ Zones:
114
+ Shortcut Act Zone
115
+ 3 abyss.bell_fixed
116
+ 3 abyss.north
117
+ abyss 3 abyss.south
118
+ bellhome 2 bellhart.bellhome
119
+ bellhart 1 bellhart.bench
120
+ 1 bellhart.widow_bellshrine
121
+ widow 1 bellhart.widow_spawn
122
+ 2 bilewater.bilehaven
123
+ 2 bilewater.east
124
+ exhaustorgan 1 bilewater.exhaustorgan
125
+ bilewater 1 bilewater.station
126
+ pinstress 1 blastedsteps.pinstress
127
+ 1 blastedsteps.south
128
+ blastedsteps 1 blastedsteps.station
129
+ surface 3 bordercaves.bench
130
+ 2 choralchambers.center
131
+ 2 choralchambers.northwest
132
+ 2 choralchambers.southwest
133
+ spa 2 choralchambers.spa
134
+ cogcore 2 cogcore.bench
135
+ 2 cogcore.dancers_spawn
136
+ 2 cogcore.melodytowers_spawn
137
+ 3 cradle.destroyed
138
+ 2 cradle.lace_spawn
139
+ terminus 1 cradle.terminus
140
+ 3 deepdocks.bell_fixed
141
+ 1 deepdocks.bellshrine
142
+ 1 deepdocks.dash_spawn
143
+ docks 1 deepdocks.forgedaughter
144
+ 3 deepdocks.fromabyss
145
+ sauna 2 deepdocks.sauna
146
+ 1 deepdocks.upper
147
+ 3 farfields.act3area
148
+ 1 farfields.pilgrimsrest
149
+ seamstress 1 farfields.seamstress
150
+ 3 farfields.sprintmaster
151
+ farfields 1 farfields.station
152
+ 1 farfields.upperentrance
153
+ weavenest_c 1 farfields.weavenest_cindril
154
+ 2 fay.cave
155
+ 2 fay.climb
156
+ faypeak 2 fay.peak
157
+ 2 fay.shakra
158
+ 1 grandbellway.station
159
+ fleacamp3 2 grandgate.fleacamp_3
160
+ greymoor 1 greymoor.bellshrine
161
+ fleacamp2 1 greymoor.fleacamp_2
162
+ halfwayhome 1 greymoor.halfwayhome
163
+ 1 greymoor.reaper_crest_spawn
164
+ 1 greymoor.shakra
165
+ 1 greymoor.yarnaby_spawn
166
+ 2 highhalls.station
167
+ huntersmarch 1 huntersmarch.trappedbench
168
+ 2 karak.coraltower
169
+ 2 karak.east
170
+ 1 marrow.entrance
171
+ fleacamp1 1 marrow.fleacamp_1
172
+ 1 marrow.jail_pinchallenge
173
+ marrow 1 marrow.station_bellshrine
174
+ 2 memorium.default
175
+ 1 memory.needolin
176
+ bonebottom 1 mossgrove.bonebottom
177
+ 1 mossgrove.chapel
178
+ 3 mossgrove.chapel_inside
179
+ druid 1 mossgrove.druid
180
+ 1 mossgrove.gamestart_respawn
181
+ 1 mossgrove.mosshome
182
+ 3 mossgrove.shaman_crest_spawn
183
+ 1 mossgrove.silkspear_spawn
184
+ 1 mossgrove.wanderer_crest_spawn
185
+ 3 putrifiedducts.fleafestival
186
+ fleatopia 2 putrifiedducts.fleatopia
187
+ 2 putrifiedducts.huntress
188
+ ducts 2 putrifiedducts.station
189
+ 1 shellwood.center
190
+ 1 shellwood.clinggrip_respawn
191
+ 3 shellwood.nyleth_spawn
192
+ 2 shellwood.south
193
+ shellwood 1 shellwood.station_bellshrine
194
+ 1 shellwood.west
195
+ 2 shellwood.witch_crest_spawn
196
+ 1 sinnersroad.east
197
+ 1 sinnersroad.east_permadeathmode
198
+ sinnersroad 1 sinnersroad.west
199
+ 1 slab.east
200
+ 2 slab.firstsinner_spawn
201
+ 1 slab.nw_inside
202
+ 1 slab.nw_outside
203
+ 1 slab.station
204
+ 2 songclave.bellshrine
205
+ songclave 2 songclave.bench
206
+ architect 2 underworks.architect
207
+ 2 underworks.harpoon_spawn
208
+ 2 underworks.north_a
209
+ 2 underworks.north_b
210
+ 2 underworks.north_c
211
+ 2 underworks.west
212
+ 3 verdania.bench
213
+ 1 weavenest.atla_bench
214
+ 1 weavenest.atla_eva_spawn
215
+ 2 whisperingvaults.keeper
216
+ 2 whisperingvaults.south
217
+ 2 whiteward.default
218
+ 2 wispthicket.default
219
+ alchemist 1 wormways.alchemist
220
+ 2 wormways.sharpdart_spawn
221
+ ```
222
+
223
+ Provided Permasaves:
224
+
225
+ ```
226
+ $ silkedit permaload -l
227
+ standard_mode_complete
228
+ silksoul_mode_complete
229
+ act3complete
230
+ act2complete
231
+ act1complete
232
+ act1speedrun
233
+ act2_pre_lace_and_witch
234
+ cursed_mother_kill
235
+ act3start
236
+ ```
237
+
238
+ Example journal update (without images):
239
+
240
+ It asks for confirmation for any mob which has less than 10 required kills, as many of those have only a fixed number in game and not everyone may want to update them.
241
+
242
+ ```
243
+ $ silkedit journal complete
244
+ (...)
245
+ Great Conchfly Seen? Y Kills: 1 Needed: 2 Left: 1
246
+ Set Great Conchfly kills from 1 to 2? (y/n): n
247
+ * Roachfeeder Seen? Y Kills: 20 Needed: 20 Left: 0
248
+ Already Completed.
249
+ * Roachkeeper Seen? Y Kills: 10 Needed: 10 Left: 0
250
+ Already Completed.
251
+ Last Judge Seen? N Kills: 0 Needed: 1 Left: 1
252
+ Added to journal.
253
+ Underpoke Seen? N Kills: 0 Needed: 25 Left: 25
254
+ (...)
255
+ ```
256
+
257
+
258
+ ## Installation
259
+
260
+ Silkedit is available on **rubygems**, and *should* work cross-platform. I don't own an x86 Windows system to test it but if you have one and find that it doesn't work, feel free to submit a bug report or pull request!
261
+
262
+ ```bash
263
+ gem install silkedit
264
+ ```
265
+
266
+ If you don't already have ruby on your system, you will need to install it.
267
+
268
+ ### Windows
269
+
270
+ [https://rubyinstaller.org/downloads/](https://rubyinstaller.org/downloads/)
271
+
272
+ ### MacOS
273
+
274
+ ```bash
275
+ # Install Homebrew
276
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
277
+ # Install rbenv
278
+ brew install rbenv
279
+ # Install ruby
280
+ rbenv install "$(rbenv install -l | grep -v - | tail -1)"
281
+ ```
282
+
283
+ ### Linux
284
+
285
+ [https://github.com/rbenv/rbenv?tab=readme-ov-file#using-package-managers](https://github.com/rbenv/rbenv?tab=readme-ov-file#using-package-managers)
286
+
287
+ If you already have ruby on your system, just run:
288
+
289
+
290
+ ## Development
291
+
292
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
293
+
294
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
295
+
296
+ ## Contributing
297
+
298
+ Bug reports and pull requests are welcome on GitHub at https://github.com/akhoury6/silkedit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/silkedit/blob/master/CODE_OF_CONDUCT.md).
299
+
300
+ ## Code of Conduct
301
+
302
+ Everyone interacting in the Silkedit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/silkedit/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/exe/silkedit ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ ################
4
+ ### Silkedit ###
5
+ ################
6
+
7
+ #require 'rbcli'
8
+ require '/Users/andrew/Documents/code/rbcli/lib/rbcli.rb'
9
+
10
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'silkedit')
11
+ Dir[File.join(File.dirname(__FILE__), '..', 'lib', 'config', '*.rb')].each { |file| require file }
12
+ Dir[File.join(File.dirname(__FILE__), '..', 'lib', 'commands', '*.rb')].each { |file| require file }
13
+
14
+ Rbcli.go!
@@ -0,0 +1,25 @@
1
+ Rbcli.command 'backup' do
2
+ description 'Backs up the savefile'
3
+ parameter :custom_name, 'Give the backup a custom name. Named backups can\'t be edited.', short: :n, type: :string
4
+ action do |opts, params, args, config, env|
5
+ s = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
6
+ s.direct_backup(backup_name: params[:custom_name])
7
+ end
8
+ end
9
+
10
+ Rbcli.command 'restore' do
11
+ description 'Restore a backup to the savefile. Providing no parameters restores the latest backup.'
12
+ parameter :backup_seq, 'Backup number to restore (Can\'t use together with named backup)', short: :b, type: :integer
13
+ parameter :backup_name, 'Named backup to restore', short: :n, type: :string
14
+
15
+ action do |opts, params, args, config, env|
16
+ if !params[:backup_seq].nil? && !params[:backup_name].nil?
17
+ Rbcli.log.error 'Can\'t specify both a sequence and name at the same time.'
18
+ else
19
+ s = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
20
+ unless s.direct_restore(seq_number: params[:backup_seq], backup_name: params[:backup_name])
21
+ Rbcli.log.error "Failed to restore backup"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ Rbcli.command 'cheat' do
2
+ description 'Applies one or more cheats to the selected savefile'
3
+ usage '<cheat1> <cheat2> <cheat3>...'
4
+ parameter :list, 'List all cheats', type: :bool, default: false
5
+ action do |opts, params, args, config, env|
6
+ s = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
7
+ s.load_from_dat
8
+ c = Silkedit::Cheat::Engine.new(s.data)
9
+ selected_cheats = args.map { |arg| arg.downcase }.select { |cht| c.cheat_exists?(cht) }
10
+ if params[:list] || selected_cheats.empty?
11
+ Rbcli.log.info "Cheats: \n" + c.list_cheats.map(&:to_s).join("\n")
12
+ else
13
+ selected_cheats.each { |cht| c.apply_cheat(cht) }
14
+ s.direct_backup
15
+ # s.save_to_dat
16
+ Rbcli.log.info "applied cheats: #{selected_cheats.join(', ')}"
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,47 @@
1
+ Rbcli.command 'edit' do
2
+ description 'Edit the savefile directly'
3
+ action do |opts, params, args, config, env|
4
+ s = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
5
+ s.load_from_dat
6
+ s.save_to_json
7
+ Process.wait(Process.spawn(config[:editor_command].sub('%FILE%', s.filenames[:json])))
8
+ if Silkedit::Sys.yes_no?('Apply changes?')
9
+ s.load_from_json
10
+ s.direct_backup
11
+ s.save_to_dat
12
+ Rbcli.log.info 'Updated savefile'
13
+ else
14
+ Rbcli.log.info 'Aborted'
15
+ end
16
+ end
17
+ end
18
+
19
+ Rbcli.command 'diff' do
20
+ description 'Diffs the current savegame against the latest backup, a specified backup, or a different save'
21
+ parameter :backup_seq, 'Backup number to diff against', short: :b, type: :integer
22
+ parameter :othersave, 'Other save number to diff against', short: :o, type: :integer
23
+ parameter :yaml_output, 'Output in YAML instead of a Ruby object', short: :y, type: :boolean
24
+
25
+
26
+ action do |opts, params, args, config, env|
27
+ new = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
28
+ new.load_from_dat
29
+ if params[:othersave]
30
+ old = Silkedit::Savegame::SaveFile.new(:silksong, params[:othersave])
31
+ old.load_from_dat
32
+ else
33
+ old = Silkedit::Savegame::SaveFile.new(:silksong, opts[:savenum])
34
+ old.load_from_backup(seq_number: params[:backup_seq])
35
+ end
36
+
37
+ diff = Silkedit::Savegame::Diff.mkdiff(old.data, new.data)
38
+ Rbcli.log.info Silkedit::Savegame::Diff.parse_diff(diff, yaml_output: params[:yaml_output])
39
+
40
+ # s.save_as_json
41
+ # FileUtils.mv(s.json_filename, "#{s.json_filename}.old")
42
+ # s.load_from_dat
43
+ # s.save_as_json
44
+ # FileUtils.mv(s.json_filename, "#{s.json_filename}.new")
45
+ # Process.wait(Process.spawn(config[:diff_command].sub('%OLD%', "#{s.json_filename}.old").sub('%NEW%', "#{s.json_filename}.new")))
46
+ end
47
+ end
@@ -0,0 +1,51 @@
1
+ Rbcli.command "example" do
2
+ ##### Command Declaration (At least one is required) #####
3
+ # default (Optional) The default command is run when no other commands are called on the CLI
4
+ # Note that parameters are not available for default commands, as all CLI options
5
+ # are parsed against the global-level ones declared in the `Configurate.opts` block
6
+ # description (Optional) Short description that shows up in --help for the executable
7
+ # usage (Optional) Usage text that shows up in --help or when CLI format is bad
8
+ # helptext (Optional) Large help text that shows up in --help for the command
9
+ # default
10
+ description 'Example command'
11
+ usage "[--param|--otherparam] name"
12
+ helptext <<~EOF
13
+ Big block of helptext
14
+ EOF
15
+ # parameter (Optinoal) Parameters follow the same format as CLI Options, but are only available for this command
16
+ parameter :param, 'A Parameter', default: false
17
+ parameter :otherparam, 'Another Parameter', type: :string, default: "Default value"
18
+ # action (Required, unless declaring a `script`) The action block is code that gets executed when the command is called
19
+ # Sending all output through the logger is recommended. For it to be displayed
20
+ # as regular text, set the logger to the :display format
21
+ action do |opts, params, args, config, env|
22
+ Rbcli.log.info "Welcome to your new application!"
23
+ Rbcli.log.info "We like to send all of our output through the logger for easy formatting and deployment..."
24
+ puts "...but you don't have to"
25
+ Rbcli.log.info "Here's a quick demo of how to use the framework:\n"
26
+
27
+ Rbcli.log.info "Top-level CLI Options: " + opts.to_s
28
+ Rbcli.log.info "Parameters: " + params.to_s
29
+ Rbcli.log.info "Arguments on the CLI: " + args.to_s
30
+ Rbcli.log.info "The config: " + config.to_s
31
+ Rbcli.log.info "Environment variables: " + env.to_s
32
+ Rbcli.log.info ""
33
+
34
+ Rbcli.log.debug "Example Debug Message (change your log level to see this!)", "MYAPP"
35
+ Rbcli.log.info "Example Info Message", "MYAPP"
36
+ Rbcli.log.warn "Example Warning Message", "MYAPP"
37
+ Rbcli.log.error "Example Error Message", "MYAPP"
38
+ Rbcli.log.fatal "Example Fatal Message", "MYAPP"
39
+ Rbcli.log.unknown "Example Unknown Message", "MYAPP"
40
+ Rbcli.log.info ""
41
+
42
+ config.add_default :foo, 'bar'
43
+ config.create!
44
+ config.load!
45
+ config[:davey] = 'Davey Jones'.compress
46
+ Rbcli.log.info "Compressed String: " + config[:davey]
47
+ Rbcli.log.info "Decompressed String: " + config[:davey].decompress
48
+ config.save!
49
+ Rbcli.log.info config
50
+ end
51
+ end
@@ -0,0 +1,36 @@
1
+ # Script Command
2
+ # Supports all of the same features as a regular command, but passes everything to a bash script
3
+ # The script can be defined inline, or a path to an external script can be provided
4
+ #
5
+ # Code is injected into the script to integrate with Rbcli.
6
+ # The `log` commands are integrated with the ruby logger
7
+ # The `rbcli` command provides a wrapper around jq that can retrieve
8
+ # the values of opts/params/args/config/env
9
+ # For more information on JQ syntax, see: https://jqlang.github.io/jq/
10
+ Rbcli.command "script" do
11
+ description "example script command"
12
+ # external_script vars: {}, path: "./test.sh"
13
+ inline_script vars: { foo: 'bar!!!' }, inline: <<~INLINE
14
+ #!/usr/bin/env bash
15
+ log "Rbcli shell integration demo!"
16
+ log "A custom JQ wrapper is used to parse config passed through from Rbcli"
17
+ log "For more information on how to use it, see: https://jqlang.github.io/jq/"
18
+ log ""
19
+
20
+ log "Top-level CLI Options: $(rbcli opts .)"
21
+ log "Parameters: $(rbcli params .)"
22
+ log "Arguments on the CLI: $(rbcli args .)"
23
+ log "Config: $(rbcli config .)"
24
+ log "Environment Variables: $(rbcli env .)"
25
+ log "Custom Var from command: $(rbcli vars .foo)"
26
+ log "Same variable, in environment: ${FOO}"
27
+
28
+ log "Logs are integrated too"
29
+ log "Example Debug (you need to change your log level to see this)" "debug"
30
+ log "Example Info" "info"
31
+ log "Example Warning" "warn"
32
+ log "Example Error" "error"
33
+ log "Example Fatal" "fatal"
34
+ log "Example Unknown" "unknown"
35
+ INLINE
36
+ end