create crate tools #123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
see /Volumes/T7/code0/hero_lib/crates/tools
make examples
structure to use /Volumes/T7/code0/hero_lib/crates/os (see how we use examples, src, ...)
now implement all we have done in
/Users/despiegk/hero/code/hero_skills/tools/modules
which are tools in nushell
we now need to have them reimplemented in rust
use the os modules from /Volumes/T7/code0/hero_lib/crates/os/src e.g. git... where we can
Implementation Spec for Issue #123: Create Crate Tools
Objective
Create a new
herolib_toolsRust crate that reimplements all 9 nushell tool modules fromhero_skills/tools/modulesin Rust, followingherolib_oscrate conventions, reusing existing OS modules where possible.Nushell Modules to Reimplement (9 total)
Files to Create
crates/tools/Cargo.toml+ register in workspacecrates/tools/src/lib.rswith 9 submodulescrates/tools/src/forge/(6 files: client, env, resolve, repo, sync, worktree)crates/tools/src/agent/mod.rscrates/tools/src/hero_utils/mod.rscrates/tools/src/init/mod.rscrates/tools/src/installers/mod.rscrates/tools/src/legacy/mod.rscrates/tools/src/secrets/(template, loader, sync)crates/tools/src/services/mod.rscrates/tools/src/skills/mod.rscrates/tools/examples/(5 examples)crates/tools/tests/(4 test files)crates/tools/README.mdImplementation Plan (13 steps)
hero_utilsmodule (disk detection, shell parsing, string stats, md-table)secretsmodule (TOML template, flatten, merge, toml→sh, sync)forgemodule — largest (API client, repo CRUD, pull/push/clone, worktrees, name resolution)initmodule (derive ROOTDIR, init_main, init_setup)installersmodule (detect pkg manager, install tools)legacymodule (write init.sh, patch rc files)servicesmodule (hero_proc, aibroker, browser_mcp)skillsmodule (sync skills repo, rsync to Claude config)agentmodule (model config, env vars, CLI args)OS Modules to Reuse
herolib_os::git,process,os::fs,os::platform,os::package::PackHero,os::download,rsync,sshAcceptance Criteria
Test Results
Full output
Implementation Complete
Changes Made
New crate:
herolib_tools(crates/tools/) — reimplements all 9 nushell tool modules in Rust.Files Created (25 source files + 5 examples + 1 README)
Crate setup:
crates/tools/Cargo.toml— crate manifest with workspace dependenciescrates/tools/src/lib.rs— root module exposing all 9 submodulescrates/tools/README.md— documentation with module mapping tableSource modules (9 modules, matching all nushell originals):
src/forge/(7 files) — Forgejo API client, repo CRUD, pull/push/clone, worktrees, name resolutionsrc/agent/mod.rs— AI model configuration for Claude, OpenRouter, Groq, DeepInfrasrc/hero_utils/mod.rs— disk detection, shell file parsing, string stats, markdown tablessrc/init/mod.rs— Hero environment initialization (ROOTDIR derivation, path setup)src/installers/mod.rs— platform-aware tool installation (brew/apt/dnf/pacman)src/legacy/mod.rs— legacy shell support (init.sh generation, rc file patching)src/secrets/(4 files) — TOML secrets management, flatten, merge, sync with Forgejosrc/services/mod.rs— Hero service management (hero_proc, aibroker, browser_mcp)src/skills/mod.rs— Skills repo sync and rsync installationExamples (5):
examples/forge_list.rs,forge_info.rs,init_env.rs,secrets_source.rs,install_base.rsWorkspace registration:
Cargo.toml— addedcrates/toolsto workspace members and dependenciesTest Results
OS Module Reuse
Leverages
herolib_osextensively:git(GitTree, GitRepo, GitCloneBuilder),process(run_command),os::fs,os::platform,os::package,rsync(RsyncBuilder)Implementation committed:
085bee39Browse:
085bee39