- HTML 79.6%
- Rust 20.4%
| .cargo | ||
| .config | ||
| assets | ||
| src | ||
| test_data/pages | ||
| tests | ||
| .build.yml | ||
| .gitignore | ||
| bacon.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| clippy.toml | ||
| LICENSE | ||
| README.md | ||
omry-cli
Experimental CLI for Omry, an offline archive and search for web pages.
Note: this project's initial name was 'flora-cli', which you may still find throughout the code and documentation.
Changes introduced in new versions are documented in the changelog.
Getting started
Prerequisites:
- Latest stable Rust toolchain (use rustup if you are unsure how to get it).
Start the Omry backend
omry-cli is a client-side application, and requires the Omry backend service to work.
Follow these instructions to run the Omry backend.
Note omry-server's ports for RPC and web, which will be in "listening on ..." log
message when the server is ready.
Omry server address
The defaults (assuming you're running on localhost) are:
- RPC:
localhost:37373 - Web:
http://localhost:37374(note thehttp://for the web, but not RPC).
The host can be different, depending on your environment
(if running Omry in Docker, Podman, on a different machine on the network, etc.)
Install
To install or update omry-cli, run:
Latest release:
cargo install --locked omry-cli
From the main branch of this repo:
cargo install --git https://git.sr.ht/\~anya_hope/omry-cli
Both will install omry-cli, and should add it to your PATH.
When the installation finishes, run the client:
omry-cli
Once open, enter any text to search your Omry archive, or /help to see what else you can do.
Note: Despite omry-cli's name, it currently only supports interactive mode.
I plan to implement a real CLI interface in the future,
so you can use omry-cli to run one-off tasks against the Omry backend on the command line.
Note for WSL
On WSL, you need to have a browser installed inside your WSL distro (e.g. chromium-browser on Ubuntu).
This is not ideal, but I have not found a way to use a Windows-side browser that reliably works across
different environments and distributions.
Configuring the Omry host and port
The first time omry-cli runs, it will prompt you to input the host and port for the Omry backend service.
On most systemts, omry-cli will then put those in a new config file, stored under
your system's standard config directory.
Those are (if your username is "Alice"):
- Linux/WSL:
/home/alice/.config/omry-cli - macOS:
/Users/Alice/Library/Application Support/me.anyahope.omry.omry-cli
See directories for details about standard locations on different systems.
If you switch to using the Omry backend at a different network location, you will need to change the config.toml
in your config directory.
Using omry-cli to add documents to Omry
I recommend adding documents via your browser. The below instructions are only necessary if you want to add documents manually.
Prerequisites:
- SingleFile browser extension, available for Chrome, Firefox, and Safari.
This is the current flow for saving pages via omry-cli:
- (Install SingleFile, a free and open source extension that can save a web page as a single HTML file).
- In your browser, navigate to the page you want to save
- Use SingleFile to save the page to your computer as an HTML file. SingleFile will include CSS and deferred content (like images). It will also add useful metadata (your local time, original URL)
- Get the absolute path to that HTML file
- use
/add <path>inomry-cliimport it into Omry
Note: omry-cli does not support adding HTML documents that weren't created by SingleFile.
Using HTML files not created by SingleFile (e.g. via your browser's "Save Page" function) may lead
to import errors or unexpected results.
This process has more steps than I'd like, but it's necessary to load the page in your browser
(vs. passing omry-cli a URL). That ensures that the page you're saving to Omry is the page you want
(and not a CAPTCHA, a paywall, login screen, or something else that isn't the document you want saved).
Acknowledgements
ASCII art was generated with Image to ASCII Art.