AI-powered CLI tool for shell commands
Project description
How Do I CLI
A simple CLI tool that explains how to use shell commands using AI models.
Installation
# From PyPI
pip install howdoi-cli
# From source
git clone https://github.com/mostlydev/howdoi-cli
cd howdoi-cli
pip install -e .
Configuration
The tool can be configured in multiple ways (in order of precedence):
- Command line arguments
- Environment variables
- Configuration file
- Default values
Configuration File
Create a config.yaml file in ~/.config/howdoi-cli/config.yaml:
provider: anthropic # or openai
model: claude-3-5-sonnet-20241022 # or gpt-4
max_tokens: 1000
temperature: 0.7
Environment Variables
export HOW_PROVIDER=anthropic
export HOW_MODEL=claude-3-5-sonnet-20241022
export HOW_MAX_TOKENS=1000
export HOW_TEMPERATURE=0.7
# API Keys
export ANTHROPIC_API_KEY=your_key_here
export OPENAI_API_KEY=your_key_here
Usage
# Get help
how --help
# Basic usage - be specific about what you want to achieve
how do i extract all files from a tar.gz archive to current directory
how do i expose port 8080 for a nginx docker container
how do i list all kubernetes pods in namespace production
# The "do i" is automatically added if you forget it
how extract files from images.tar.gz to ./output
# For best results:
# - Include specific file names or paths
# - Mention target directories or destinations
# - Specify ports, namespaces, or other relevant parameters
# - Include format or version information when relevant
# Examples of specific queries:
how do i find all python files modified in last 7 days
how do i create a cronjob that runs every monday at 8am
how do i configure nginx to redirect http to https on port 443
# Specify provider/model
how --provider openai --model gpt-4 do i extract files from data.tar.gz
Development
- Clone the repository
- Create a virtual environment
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
MIT
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 howdoi_cli-0.1.0.tar.gz.
File metadata
- Download URL: howdoi_cli-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
122676a9b2bf52c2de174975f59ede980c18318cca94949e5a243bf1490ffc5f
|
|
| MD5 |
7b713596651c4bba78f8c83281db35e4
|
|
| BLAKE2b-256 |
57acc556ce665390314ec62bd9fe5de9c10446fa61fe36b6a4b1166389fccd09
|
Provenance
The following attestation bundles were made for howdoi_cli-0.1.0.tar.gz:
Publisher:
publish.yml on mostlydev/howdoi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
howdoi_cli-0.1.0.tar.gz -
Subject digest:
122676a9b2bf52c2de174975f59ede980c18318cca94949e5a243bf1490ffc5f - Sigstore transparency entry: 162741782
- Sigstore integration time:
-
Permalink:
mostlydev/howdoi-cli@aefbd9274863e7d267387d4433838c957e159eb2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mostlydev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aefbd9274863e7d267387d4433838c957e159eb2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file howdoi_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: howdoi_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fca8404f80bbdcc0a08e4d95211acf38a60973f63f323a62f7634ec59b0fc49
|
|
| MD5 |
2a2ada783c5e396abf9adece6fef3ac8
|
|
| BLAKE2b-256 |
88bb8b0e594ff5f0430bfe1146d7bc685a8a88445449e94ce27acbbe61aa7b58
|
Provenance
The following attestation bundles were made for howdoi_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mostlydev/howdoi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
howdoi_cli-0.1.0-py3-none-any.whl -
Subject digest:
6fca8404f80bbdcc0a08e4d95211acf38a60973f63f323a62f7634ec59b0fc49 - Sigstore transparency entry: 162741784
- Sigstore integration time:
-
Permalink:
mostlydev/howdoi-cli@aefbd9274863e7d267387d4433838c957e159eb2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mostlydev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aefbd9274863e7d267387d4433838c957e159eb2 -
Trigger Event:
release
-
Statement type: