JSPM

  • Created
  • Published
  • Downloads 282
  • Score
    100M100P100Q102704F
  • License SEE LICENSE IN LICENSE

AI-powered CLI assistant for terminal productivity

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@aiiware/aii) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @aiiware/aii

    AI-powered CLI assistant with autonomous tool execution. An intelligent agent that can read, write, search, and execute commands in your terminal.

    Installation

    npm install -g @aiiware/aii

    Requirements

    • Node.js 18+
    • Aii Server running (default: localhost:26169)

    Quick Start

    # Start interactive agent mode
    aii
    
    # Or run a single query
    aii "explain what this project does"
    
    # Pipe content for processing
    cat error.log | aii "summarize the errors"
    
    # Auto-approve tool execution
    aii --auto

    Agent Mode (Default)

    Aii runs as an intelligent agent that can autonomously execute tools to complete tasks:

    aii                    # Start interactive session
    aii "your task"        # Run single task and exit

    Available Tools

    Tool Description
    Read Read file contents
    Write Create or overwrite files
    Edit Make targeted edits to files
    Glob Find files by pattern
    Grep Search code with regex
    Bash Execute shell commands
    WebSearch Search the web
    WebFetch Fetch and parse web pages

    Interactive Commands

    In agent mode, use these commands:

    /help              Show available commands
    /clear             Clear conversation history
    /history           Show conversation history
    /stats             Show session statistics (tokens, cost)
    /model <model>     Switch LLM model
    /provider <name>   Switch LLM provider
    /context           View context window usage
    /init              Generate AGENTS.md for your project
    /init --with-hooks Generate AGENTS.md + hooks.json template
    /init help         Show /init usage and options
    /hooks help        Show /hooks usage and options
    /memory            View loaded project instructions
    /memory reload     Hot-reload instructions without restart
    /hooks             View configured hooks
    /hooks reload      Hot-reload hooks without restart
    /skills            List available skills
    /skills help       Show skills management commands
    /skills reload     Re-discover skills without restarting
    /commit            Generate commit message and commit
    /exit              Exit the session

    Keyboard Shortcuts

    Key Action
    Enter Submit input
    Esc Cancel current request
    Ctrl+C Exit immediately
    Up/Down Navigate input history
    Tab Autocomplete commands

    Output Modes

    aii "query" --clean        # Just the result
    aii "query" --standard     # Result + metrics (default)
    aii "query" --thinking     # Full reasoning chain

    Prompt Templates

    Use pre-built templates for common tasks:

    aii prompt list                       # List available prompts
    aii prompt show <name>                # Show prompt details
    aii prompt use <name> --var value     # Use a prompt template

    Configuration

    aii config show                # Show current configuration
    aii config validate            # Validate configuration
    aii config set <key> <value>   # Set a configuration value
    aii config model <model>       # Change LLM model
    aii config provider <provider> # Change LLM provider

    Config Files

    Configuration is stored in ~/.aii/:

    config.yaml - Main configuration:

    llm:
      provider: anthropic
      model: claude-sonnet-4
      temperature: 0.7
    
    api:
      url: http://localhost:26169

    secrets.yaml - API keys:

    anthropic_api_key: sk-ant-...
    openai_api_key: sk-...
    deepseek_api_key: sk-...

    Or use environment variables: ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY

    CLI Options

    Option Description
    --auto Auto-approve all tool executions
    --clean Clean output mode
    --standard Standard output mode (default)
    --thinking Show full reasoning
    --model <model> Override LLM model
    --host <host:port> API server host
    --no-streaming Disable streaming output
    --quiet Minimal output
    --verbose Show detailed stats
    --no-context Disable context management

    Context Window Management (v0.3.0)

    Prevents "token limit exceeded" errors in long conversations with intelligent auto-summarization.

    Status Bar Indicator: Shows real-time usage with color-coded alerts (🟢 🟡 🔴)

    Dynamic Thresholds: Automatically adjusts based on each model's output capacity

    • Claude Sonnet (32% output) → 63% critical threshold
    • Gemini Flash (3% output) → 92% critical threshold

    Auto-Summarization: Older messages summarized when reaching critical threshold (~70%), preserving recent ~30K tokens in full

    Commands:

    • /context - View detailed usage breakdown
    • /context clear - Manually trigger summarization

    Project Instructions (v0.5.0)

    Teach the agent your project's conventions. Create an AGENTS.md file in your project root, and the agent will automatically learn your coding standards, commands, and rules.

    Quick Setup

    # Auto-generate AGENTS.md by analyzing your project
    /init
    
    # View what instructions are loaded
    /memory

    The /init command detects your language, framework, build commands, and generates a customized AGENTS.md. Edit it to add your team's conventions.

    Supported Files

    The agent discovers instruction files in this priority order:

    • AII.md or AGENTS.md in project root
    • ~/.aii/AGENTS.md for global preferences

    Example AGENTS.md

    # My Project
    
    ## Commands
    - Build: `npm run build`
    - Test: `npm test`
    - Lint: `npm run lint`
    
    ## Coding Standards
    - Use TypeScript strict mode
    - Prefer async/await over callbacks
    - Maximum line length: 100
    
    ## Safety Rules
    Never modify without asking:
    - .env files
    - Database migrations

    Hooks (v0.5.0)

    Extend agent behavior with custom scripts. Create .aii/hooks.json to run scripts before/after tool execution:

    # Generate a hooks template
    /init --with-hooks
    
    # View configured hooks
    /hooks
    
    # Show usage and options
    /hooks help

    Hooks let you add validation, logging, or approval gates. See the hooks documentation for details.

    Skills (v0.6.0)

    Skills are reusable agent prompts that extend Aii with specialized capabilities.

    Invoking Skills

    Natural language -- just describe what you want, and the agent detects the right skill:

    > explain what's an LLM
    > commit my changes
    > review the latest PR

    Slash commands (explicit):

    /commit              # Generate commit message and execute
    /commit --dry-run    # Preview commit message only
    /review-pr 123       # Review a pull request

    Managing Skills

    /skills              # List all skills (built-in, project, user)
    /skills help         # Show all skills management commands
    /skills reload       # Re-discover skills without restarting

    Built-in Skills

    Skill Description
    /commit Generate conventional commit messages
    /review-pr Review PRs with quality checklist

    Installing Skills

    Install skills from GitHub repositories:

    # Shorthand format (owner/repo/skill-name)
    /skills install aiiware/skills/code-review    # Install to project (.aii/skills/)
    /skills install aiiware/skills/refactor --user # Install globally (~/.aii/skills/)
    
    # Absolute GitHub URL format
    /skills install https://github.com/aiiware/skills/tree/main/code-review
    /skills install https://github.com/aiiware/skills/tree/main/refactor --user
    
    # Uninstall
    /skills uninstall code-review

    Shorthand format: owner/repo/skill-name resolves to github.com/owner/repo/skill-name/SKILL.md

    URL format: Use absolute GitHub URLs when you need to install from a specific branch or path.

    Creating Custom Skills

    Create skills in .aii/skills/my-skill/SKILL.md:

    ---
    name: my-skill
    description: Does something useful
    allowed-tools: Bash Read Grep
    ---
    
    # My Skill
    
    Instructions for the agent...
    Use $ARGUMENTS for user input.

    System Commands

    aii doctor         # System health check
    aii --help         # Show help
    aii --version      # Show version

    Features

    • Autonomous Agent: Executes multi-step tasks with tool use
    • Real-time Streaming: Token-by-token response display
    • Interactive Mode: Multi-turn conversations with full context
    • Tool Execution: Read, write, search, and run commands
    • Multiple Providers: Claude, GPT, Gemini, DeepSeek
    • Prompt Templates: Pre-built templates for common tasks
    • Project Instructions: Teach the agent your conventions with AGENTS.md
    • Skills System: Extend with reusable agent skills, invokable via slash commands or natural language
    • Input History: Navigate previous inputs with arrow keys
    • Cancellation: Press Esc to cancel any request

    License

    Proprietary - Copyright 2025-present AiiWare.com. All Rights Reserved.