perplexity-cli
๐ง A simple command-line client for the Perplexity API. Ask questions and receive answers directly from the terminal! ๐๐๐
๐ง๐ปโโ๏ธ Terminal ecosystem, featuring: โ Framework for cross-shell/cli/tui scripting: bash/nu/deno/unix/โฆ โก Overlay forโฆ
git clone https://github.com/bevry/dorothy.gitbevry/dorothyDorothy is a dotfile ecosystem featuring:
Watch the 2023 November Presentation to see what Dorothy can do!
| Operating System | Architecture | Support |
|---|---|---|
| ๐ macOS | ๐ Apple Silicon (ARM64) | ๐ค CI |
| ๐ macOS | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ Raspberry Pi OS: Desktop, Lite | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| ๐ช Windows 10/11 WSL2: Ubuntu, Debian, AlmaLinux, Kali | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ AlmaLinux | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ AlmaLinux on Raspberry Pi | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| โฒ Arch | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ Intel/AMD (x86_64) | ๐ค CI | |
| ๊ฉ Debian | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๊ฉ Debian on Raspberry Pi | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| ๐ซ Devuan | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ฎ elementary OS | ๐ Intel/AMD (x86_64) | ๐ค CI |
| โ Fedora: Workstation, Server | ๐ Intel/AMD (x84_64) | ๐ค CI |
| โ Fedora on Raspberry Pi: Workstation, Server | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| ๐ Kali | ๐ Intel/AMD (x84_64) | ๐ค CI |
| ๐ Kali on ARM | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| ๐ Intel/AMD (x84_64) | ๐ค CI | |
| ๐ Raspberry Pi (ARM64) | ๐ค CI | |
| โ OpenMandriva: Rock, Rolling | ๐ Intel/AMD (x86_64) | ๐ค CI |
| ๐ฆ OpenSUSE: Leap, Tumbleweed | ๐ Intel/AMD (x84_64) | ๐ค CI |
| ๐ฆ OpenSUSE on Raspberry Pi: Leap, Tumbleweed | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| โญ๏ธ Ubuntu: Desktop, Server | ๐ Intel/AMD (x86_64) | ๐ค CI |
| โญ๏ธ Ubuntu on Raspberry Pi: Desktop, Server | ๐ Raspberry Pi (ARM64) | ๐ค CI |
| โญ Vanilla | ๐ Intel/AMD (x86_64) | ๐ค CI |
Other platforms may or may not be supported. Mageia, Nix, Gentoo are unsupported.
Dorothy has intelligent dependency management with its own setup-util command and setup-util-* ecosystem, that automates and assists dependency and package availability across platforms, architectures, and package systems.
Dependencies that are required to achieve your intended goal, will have their installations initiated correctly. Dependencies that are not required, but provide a superior experience, will have their installations attempted but if an installation fails or is unavailable, the command will not dazzle but will still execute successfully to satisfaction. Sometimes commands can go an extra mile if a dependency is detected, such as for performance or gathering additional optional information, however, if an already suitable dependency is already available then the suitable installed dependency will be used. This enables Dorothy to provide extreme robustness and superiority of its experience.
For instance, installing curl with Dorothy is as easy as executing setup-util-curl, or directly by setup-util --cli=curl APK=curl APT=curl AUR=curl BREW=curl RPM=curl WINGET=cURL ZYPPER=curl. If you want to make it optional, add --optional. If you want to write a command that prefers curl but also supports wget if curl isn't present, see Dorothy's fetch command, or for something even more powerful, see Dorothy's down command.
Important
To initiate Dorothy, some prerequisite dependencies are required:
macOS:
xcode-select --install
Windows 10/11:
# https://learn.microsoft.com/en-au/windows/wsl/install wsl.exe --install --no-distribution # wsl.exe --set-default-version 2 wsl.exe --list --online wsl.exe --install # -d Debian # wsl.exe --set-default Debian wsl.exe --list --verbose # wsl.exe --unregister Debian # do not use --uninstall, that removes WSL
Ubuntu / Debian / Kali:
sudo apt-get update sudo apt-get install bash curl
Fedora:
dnf check-update dnf --refresh --best install bash curl
OpenSUSE / SUSE:
zypper --gpg-auto-import-keys refresh zypper install bash curl
Alpine:
doas apk update doas apk add bash curl
Manjaro:
pamac install bash curl
Arch:
pacman-key --init pacman --refresh --sync --needed bash curl
Void:
xbps-install --sync --update xbps xbps-install --sync bash curl
Now that the prerequisites are installed, Dorothy's intelligent dependency management will be enabled, so you can skip this section. Dorothy's complete requisites for its core experience are as follows:
bash, curl: required prior to initiation of the Dorothy installergrep, git, awk: guaranteed by the Dorothy installer, and used to to install Dorothyjq, deno: guaranteed by Dorothy, for robust regular expressions and configuration managementIf the automated installation of any failed, post an issue including details of your environment, and use their links for alternative installation methods. If you are downloading their binaries straight from GitHub, you can unzip with tar -xvf <archive>, make a discoverable binary directory with mkdir -p -- ~/.local/bin, move the binary there with mv -- <bin> ~/.local/bin, and make the binaries executable with chmod +x ~/.local/bin/*.
Tip
You can trial Dorothy commands without configuring your shell:
To run a specific command in/from the Dorothy environment, enter the following, swapping out everything after the double-dash (--) with whatever command to run:
bash -i # in case your shell doesn't recognize the next command bash -ic "$(curl -fsSL https://dorothy.bevry.me/run)" -- dorothy commands
To run multiple commands in/from a Dorothy-configured REPL, enter the following line by line:
bash -i # in case your shell doesn't recognize the next command bash -ic "$(curl -fsSL https://dorothy.bevry.me/repl)" # now you can run whatever and how many commands as you'd like, such as: dorothy commands echo-style --success=awesome # once you are done, exit the trial environment exit
Important
To install Dorothy enter the following into your favorite terminal application:
bash -i # in case your shell doesn't recognize the next command bash -ic "$(curl -fsSL https://dorothy.bevry.me/install)"
During installation, Dorothy will ask you to create a repository to store your user configuration, such as a dotfiles repository. If you already have a dotfiles repository, you can use that, or make another.
Once installation has completed, open a new terminal instance such that Dorothy is loaded with the new configuration applied. In the new terminal instance, verify the installation and configuration was successful by running dorothy commands, which will list all the Dorothy commands available to you.
If packages are failing to install, go back to the "Prerequisites" section.
If your shell doesn't recognize any of the Dorothy commands (you get a command not found error, or an undefined/unbound variable error), then it could be that:
If you see unrecognised symbols, you probably require fonts. Once Dorothy is loaded, run setup-util-noto-emoji which installs Noto Emoji, a font for enabling emojis inside your terminal. For rendering glyphs, run setup-util-nerd-fonts which will prompt you for which Nerd Font to install. You may need to update your terminal preferences to leverage these installed fonts.
If you are using Visual Studio Code, due to a #wontfix bug in their terminal rendering you will need "terminal.integrated.minimumContrastRatio": 1 in your settings to fix background colours disabling foreground colours (this is automatically applied to the dorothy edit workspace). Visual Studio Code also has another #wontfix bug where tab characters are converted to spaces, preventing their copying, without a workaround.
Dorothy installs itself to $DOROTHY, which defaults to the XDG location of ~/.local/share/dorothy, and consists of the following:
commands directory contains executable commands of super-stable quality, they are actively used within the Dorothy core and by the users of Dorothy.commands.beta directory contains executable commands of beta quality, these are commands that require more usage or possible breaking changes before promotion to commands.config directory contains default configurationsources directory contains scripts that are loaded into the shell environmentthemes directory contains themes that you can select via the DOROTHY_THEME environment variableuser directory is your own github repository for your custom configurationFor each shell that you configured during the Dorothy installation (can be reconfigured via the dorothy install command), the configured shell performs the following steps when you open a new shell instance via your terminal:
The shell loads Dorothy's initialization script:
init.elv scriptinit.fish scriptinit.nu scriptinit.xsh scriptinit.sh script
init.ksh and init.dash scripts before loading init.sh. This is because KSH, Dash, and Bash all share the same .profile configuration file, so different initialization scripts allow us to configure each of them independently.The initialization script will:
Ensure the DOROTHY environment variable is set to the location of the Dorothy installation.
If a login shell, it loads our environment script sources/environment.(bash|dash|elv|fish|ksh|nu|xsh|zsh), which will:
commands/setup-environment-commands which determines and applies all necessary environment configuration changes to the shell. It loads your user/config(.local)/environment.bash configuration script for your own custom environment configuration that will be applied to all your login shells.If a login and interactive shell, it loads our interactive script sources/interactive.(bash|dash|elv|fish|ksh|nu|xsh|zsh), which will:
user/config(.local)/interactive.(sh|bash|dash|elv|fish|ksh|nu|xsh|zsh) configuration script for your own interactive login shell configuration.
interactive.elv if it exists.interactive.fish if it exists, otherwise it will load interactive.sh.interactive.nu and it must exist.interactive.xsh if it exists.interactive.(bash|zsh|...etc) file if it exists, otherwise they will load interactive.sh if exists.This is the foundation that enables Dorothy's hundreds of commands to work across hundreds of machines, across dozens of operating system and shell combinations, seamlessly.
Your user configuration goes to the XDG location of ~/.local/config/dorothy which Dorothy symlinks to ~/.local/share/dorothy/user, your user configuration consists of the following:
commands directory, for public commandscommands.local directory, for private commands (git ignored by default)config directory, for public configurationconfig.local directory, for private configuration (git ignored by default)The order of preference within Dorothy is (commands|config).local first, then (commands|config), then Dorothy's own (commands|config) then everything else.
You can find the various configuration files that are available to you by browsing Dorothy's default config directory.
Use these sources to find inspiration for your own user commands and configuration.
commands directory for super-stable commands with up to date conventions.commands.beta directory for beta-quality commands with possibly outdated conventions.docs directory containing tips and tricks for Dorothy, and various shells, such as enabling private user configurations, and the manual to assisted philosophy of DorothyAfter installing Dorothy, there will now a plethora of commands available to you. You can invoke any stable command with --help to learn more about it. The most prominent commands are noted below.
Stable commands:
setup-system install correctly setup your system to your prompted preferencessetup-system update correctly update your system to your existing preferencesThis is done via these commands:
setup-linux correctly setup your Linux system, and its various packaging systems, as desired
setup-mac correctly setup your macOS system, including its homebrew and Mac App Store installations, as desired
setup-bin correctly setup available CLI utilities from installed GUI Applications
setup-git correctly setup Git on your system, including your profile, SSH, GPG, and 1Password configurations, as desired.
Related commands:
gpg-helper interact with your GPG keysssh-helper interact with your SSH keyssetup-go correctly setup GoLang on your system if desired or if required for your desired packages
setup-node correctly setup Node.js on your system if desired or if required for your desired packages
setup-python correctly setup Python on your system if desired or if required for your desired packages
setup-ruby correctly setup Ruby on your system if desired or if required for your desired packages
setup-rust correctly setup Rust on your system if desired or if required for your desired packages
setup-utils correctly setup your selected setup-util-* utilities as desired
setup-util is an intelligent wrapper around every package system, allowing a cross-compatible way to install, upgrade, and uninstall utilities.
It is used by the hundreds of setup-util-* commands, which enable installing a utility as easy as invoking setup-util-<utility>
If you don't know which command you need to call, you can use get-installer to get which command you will need to invoke to install a utility/binary/application.
setup-shell correctly configure your desired shell to be your default shell.
By default, your terminal application will use the login shell configured for the system, as well as maintain a whitelist of available shells that can function as login shells.
edit quickly open a file in your preferred editor, respecting terminal, SSH, and desktop environments.
down download a file with the best available utility on your computer.
github-download download files from GitHub without the tedium.
secret stops you from leaking your env secrets to the world when a malicious program sends your shell environment variables to a remote server. Instead, secret will use 1Password to securely expose your secrets to just the command that needs them. Specifically:
setup-dns correctly configures your systems DNS to your preferences
A large security concern these days of using the internet, is the leaking, and potential of modification of your DNS queries. A DNS query is what turns google.com to say 172.217.167.110. With un-encrypted DNS (the default), your ISP, or say that public Wifi provider, can intercept these queries to find out what websites you are visiting, and they can even rewrite these queries, to direct you elsewhere. This is how many public Wifi providers offer their service for free, by selling the data they collect on you, or worse.
The solution to this is encrypted DNS. Some VPN providers already include it within their service, however most don't. And if you have encrypted DNS, then you get the benefits of preventing eavesdropping without the need for expensive VPN, and the risk of your VPN provider eavesdropping on you.
Dorothy supports configuring your DNS to encrypted DNS via the setup-dns command, which includes installation and configuration for any of these:
Related commands:
flush-dns lets you easily flush your DNS anytime, any system.setup-hosts lets you easily select from a variety of HOSTS files for security and privacy, while maintaining your customizations.mount-helper lets you easily, correctly, and safely mount, unmount, automount, various devices, filesystems, network shares, gocryptfs vaults, etc, on any system.
Related commands:
get-devices cross-platform fetching and filtering of select and complete device informationgocryptfs-helper helpers for GoCryptFSwhat-is-using find out what is using a path so that you can unmount it safelyDorothy also provides commands for writing commands, such as:
bash.bash for a Bash strict mode that actually works, and various shims/polyfillsask, confirm, and choose for prompting the user for inputecho-style, echo-error, echo-verbose, and eval-helper for output stylingecho-*, fs-*, get-*, and is-* helpersBeta commands:
mail-sync helps you migrate all your emails from one cloud provider to another.Stable commands:
fs-alias helps you manage your macOS aliases, and if desired, convert them into symlinks.macos-drive helps you turn a macOS installer into a bootable USB drive.macos-installer fetches the latest macOS installer.sparse-vault lets you easily, and for free, create secure encrypted password-protected vaults on your mac, for securing those super secret data.Beta commands:
eject-all eject all removable drives safely.icloud-helper can free up space for time machine by evicting local iCloud caches.itunes-owners generates a table of who legally owns what inside your iTunes Media Library โ which is useful for debugging certain iTunes Store authorization issues, which can occur upon backup restorations.macos-settings helps configure macOS to your preferred system preferences.macos-state helps you backup and restore your various application and system preferences, from time machine backups, local directories, and sftp locations. This makes setting up clean installs easy, as even the configuration is automated. And it also helps you never forget an important file, like your env secrets ever again.macos-theme helps you change your macOS theme to your preference, including your wallpaper and editor.tmutil-helper can free up space for bootcamp by evicting local Time Machine caches.Beta commands:
convert-helper convert one media format to anotherget-codec gets the codec of a media fileis-audio-mono checks if an audio file is monois-audio-stereo checks if an audio file is stereopdf-decrypt will mass decrypt encrypted PDFs.pdf-decrypt decrypts a PDF filesvg-export converts an SVG image into a desired image formatvideo-merge will merge multiple video files in a directory together into a single video file.wallhaven-helper download your wallpaper collections from Wallhavenxps2pdf will convert a legacy XPS document into a modern PDF document.ytd-helper helps you download videos from the internet with simplified options.Join the Bevry Software community to stay up-to-date on the latest Dorothy developments and to get in touch with the rest of the community.
Discover how to contribute via the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under:
more like this
๐ง A simple command-line client for the Perplexity API. Ask questions and receive answers directly from the terminal! ๐๐๐
meine ๐ - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich tโฆ
search projects, people, and tags