docs: 版本号
修改版本号为0.1.1
This commit is contained in:
parent
9870926054
commit
a63c1d0e25
99
CLAUDE.md
Normal file
99
CLAUDE.md
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
AutoTerminal is a smart terminal tool based on large language models (LLM) that converts natural language into terminal commands to improve work efficiency.
|
||||||
|
|
||||||
|
## Code Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
autoterminal/
|
||||||
|
├── __init__.py # Package initialization
|
||||||
|
├── main.py # Main program entry point
|
||||||
|
├── config/ # Configuration management module
|
||||||
|
│ ├── __init__.py # Package initialization
|
||||||
|
│ ├── loader.py # Configuration loader
|
||||||
|
│ └── manager.py # Configuration manager
|
||||||
|
├── llm/ # LLM related modules
|
||||||
|
│ ├── __init__.py # Package initialization
|
||||||
|
│ └── client.py # LLM client
|
||||||
|
├── history/ # Command history management module
|
||||||
|
│ ├── __init__.py # Package initialization
|
||||||
|
│ └── history.py # History manager
|
||||||
|
├── utils/ # Utility functions
|
||||||
|
│ ├── __init__.py # Package initialization
|
||||||
|
│ └── helpers.py # Helper functions
|
||||||
|
```
|
||||||
|
|
||||||
|
### Key Components
|
||||||
|
|
||||||
|
1. **Main Entry Point** (`autoterminal/main.py`):
|
||||||
|
- Parses command-line arguments
|
||||||
|
- Loads configuration
|
||||||
|
- Initializes LLM client
|
||||||
|
- Generates and executes commands
|
||||||
|
- Manages command history
|
||||||
|
|
||||||
|
2. **Configuration Management** (`autoterminal/config/`):
|
||||||
|
- `loader.py`: Loads configuration from file
|
||||||
|
- `manager.py`: Manages configuration saving, validation, and initialization
|
||||||
|
|
||||||
|
3. **LLM Integration** (`autoterminal/llm/client.py`):
|
||||||
|
- Wraps OpenAI API client
|
||||||
|
- Generates terminal commands from natural language input
|
||||||
|
- Incorporates context from command history and current directory
|
||||||
|
|
||||||
|
4. **Command History** (`autoterminal/history/history.py`):
|
||||||
|
- Manages command history storage and retrieval
|
||||||
|
- Provides context for LLM generation
|
||||||
|
|
||||||
|
5. **Utilities** (`autoterminal/utils/helpers.py`):
|
||||||
|
- Provides helper functions like command cleaning
|
||||||
|
|
||||||
|
## Common Development Commands
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
Using uv (development mode):
|
||||||
|
```bash
|
||||||
|
uv sync
|
||||||
|
```
|
||||||
|
|
||||||
|
Using pip (user installation):
|
||||||
|
```bash
|
||||||
|
pip install --user .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running the Application
|
||||||
|
|
||||||
|
Using uv run:
|
||||||
|
```bash
|
||||||
|
uv run python autoterminal/main.py "list all files in current directory"
|
||||||
|
```
|
||||||
|
|
||||||
|
After installation, use the `at` command:
|
||||||
|
```bash
|
||||||
|
at "list all files in current directory"
|
||||||
|
```
|
||||||
|
|
||||||
|
Using history context:
|
||||||
|
```bash
|
||||||
|
at --history-count 5 "based on previous commands, delete all .txt files"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
The project uses setuptools for packaging and distribution. Entry point is defined in both `pyproject.toml` and `setup.py`.
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
- LLM-based intelligent command generation
|
||||||
|
- Secure command execution mechanism (requires user confirmation)
|
||||||
|
- Flexible configuration management
|
||||||
|
- Chinese language support
|
||||||
|
- Support for multiple LLM models (OpenAI GPT series and compatible APIs)
|
||||||
|
- Command history tracking and context awareness
|
||||||
|
- Current directory content context awareness
|
||||||
|
- Configurable history size
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "autoterminal"
|
name = "autoterminal"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
description = "智能终端工具,基于LLM将自然语言转换为终端命令(create by claude 4 sonnet)"
|
description = "智能终端工具,基于LLM将自然语言转换为终端命令(create by claude 4 sonnet)"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="autoterminal",
|
name="autoterminal",
|
||||||
version="0.1.0",
|
version="0.1.1",
|
||||||
description="智能终端工具,基于LLM将自然语言转换为终端命令(create by claude 4 sonnet)",
|
description="智能终端工具,基于LLM将自然语言转换为终端命令(create by claude 4 sonnet)",
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user