Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/hop/blob/main/Sources/Cli.swift # hop Hop: a small native macOS launcher. Clipboard history, find, on-device dictation and your coding agent behind one key. Brought by drakestapleton Sign in to star 1 stars 1 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `hop / Sources / Cli.swift` 258 lines · 17726 bytes Raw Blame History 1 import Foundation 2 3 /// `hop` on the command line, for the user, for developers and for the user's agents. `hop help` lists every 4 /// command (`Cli.guide`, in CliDev.swift, which also holds ask, clip, open, status, link and the --json output): 5 /// hop find search this Mac and every configured machine at once 6 /// hop run run a command on a machine (auto-routed ssh) 7 /// hop machines which machines are reachable, and by which route 8 /// hop swarm [number|board] the agent swarms the Factory screen's Swarm section shows, as plain text 9 /// hop panel the launcher panel written in Omega (Omega/ui/hoppanel.om): type, Enter opens the app 10 /// hop fuse Hop picks who does it, as the Agent screen does, and prints the reply 11 @MainActor 12 enum Cli { 13 static let commands: Set = ["find", "run", "machines", "help", "--help", "-h", "hear", "hear-many", "tidy", "know", "note", "swarm", "panel", 14 "ask", "clip", "open", "status", "link", "show", "version", "--version", "fuse"] 15 16 /// The options that start the app itself or one of its self-tests. Any other `--word` is a slip in a terminal. 17 static let appFlags: Set = ["--factory", "--no-global-hotkey", "--selftest", "--selftest-ask", "--selftest-pick", "--selftest-flow", "--uitest", "--uitest-agent", 18 "--uitest-arrows", "--uitest-box", "--uitest-launch", "--uitest-learn", "--uitest-voice", "--show"] 19 20 static func main(_ cmd: String, _ args: [String]) async -> Int32 { 21 // These read no settings, so they also work before Hop has ever been opened. 22 switch cmd { 23 case "version", "--version": print(version); return 0 24 case "help", "--help", "-h": return help(args) 25 case "link": return link(args) 26 case "show": return await show(args) 27 default: break 28 } 29 let cfg = HopConfig.load() 30 switch cmd { 31 case "hear": // hop hear : what Hop would type for it (same engine and cleanup as live dictation) 32 guard let f = args.first, FileManager.default.isReadableFile(atPath: f) else { err("usage: hop hear