Skip to main content

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):

  1. Command line arguments
  2. Environment variables
  3. Configuration file
  4. 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

  1. Clone the repository
  2. Create a virtual environment
  3. Install development dependencies:
    pip install -e ".[dev]"
    
  4. Run tests:
    pytest
    

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

howdoi_cli-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

howdoi_cli-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for howdoi_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 122676a9b2bf52c2de174975f59ede980c18318cca94949e5a243bf1490ffc5f
MD5 7b713596651c4bba78f8c83281db35e4
BLAKE2b-256 57acc556ce665390314ec62bd9fe5de9c10446fa61fe36b6a4b1166389fccd09

See more details on using hashes here.

Provenance

The following attestation bundles were made for howdoi_cli-0.1.0.tar.gz:

Publisher: publish.yml on mostlydev/howdoi-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for howdoi_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fca8404f80bbdcc0a08e4d95211acf38a60973f63f323a62f7634ec59b0fc49
MD5 2a2ada783c5e396abf9adece6fef3ac8
BLAKE2b-256 88bb8b0e594ff5f0430bfe1146d7bc685a8a88445449e94ce27acbbe61aa7b58

See more details on using hashes here.

Provenance

The following attestation bundles were made for howdoi_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mostlydev/howdoi-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page