Getting Started
cli4ai is a package manager for AI CLI tools. Install any AI tool with one command and get your AI agent connected to the tools you use in under a minute.
Installation
Install cli4ai globally using npm:
npm install -g cli4ai Or using bun:
bun install -g cli4ai Quick Start
1. Install a package
Install any tool from the registry:
# Install globally (available everywhere)
cli4ai add -g slack
# Or install locally (project-specific)
cli4ai add slack 2. Run a command
Execute commands from installed tools:
# List slack channels
cli4ai run slack channels
# Search your inbox
cli4ai run gmail search "from:boss"
# Get GitHub notifications
cli4ai run github notifs 3. Connect to AI agents
Add instructions to your project's CLAUDE.md or AGENTS.md file so your AI agent knows about available tools:
# AI Tools Available
This project has cli4ai tools installed. Use them via the terminal:
## Slack
- `cli4ai run slack channels` - List channels
- `cli4ai run slack post "#channel" "message"` - Send a message
- `cli4ai run slack react "#channel" "timestamp" "emoji"` - Add reaction
## Gmail
- `cli4ai run gmail inbox` - Check inbox
- `cli4ai run gmail search "query"` - Search emails
- `cli4ai run gmail send "to@email.com" "subject" "body"` - Send email
## GitHub
- `cli4ai run github notifs` - Check notifications
- `cli4ai run github repos` - List repositories
Run `cli4ai list` to see all installed tools and `cli4ai run <tool> --help` for command details. Your AI agent will read this file and know exactly how to use your tools via the terminal.
Alternative: MCP Configuration
For deeper integration, generate MCP configuration:
cli4ai mcp-config This creates config for Claude Desktop, Cursor, and other MCP-compatible tools.
Core Commands
| Command | Description |
|---|---|
cli4ai add <pkg> | Install a package locally |
cli4ai add -g <pkg> | Install a package globally |
cli4ai remove <pkg> | Uninstall a package |
cli4ai list | List installed packages |
cli4ai run <pkg> <cmd> | Execute a tool command |
cli4ai routines run <name> | Run a multi-step workflow (routine) |
cli4ai search <query> | Search for packages |
cli4ai info <pkg> | Show package details |
cli4ai mcp-config | Generate MCP configuration |
cli4ai secrets set <key> | Store an encrypted secret |
Configuration
cli4ai stores configuration in ~/.cli4ai/:
~/.cli4ai/
├── config.json # Global settings
├── packages/ # Globally installed packages
├── routines/ # Global routines
├── bin/ # Executable wrappers
└── secrets.json # Encrypted credentials Projects can also store routines locally in ./.cli4ai/routines/ (recommended for project-specific workflows).
Managing secrets
Many tools require API keys or tokens. cli4ai provides secure secret storage:
# Store a secret
cli4ai secrets set SLACK_BOT_TOKEN
# List stored secrets
cli4ai secrets list
# Secrets are automatically injected when running tools Next Steps
- How It Works - Understand the architecture
- Remote Servers - Run tools on remote machines
- Routines - Chain commands into workflows
- MCP vs CLI - Learn about the CLI-first approach
- Creating Packages - Build your own tools
- Browse Packages - Find tools to install