MCPcopy Index your code
hub / github.com/chawyehsu/hok

github.com/chawyehsu/hok @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
470 symbols 1,109 edges 65 files 138 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

hok

Hok is a CLI implementation of Scoop in Rust

cicd release crates-svg license downloads docs-svg

简体中文

Install

🚧 CAVEAT: Under heavy development, interfaces may change without notice.

Assuming you have the original Scoop installed, simply run:

scoop bucket add dorado https://github.com/chawyehsu/dorado
scoop install dorado/hok

Note this will add the dorado bucket I maintain to install Hok. Hok is experimental and it's currently only available in that bucket.

Commands

The command line interface is similar to Scoop.

$ hok help
Hok is a CLI implementation of Scoop in Rust

Usage: hok.exe <COMMAND>

Commands:
  bucket     Manage manifest buckets
  cache      Package cache management
  cat        Inspect the manifest of a package
  cleanup    Cleanup apps by removing old versions
  config     Configuration management
  hold       Hold package(s) to disable changes
  home       Browse the homepage of a package
  info       Show package(s) basic information
  install    Install package(s)
  list       List installed package(s)
  search     Search available package(s)
  unhold     Unhold package(s) to enable changes
  uninstall  Uninstall package(s)
  update     Fetch and update subscribed buckets
  upgrade    Upgrade installed package(s)
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Type 'hok help <command>' to get help for a specific command.

Development

Prerequisites: Git, Rust

# clone the repo
git clone https://github.com/chawyehsu/hok
cd hok
# build
cargo build
# run and test
cargo run -- help

Performance

Hok (also the libscoop backend) aims to provide a faster yet powerful alternative to the original Scoop. Here are some random benchmarks captured in the Windows Sandbox environment on my PC (AMD Ryzen 5 2600, 32G RAM, Windows 10).

# versions:
hok/dorado 0.1.0-beta.6
scoop-search/main 1.5.0
sfsu/extras 1.14.0
# Benchmarking scoop bucket list
Benchmark 1: scoop bucket list
  Time (mean ± σ):      5.610 s ±  0.627 s    [User: 6.573 s, System: 3.520 s]
  Range (min … max):    4.784 s …  7.063 s    10 runs

Benchmark 2: hok bucket list
  Time (mean ± σ):     159.4 ms ±  28.3 ms    [User: 86.4 ms, System: 175.2 ms]
  Range (min … max):   140.0 ms … 252.1 ms    18 runs

Summary
  hok bucket list ran
   35.19 ± 7.38 times faster than scoop bucket list
# Benchmarking scoop list
Benchmark 1: scoop list
  Time (mean ± σ):      3.577 s ±  0.043 s    [User: 4.919 s, System: 2.142 s]
  Range (min … max):    3.524 s …  3.678 s    10 runs

Benchmark 2: sfsu list
  Time (mean ± σ):      58.3 ms ±  30.8 ms    [User: 18.8 ms, System: 44.2 ms]
  Range (min … max):    39.1 ms … 234.1 ms    50 runs

Benchmark 3: hok list
  Time (mean ± σ):      48.7 ms ±  53.2 ms    [User: 13.4 ms, System: 41.7 ms]
  Range (min … max):    31.8 ms … 412.4 ms    62 runs

Summary
  hok list ran
    1.20 ± 1.45 times faster than sfsu list
   73.39 ± 80.11 times faster than scoop list
# Benchmarking scoop search (sqlite_cache enabled)
Benchmark 1: scoop search google
  Time (mean ± σ):      3.771 s ±  0.031 s    [User: 5.134 s, System: 2.085 s]
  Range (min … max):    3.725 s …  3.830 s    10 runs

Benchmark 2: scoop-search google
  Time (mean ± σ):     178.5 ms ±  14.2 ms    [User: 210.8 ms, System: 850.4 ms]
  Range (min … max):   149.4 ms … 206.8 ms    17 runs

Benchmark 3: sfsu search google
  Time (mean ± σ):      73.7 ms ±  30.1 ms    [User: 49.3 ms, System: 85.0 ms]
  Range (min … max):    52.6 ms … 202.3 ms    36 runs

Benchmark 4: hok search google
  Time (mean ± σ):      73.0 ms ±  10.2 ms    [User: 44.9 ms, System: 93.4 ms]
  Range (min … max):    63.0 ms … 109.3 ms    25 runs

Summary
  hok search google ran
    1.01 ± 0.44 times faster than sfsu search google
    2.44 ± 0.39 times faster than scoop-search google
   51.63 ± 7.25 times faster than scoop search google

You may run the benchmarks yourself using provided benchmark scripts in the [scripts directory]. Results may vary on different environments, feel free to share yours to help us improve the project.

License

hok © Chawye Hsu. Released under the Apache-2.0 license. For licenses of sub crates, see COPYING.

Blog · GitHub @chawyehsu · Twitter @chawyehsu

Extension points exported contracts — how you extend this code

Matcher (Interface)
A trait represents a matcher that can be used to do string matching. [2 implementers]
crates/libscoop/src/package/query.rs
Hasher (Interface)
(no doc)
crates/scoop_hash/src/lib.rs

Core symbols most depended-on inside this repo

emitter
called by 32
crates/libscoop/src/session.rs
name
called by 26
crates/libscoop/src/package/mod.rs
config
called by 21
crates/libscoop/src/session.rs
pop
called by 17
crates/libscoop/src/internal/dag.rs
execute
called by 16
src/cmd/cat.rs
devectorize
called by 16
crates/libscoop/src/package/manifest.rs
f
called by 16
crates/scoop_hash/src/selfcontained/md5.rs
g
called by 16
crates/scoop_hash/src/selfcontained/md5.rs

Shape

Method 229
Function 146
Class 75
Enum 18
Interface 2

Languages

Rust100%

Modules by API surface

crates/libscoop/src/package/manifest.rs76 symbols
crates/libscoop/src/package/mod.rs41 symbols
crates/libscoop/src/internal/dag.rs32 symbols
crates/libscoop/src/config.rs31 symbols
crates/libscoop/src/bucket.rs21 symbols
crates/scoop_hash/src/lib.rs17 symbols
crates/libscoop/src/package/sync.rs17 symbols
crates/scoop_hash/src/selfcontained/md5.rs16 symbols
crates/libscoop/src/package/download.rs13 symbols
crates/scoop_hash/src/selfcontained/sha512.rs12 symbols
crates/scoop_hash/src/selfcontained/sha256.rs12 symbols
crates/scoop_hash/src/selfcontained/sha1.rs12 symbols

For agents

$ claude mcp add hok \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact