Skip to content

Commit

Permalink
refactor: rename LLM CLI to AI CLI for broader applicability
Browse files Browse the repository at this point in the history
- Updates the project name and description to reflect a more inclusive scope
- Modifies scripts and configuration files to align with the new naming convention
- Adds a new prompt file for long repository descriptions
- Enhances the description prompt to be more engaging and concise
- Improves topic generation instructions for better repository discoverability
  • Loading branch information
liblaf committed Nov 30, 2024
1 parent 59e20ee commit 53b7d9d
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 19 deletions.
5 changes: 3 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
"acompletion",
"aiignore",
"asyncio",
"chatglm",
"customise",
"cython",
"dalle",
"dmypy",
"dotenv",
"dpath",
"dpaths",
"httpx",
"ipynb",
"ipython",
"keras",
"kwargs",
"levelno",
"liblaf",
Expand All @@ -38,6 +37,7 @@
"pypackages",
"pypi",
"pyplot",
"pyproject",
"pyrightconfig",
"pytest",
"pytype",
Expand All @@ -47,6 +47,7 @@
"repomix",
"scrapy",
"sdist",
"tqdm",
"trimesh",
"typer",
"venv"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<img height="160" src="https://raw.githubusercontent.com/microsoft/fluentui-emoji/refs/heads/main/assets/Rocket/3D/rocket_3d.png">

<h1>LLM CLI</h1>
<h1>AI CLI</h1>

LLM CLI is a powerful, open-source command-line interface for AI-driven repository management. Simplifies commit message generation, repository description, and topic suggestion, enhancing productivity and collaboration for developers.
AI CLI is a powerful and versatile command-line interface that leverages AI to generate commit messages, repository descriptions, and topics, enhancing productivity and collaboration for developers. It supports multiple AI models, integrates seamlessly with Git, and offers a user-friendly experience to streamline your workflow.

[![][pypi-release-shield]][pypi-release-link]
[![][github-releasedate-shield]][github-releasedate-link]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"typer-di>=0.1.2",
"typer>=0.13.1",
]
description = "🚀 LLM CLI - a powerful, open-source command-line interface for AI-driven repository management. Simplifies commit message generation, repository description, and topic suggestion, enhancing productivity and collaboration for developers."
description = "🚀 AI CLI - A powerful and versatile command-line interface for AI-driven code commit messages, repository descriptions, and topic generation, designed to enhance productivity and collaboration."
name = "liblaf-ai-cli"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen-help.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail

typer ai_cli utils docs --output docs/help.md
typer ai utils docs --output docs/help.md
prettier --write docs/help.md
markdownlint --fix docs/help.md
2 changes: 1 addition & 1 deletion scripts/gen-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -o errexit -o nounset -o pipefail

git_root=$(git rev-parse --show-toplevel)
src_dir=$git_root/src/ai_cli
src_dir=$git_root/src/ai

readarray -t dpaths < <(find "$src_dir" -type d)
for dpath in "${dpaths[@]}"; do
Expand Down
29 changes: 29 additions & 0 deletions src/ai/assets/prompts/description-long.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Compose a brief and engaging description of the repository in one or two sentences. The description should include the repository's main purpose, highlight its key features, and identify its appeal to potential contributors. Aim for clarity and conciseness to effectively communicate the value of the repository.

# Steps

1. Identify the main purpose of the repository.
2. Highlight the key features and functionalities.
3. Explain the appeal to potential contributors.
4. Combine the information into one or two clear and concise sentences.

# Output Format

- The output should be a one or two sentences description.
- Ensure the sentences are engaging and clearly communicate the repository's value.

# Examples

<Example>
<Input>
(codebase of Lobe Chat ...)
</Input>
<Answer>
Lobe Chat is an open-source, modern-design AI chat framework. Supports Multi AI Providers (OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG), Multi-Modals (Vision / TTS) and plugin system. One-click FREE deployment of your private ChatGPT / Claude application.
</Answer>
</Example>

# Notes

- Focus on engaging and concise language.
- Ensure the description captures the essence of the repository and its unique features.
27 changes: 25 additions & 2 deletions src/ai/assets/prompts/description.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
Using the details provided in the repository codebase, compose a brief and engaging description of the repository in one to two sentences. The description should include the repository's main purpose, highlight its key features, and identify its appeal to potential contributors. Aim for clarity and conciseness to effectively communicate the value of the repository.
Compose a brief and engaging description of the repository in one sentence. The description should include the repository's main purpose, highlight its key features, and identify its appeal to potential contributors. Aim for clarity and conciseness to effectively communicate the value of the repository.

# Steps

1. Identify the main purpose of the repository.
2. Highlight the key features and functionalities.
3. Explain the appeal to potential contributors.
4. Combine the information into one clear and concise sentence.

# Output Format

- The output should be a one sentence description.
- Ensure the sentence are engaging and clearly communicate the repository's value.

# Examples

<Example>
<Input>
(codebase of tqdm ...)
</Input>
<Answer>
🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers (OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG), Multi-Modals (Vision / TTS) and plugin system. One-click FREE deployment of your private ChatGPT / Claude application.
⚡ tqdm - a fast, extensible progress bar for python and CLI
</Answer>
</Example>

# Notes

- Focus on engaging and concise language.
- Ensure the description captures the essence of the repository and its unique features.
- Use emojis to make the description more engaging and visually appealing.
30 changes: 28 additions & 2 deletions src/ai/assets/prompts/topics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
Analyze the provided codebase and propose a list of up to 20 relevant topics that will enhance the repository's discoverability and attractiveness to potential contributors. Consider the intended purpose, subject area, programming language, and any unique features of the project. Ensure all topics are in lowercase, use hyphens if necessary, and contain no more than 50 characters each.
Generate relevant topics for a GitHub repository.

# Steps

1. **Analyze the Codebase**: Review the merged representation of the entire codebase, focusing on the metadata, repository structure, and individual file contents.
2. **Identify Key Elements**: Determine the primary purpose, subject area, and programming language used in the project.
3. **Highlight Unique Features**: Note any unique or standout features of the project that could attract contributors.
4. **Generate Topics**: Create a list of up to 20 topics that reflect the analysis. Ensure each topic is concise, lowercase, and uses hyphens if necessary.

# Output Format

Output the list of topics as a single line of text, with each topic separated by a space. Each topic should be in lowercase and use hyphens if necessary.

<Answer>
topic1 topic2 topic3 ...
</Answer>

# Examples

<Example>
<Input>
(codebase of tqdm ...)
</Input>
<Answer>
chat ai nextjs tts gemini openai gpt knowledge-base claude rag gpt-4 chatgpt chatglm azure-openai-api function-calling ollama dalle-3 gpt-4-vision qwen2
python cli console gui time terminal telegram utilities jupyter progress discord progress-bar parallel keras meter progressbar pandas progressmeter rate closember
</Answer>
</Example>

# Notes

- Ensure that the topics are relevant to the repository's content and purpose.
- Each topic should be concise and descriptive, with no more than 50 characters.
- Use hyphens to separate words within a topic if necessary.
2 changes: 1 addition & 1 deletion src/ai/cmd/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import ai.cmd as aim
import ai.utils as aiu

app = typer_di.TyperDI(name="ai-cli", no_args_is_help=True)
app = typer_di.TyperDI(name="ai", no_args_is_help=True)
aiu.add_command(app, aim.repo.app)
aiu.add_command(app, aim.commit.app)
4 changes: 1 addition & 3 deletions src/ai/cmd/repo/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ def _get_instruction(instruction: str) -> str:
instruction_fpath: Path = Path(instruction)
if instruction_fpath.is_file():
return Path(instruction).read_text()
return importlib.resources.read_text(
"ai_cli.assets.instructions", f"{instruction}.md"
)
return importlib.resources.read_text("ai.assets.instructions", f"{instruction}.md")
10 changes: 8 additions & 2 deletions src/ai/cmd/repo/description/_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import asyncio
from typing import Annotated

import typer
import typer_di

import ai.utils as aiu
Expand All @@ -8,7 +10,11 @@


@app.command()
def main(_: None = typer_di.Depends(aiu.get_config)) -> None:
def main(
*,
long: Annotated[bool, typer.Option()] = False,
_: None = typer_di.Depends(aiu.get_config),
) -> None:
from ._main import main

asyncio.run(main())
asyncio.run(main(long=long))
4 changes: 2 additions & 2 deletions src/ai/cmd/repo/description/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ai.utils as aiu


async def main() -> None:
instruction: str = aiu.get_prompt("description")
async def main(*, long: bool = False) -> None:
instruction: str = aiu.get_prompt("description-long" if long else "description")
prompt: str = await aiu.repomix(instruction)
await ai.output(prompt, prefix="<Answer>")

0 comments on commit 53b7d9d

Please sign in to comment.