@diepdao/aicli
v1.0.2
Published
CLI tool for AI coding assistants to fetch latest API documentation for open source tools
Downloads
244
Maintainers
Readme
@diepdao/aicli
AI Documentation CLI — fetch latest API documentation for open source tools.
Designed for AI coding assistants (Claude Code, GitHub Copilot) to get up-to-date API references for libraries like Apache Kafka, Redis, ClickHouse, Java SE, Google Guava, and more — instead of relying on potentially stale training data.
Inspired by @aisuite/chub.
Install
npm install -g @diepdao/aicliQuick Start
# List all supported tools
aicli search
# Search for documentation
aicli search kafka
aicli search kafka producer
aicli search java ConcurrentMap
aicli search guava Service
aicli search redis streams
aicli search clickhouse sql
# Fetch actual documentation content
aicli search java ConcurrentMap --fetch
aicli search guava Service --fetch
# JSON output (useful for AI tool calls)
aicli search kafka producer --json
# Show guide
aicli guideSupported Libraries
| ID | Library | Description |
|----|---------|-------------|
| kafka | Apache Kafka | Distributed event streaming — Producer, Consumer, Streams, Admin |
| redis | Redis | In-memory store — Commands, Data Types, Pub/Sub, Streams |
| clickhouse | ClickHouse | OLAP database — SQL, Table Engines, Functions, Aggregations |
| java | Java SE 21 | Java stdlib — ConcurrentMap, CompletableFuture, Stream, Optional |
| guava | Google Guava | Core Java libs — Service, Cache, ImmutableList, EventBus |
| cassandra | Apache Cassandra | NoSQL database — CQL, Data Types, Java Driver |
| elasticsearch | Elasticsearch | Search engine — REST API, Query DSL, Aggregations |
| rabbitmq | RabbitMQ | Message broker — AMQP, Publishers, Consumers, Java Client |
Commands
aicli search [query...] [options]
Search for API documentation entries.
With no query, lists all supported tools.
Options:
--fetch Fetch and display full docs for top result
--json Output as JSON
--limit <n> Number of results (default: 5)
aicli guide
Show detailed help and all examples.Example Output
$ aicli search kafka producer
# aicli: Results for "kafka producer"
1. Apache Kafka — Producer API
KafkaProducer API for sending records to Kafka topics
URL: https://kafka.apache.org/documentation/#producerapi
Tags: java, messaging, streaming, events
Tip: add --fetch to retrieve full documentation for the top result.
e.g. aicli search kafka producer --fetchFor AI Assistants
Copy the skill definition to your Claude skills directory:
mkdir -p ~/.claude/skills/get-api-docs
cp $(npm root -g)/@diepdao/aicli/skills/get-api-docs/SKILL.md ~/.claude/skills/get-api-docs/SKILL.mdOr reference skills/get-api-docs/SKILL.md in your Copilot/Claude instructions.
The skill file teaches the AI assistant to use aicli to fetch current docs before answering API questions.
Development
# Clone and install
git clone https://github.com/diepdaocs/aicli
cd aicli
npm install
# Build
npm run build
# Test locally
npm link
aicli search kafka
# Unlink when done
npm unlink -g @diepdao/aicliAdding New Libraries
Edit src/lib/registry.ts and add a new entry to the REGISTRY array:
{
id: 'mylib',
name: 'My Library',
description: 'What the library does',
baseUrl: 'https://mylib.example.com',
tags: ['java', 'relevant-tags'],
entries: [
{
title: 'Core Class',
url: 'https://mylib.example.com/docs/CoreClass.html',
keywords: ['CoreClass', 'method1', 'method2'],
description: 'Brief description of this page',
},
],
}Then rebuild: npm run build.
Publishing
npm login # log in to npm as diepdao
npm publish --access publicLicense
MIT © Diep Dao
