How rasukarusan/shellnium works
Project type and purpose
• Shellnium is a command-line automation library (a WebDriver wrapper) for Bash/Zsh.
• It provides high-level Bash functions that map to the WebDriver HTTP API, letting users write browser automation scripts entirely in shell.
File structure
• Top level:
• demo.sh, demo2.sh, demo3.sh – example client scripts
• lib/ – the reusable library code
– core.sh: implements the main WebDriver session, navigation, element/state/document APIs
– selenium.sh: high-level entry point that sources core.sh and util.sh, defines user-facing functions
– util.sh: helper functions (HTTP calls via curl, JSON handling via jq, error handling)
• No frontend/backend split; this is a library that communicates with an external WebDriver server.
README for additional insights
• Dependencies: Bash or Zsh, jq, ChromeDriver (Selenium server) + Google Chrome, optionally iTerm2/AppleScript for demo2.
• Usage pattern:
• User script sources selenium.sh
• Calls functions like new_session, navigate_to, find_element, send_keys, etc.
• Under the hood: these shell functions construct and issue HTTP requests to ChromeDriver’s JSON-Wire or W3C WebDriver endpoint, parse JSON responses, return values to the caller.
Detail
• Optional/demo flows (demo2 AppleScript) as extensions so that the core library remains uncluttered.