Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

158 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Latest Release Lint CI Test pre-commit Conventional Commits KeepAChangelog

zsh-ai

zsh-ai is a Zsh plugin that provides installation and management for AI development tools including OpenCode, Fabric, Ollama, and more.

Screenshots

Project hero zsh-ai hero image

Requirements

This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:

Installation

oh-my-zsh users

If you're using oh-my-zsh, install this plugin by doing the following:

  1. Go to your oh-my-zsh custom plugins directory -cd ~/.oh-my-zsh/custom/plugins
  2. Clone the plugin bash git clone https://github.com/hadenlabs/zsh-aibash
  3. Edit your .zshrc and add plugins=( ... zsh-ai ) to your list of plugins
  4. Open a new terminal and enjoy!

antigen users

If you're using Antigen, install this plugin by doing the following:

  1. Add antigen bundle hadenlabs/zsh-ai to your .zshrc where you're adding your other plugins.
  2. Either open a new terminal to force zsh to load the new plugin, or run antigen bundle hadenlabs/zsh-ai in a running zsh session.
  3. Enjoy!

antibody users

If you're using Antibody, install this plugin by doing the following:

  1. Add :
antibody bundle hadenlabs/zsh-ai

to your .zshrc where you're adding your other plugins.

  1. Either open a new terminal to force zsh to load the new plugin, or run antibody bundle hadenlabs/zsh-ai in a running zsh session.
  2. Enjoy!

Usage

πŸš€ How to use this project

Prerequisites

Before getting started, ensure you have the following installed:

  • Python (3.11 or higher) - Check with python --version
  • Task (Taskfile runner) - Install with brew install go-task/tap/go-task or follow official installation

Quick Start

1. First-time Setup

When cloning the repository for the first time, you need to download the Taskfile dependencies:

task --yes

This command downloads all the external Taskfile dependencies defined in the main Taskfile.yml.

2. Environment Setup

Set up the development environment with all necessary dependencies:

task environment

This command:

  • Sets up the Python virtual environment with uv
  • Prepares the development environment

3. Project Setup

Install all project dependencies and configure the development environment:

task setup

This command:

  • Creates .env file from .env.example if it doesn't exist
  • Installs Python dependencies with uv
  • Sets up pre-commit hooks
  • Configures Git hooks

OpenCode tasks (optional)

If you use OpenCode in this repository, you can scaffold a task template for a new feature under .jasper/.tmp/tasks/.

From the OpenCode TUI:

/task-template readme-refresh

Or via CLI:

opencode run --command task-template readme-refresh

Examples

Common

Install Dependencies

task setup

Functions

Public Functions

ai::install

Install all AI packages defined in AI_PACKAGES.

ai::install

ai::packages::install

Install all packages defined in AI_PACKAGES array.

ai::packages::install

ai::post_install

Execute post-installation steps.

ai::post_install

ai::upgrade

Upgrade AI packages (not yet implemented).

ai::upgrade

ai::opencode::install

Install opencode CLI tool. Checks if opencode is already installed using which before attempting installation.

ai::opencode::install

ai::opencode::sync

Sync opencode configuration from local data/opencode/ directory to opencode config directory (~/.config/opencode/). Uses rsync for synchronization.

ai::opencode::sync

ai::fabric::install

Install fabric CLI tool for AI patterns. Checks if fabric is already installed before attempting installation.

ai::fabric::install

ai::fabric::patterns::sync

Sync custom patterns from local data/patterns/ directory to fabric's patterns directory (~/.config/fabric/patterns/). Uses rsync for synchronization.

ai::fabric::patterns::sync

ai::fabric::patterns::pull

Update fabric patterns from the official repository using fabric --updatepatterns.

ai::fabric::patterns::pull

ai::ollama::install

Install ollama CLI tool for running LLMs locally. Checks if ollama is already installed before attempting installation.

ai::ollama::install

ai::ollama::models::list

List all installed ollama models.

ai::ollama::models::list

ai::ollama::models::pull

Download a model from ollama registry.

ai::ollama::models::pull llama3.2
ai::ollama::models::pull mistral

ai::ollama::models::install

Install all default models defined in AI_OLLAMA_MODELS array.

ai::ollama::models::install

ai::shimmy::install

Install shimmy CLI tool for local LLM inference server. OpenAI API compatible. Downloads binary based on OS and architecture.

ai::shimmy::install

ai::hf::install

Install hf CLI tool (Hugging Face CLI). The new CLI for interacting with Hugging Face Hub - download models, upload files, manage cache, etc.

ai::hf::install

ai::openclaw::install

Install openclaw CLI tool for AI-powered code analysis and refactoring. Checks if openclaw is already installed before attempting installation.

ai::openclaw::install

ai::tmuxai::install

Install tmuxai CLI tool. Checks if tmuxai is already installed before attempting installation.

ai::tmuxai::install

Internal Functions

ai::internal::packages::install

Internal function that iterates through AI_PACKAGES and installs each one with appropriate handling.

ai::internal::packages::install

ai::internal::opencode::load

Internal function that adds opencode binary path to PATH. Checks if ~/.opencode/bin exists and prepends it to PATH.

ai::internal::opencode::load

ai::internal::opencode::install

Internal function for opencode installation logic. Verifies if opencode exists before installing via curl.

ai::internal::opencode::install

ai::internal::fabric::install

Internal function for fabric installation logic. Verifies if fabric exists before installing via curl.

ai::internal::fabric::install

ai::internal::fabric::patterns::sync

Internal function for syncing patterns using rsync.

ai::internal::fabric::patterns::sync

ai::internal::fabric::patterns::pull

Internal function for pulling patterns from fabric's official repository.

ai::internal::fabric::patterns::pull

ai::internal::ollama::install

Internal function for ollama installation logic. Verifies if ollama exists before installing via curl.

ai::internal::ollama::install

ai::internal::ollama::models::list

Internal function for listing installed ollama models.

ai::internal::ollama::models::list

ai::internal::ollama::models::pull

Internal function for downloading ollama models.

ai::internal::ollama::models::pull llama3.2

ai::internal::ollama::models::install

Internal function for installing all default models from AI_OLLAMA_MODELS array.

ai::internal::ollama::models::install

ai::internal::shimmy::load

Internal function that adds shimmy binary path to PATH. Checks if ~/.local/bin exists and prepends it to PATH.

ai::internal::shimmy::load

ai::internal::shimmy::install

Internal function for shimmy installation logic. Detects OS and architecture, downloads appropriate binary from GitHub releases.

ai::internal::shimmy::install

ai::internal::hf::install

Internal function for hf CLI installation logic. Downloads and installs Hugging Face CLI from official installer.

ai::internal::hf::install

ai::internal::openclaw::load

Internal function that adds openclaw binary path to PATH. Checks if ~/.local/bin exists and prepends it to PATH.

ai::internal::openclaw::load

ai::internal::openclaw::install

Internal function for openclaw installation logic. Downloads the appropriate binary for the current architecture from GitHub releases.

ai::internal::openclaw::install

ai::internal::tmuxai::install

Internal function for tmuxai installation logic. Verifies if tmuxai exists before installing via curl.

ai::internal::tmuxai::install

Variables

Variable Description
AI_PACKAGE_NAME Name of the package (default: ai)
AI_TOOLS Array of AI tools to install
AI_PACKAGES Array of all packages (combines AI_TOOLS)
AI_MESSAGE_BREW Message for brew requirement
AI_OPENCODE_ROOT_PATH Root path for opencode (default: ~/.opencode)
AI_OPENCODE_BIN_PATH Binary path for opencode (default: ~/.opencode/bin)
AI_FABRIC_PATTERNS_PATH Path to fabric patterns (default: ~/.config/fabric/patterns)
AI_FABRIC_PATTERNS_SYNC_SOURCE Source path for custom patterns (ZSH_AI_PATH/data/patterns)
AI_OLLAMA_MODELS_PATH Path to ollama models (default: ~/.ollama/models)
AI_OLLAMA_MODELS Array of default ollama models to install
AI_SHIMMY_BIN_PATH Binary path for shimmy (default: ~/.local/bin)
AI_OPENCLAW_BIN_PATH Binary path for openclaw (default: ~/.local/bin)
AI_INSTALL_URL_OPENCODE Installation URL for opencode
AI_INSTALL_URL_FABRIC Installation URL for fabric
AI_INSTALL_URL_OLLAMA Installation URL for ollama
AI_INSTALL_URL_SHIMMY Installation URL for shimmy (GitHub releases)
AI_INSTALL_URL_HF Installation URL for hf CLI
AI_INSTALL_URL_OPENCLAW Installation URL for openclaw (GitHub releases)
AI_APPLICATION_PATH Path to applications (macOS only)
AI_ARCHITECTURE_NAME Architecture name (e.g., darwin-arm64, linux-amd64)

Help

Got a question?

File a GitHub issue.

Contributing

See Contributing.

Module Versioning

This Module follows the principles of Semantic Versioning (SemVer).

Using the given version number of MAJOR.MINOR.PATCH, we apply the following constructs:

  1. Use the MAJOR version for incompatible changes.
  2. Use the MINOR version when adding functionality in a backwards compatible manner.
  3. Use the PATCH version when introducing backwards compatible bug fixes.

Backwards compatibility in 0.0.z and 0.y.z version

  • In the context of initial development, backwards compatibility in versions 0.0.z is not guaranteed when z is increased. (Initial development)
  • In the context of pre-release, backwards compatibility in versions 0.y.z is not guaranteed when y is increased. (Pre-release)

Copyright

Copyright Β© 2018-2026 Hadenlabs

Trademarks

All other trademarks referenced herein are the property of their respective owners.

License

The code and styles are licensed under the LGPL-3.0 license See project license..

Don't forget to 🌟 Star 🌟 the repo if you like zsh-ai

Your feedback is appreciated

About

Zsh ai

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages