| Crates.io | task-sh |
| lib.rs | task-sh |
| version | 0.1.3 |
| created_at | 2025-10-26 21:24:20.758827+00 |
| updated_at | 2025-10-27 17:22:10.37473+00 |
| description | AI-powered shell command generator |
| homepage | https://task.sh |
| repository | https://github.com/barledge/task.sh |
| max_upload_size | |
| id | 1901900 |
| size | 2,279,991 |
task.sh turns natural language task descriptions into safe shell command suggestions using OpenAI. The CLI is designed for cross-platform usage (Linux, macOS) and emphasizes safety, observability, and customization.
task gen subcommand with --shell selection (bash, zsh).TASK_SH_FAKE_RESPONSE environment variable for deterministic tests.git clone https://github.com/barledge/task.sh.git
cd task.sh
cargo install --path .
cp .env.example .env
Edit .env and set OPENAI_API_KEY to your secret key.
# Generate a bash command with explanation
task gen "list large files" --shell bash -v
# Pipe input via stdin
echo "list staged changes" | task gen --verbose
# Use the fake response mode for testing/demos
TASK_SH_FAKE_RESPONSE=$'Command: ls\nExplanation: list files' task gen "anything"
Inspect all options:
sh --help
OPENAI_API_KEY: Required for live generation.TASK_SH_FAKE_RESPONSE: Optional string that substitutes the OpenAI response for testing.cargo fmt
cargo clippy --all-targets
cargo test
scripts/build-release.sh
scripts/publish.sh
For cross-compilation (requires cargo-zigbuild):
scripts/build-cross.sh x86_64-unknown-linux-gnu
scripts/build-cross.sh x86_64-pc-windows-gnu
scripts/build-cross.sh aarch64-apple-darwin
The mdBook-based docs live in docs/.
cargo install mdbook
mdbook build docs
Publish to task.sh/docs or serve locally with mdbook serve docs.
cargo fmt, cargo clippy, and cargo test before submitting a PR.Licensed under the MIT License.