A terminal app to query xAI's Grok API
Project description
How
how is a simple Linux terminal application that lets you query an AI chatbot (powered by xAI's Grok) and get plain text answers directly in your terminal. Ask anything—like how to find file sizes in a directory—and get a concise response.
Example:
how --q "find size of files in directory and list by file size"
Response:
du -sh | sort -h
Features
- Lightweight and dependency-minimal (only requires requests).
- Configurable via a local file (~/.how_config) for your xAI API key.
- Installable system-wide with a simple setup process.
Installation
1. Install from PyPI
pip3 install how --user
This installs how to ~/.local/bin, which should be in your PATH. If not, add it:
export PATH="$HOME/.local/bin:$PATH"`
- Set Your API Key Configure your xAI API key:
how --key "your-xai-api-key-here"
This saves the key to ~/.how_config.
Usage
- Ask a Question
how --q "your question here"
Example:
how --q "how do I list all running processes?"
Output:
"Use this command: ps aux"
- Set or Update API Key
how --key "new-xai-api-key"
- Check Help
how --help
Troubleshooting
- "No API key found" Error Run how --key "<your-api-key>" to set your key.
- 403 Forbidden Error Verify your API key is valid and has access to the grok-2-latest model in the xAI Console. Regenerate it if needed.
- Command Not Found Ensure ~/.local/bin is in your PATH (see installation step 3).
- ModuleNotFoundError: No module named 'setuptools' Install it with pip3 install setuptools.
Uninstallation
Remove the application:
bash
pip3 uninstall how
Delete the config file (optional):
bash
rm ~/.how_config
Contributing
Feel free to fork this project, submit issues, or send pull requests. Ideas for improvements:
- Add response caching.
- Support additional AI models.
- Enhance error messages.
License
This project is open-source under no license.
Credits
Built by Gregory Ellis.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file howdo-0.1.1.tar.gz.
File metadata
- Download URL: howdo-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08d9d1bea7d85ac2aa4958aaac4d62a37c7d5c73cef5b927e275e9fc8d96fa41
|
|
| MD5 |
e26bd7ec32d7677cc97e073dc9c265f2
|
|
| BLAKE2b-256 |
f202aa453e6aeae84fccbe5e20caf1cbb7d26449e27eea321abc53e7dbd98bc6
|
File details
Details for the file howdo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: howdo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e3e84e88a4ae6b5ad26f17aabd0b79401aa9972f020f52fa47007db6fd7ad77
|
|
| MD5 |
a5d662114769f65f40ed94b7483d289c
|
|
| BLAKE2b-256 |
c137373e95cf1ef1ca1b7e8e45c0b655eefdfa2a192fa65589cdcc13b56c8d0a
|