Skip to content

lassoColombo/aiai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

aiai 🤦 nushell AI toolkit

aiai is a Nushell collection providing CLI functions to interact with AI models.

Features

  • Interactive AI chat assistant
  • Automated commit message generation (Conventional Commits)
  • Git diff summarization
  • Generate a resumeow template tailored to a job offer
  • Configuration and prompt management

Installation

  1. Clone the repository (or copy the module files) into one of your $env.NU_LIB_DIRS:

    git clone <your-repo-url> ~/nu_libs/aiai
  2. Use the module (e.g., in ~/.config/nushell/config.nu):

    use aiai
  3. Ensure dependencies are installed:

    • Nushell (v0.85+ recommended)
    • Ollama running locally (ollama serve)
    • git (for commit/diff features)
    • $EDITOR environment variable set (for editing features)
    • glow - optional - (for markdown rendering)

Exported Functions

chat

Interactive AI chat assistant.

aiai chat [--prompt(-p) <prompt>]
  • --prompt(-p): Name of a saved system prompt to use. Supports autocompletion

Features:

  • Chat with an AI model.
  • Inline commands: :q, :quit, :h, :help, :n, :new, :e, :edit, :c, :ctx, :p, :prompt.
  • Switch system prompt, reset context, edit context or prompt, and more.

chat prompts

Edit or create system prompts.

aiai chat prompts
  • Opens the prompt directory in your editor (location is configurable via cfg).

action generate-resumeow-spec

Tailored resume generation

aiai action generate-resumeow-spec \
  --profile-file(-P) <profile.json> \
  --offer-file(-O) <offer.txt> \
  [--color(-c) <hex>] \
  [--lang(-l) <lang>] \
  [--output(-o) <file>] \
  [--yes(-y)]
  • Generates a resumeow JSON spec for a CV based on a profile and job offer, tailored to the offer.
  • Filters and translates competences as needed.
  • Output can be piped into resumeow for PDF/LaTeX generation.

action commit

AI-powered Conventional Commit message generator.

aiai action commit [--path(-p) <glob>]
  • Analyzes recent git log and diff (optionally restricted by path).
  • Proposes a Conventional Commit message (no scope, with explanation).
  • Asks for approval before committing.

action summarize-diff

Summarize git diffs using AI.

aiai action summarize-diff [--diff(-d) <diff>]
  • Summarizes the current or provided git diff using the configured model.

cfg

Get current AI configuration.

aiai cfg
  • Returns the current configuration (model, prompt_dir, options, etc).

cfg set-param

Set a configuration parameter.

aiai cfg set-param <param> <value>
  • Example: cfg set-param model llama3.2:latest
  • Supports autocompletion for parameter names and values.

cfg edit

Edit the AI configuration in your editor.

aiai cfg edit
  • Opens the configuration in your $EDITOR or fallback editor.

do

Autonomous coding agent with tool execution.

aiai do
  • Interacts with an AI agent that can request file/directory creation or ask questions.
  • Executes tool requests as specified by the AI (with user confirmation).
  • Experimental feature.

Configuration

  • Configuration is stored in the $env.AI_CFG environment variable.
  • Default config includes:
    • model: e.g. llama3.2:latest
    • options: temperature, num_predict, top_p, num_ctx, repeat_penalty
    • prompt_dir: Directory for prompt files (default: $env.HOME)
  • Use cfg, cfg set-param, and cfg edit to view and modify configuration.

Prompts

  • Prompts are stored in the directory specified by prompt_dir (default: ~/prompts).
  • Use chat prompts to manage them.

Example Workflow

  1. Chat with the AI:

    aiai chat
  2. Generate a commit message:

    aiai action commit
  3. Filter and translate a resume:

    aiai action generate-resumeow-spec -P profile.json -O offer.txt -l italian

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published