# HN 공개: Bash로 작성된 LLM용 명령줄 인터페이스 Ell

> Clean Markdown view of GeekNews topic #16159. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=16159](https://news.hada.io/topic?id=16159)
- GeekNews Markdown: [https://news.hada.io/topic/16159.md](https://news.hada.io/topic/16159.md)
- Type: GN+
- Author: [neo](https://news.hada.io/@neo)
- Published: 2024-08-04T10:10:15+09:00
- Updated: 2024-08-04T10:10:15+09:00
- Original source: [github.com/simonmysun](https://github.com/simonmysun/ell)
- Points: 1
- Comments: 0

## Topic Body

### ellA 명령줄 인터페이스

#### 기능
- 터미널에서 LLMs에 질문
- 파이프 친화적
- 터미널 컨텍스트를 LLMs에 전달하고 질문
- 터미널에서 LLMs와 채팅
- 함수 호출 및 템플릿을 통한 추가 기능 지원

#### 요구 사항
- bash
- jq (JSON 파싱용)
- curl (HTTPS 요청 전송용)
- perl (PCRE용. POSIX bash는 look-ahead와 look-behind 정규 표현식을 지원하지 않음. 기록 모드를 사용하지 않으면 필요 없음)

#### 설치
```bash
git clone --depth 1 https://github.com/simonmysun/ell.git ~/.ellrc.d
echo 'export PATH="${HOME}/.ellrc.d:${PATH}"' >> ~/.bashrc
```
또는
```bash
git clone --depth 1 git@github.com:simonmysun/ell.git ~/.ellrc.d
echo 'export PATH="${HOME}/.ellrc.d:${PATH}"' >> ~/.bashrc
```
이 명령어는 `.ellrc.d` 디렉토리에 저장소를 클론하고 PATH에 추가함

#### 설정
다음은 Google의 `gemini-1.5-flash`를 사용하는 예시 설정임:
```bash
ELL_API_STYLE=gemini
ELL_LLM_MODEL=gemini-1.5-flash
ELL_TEMPLATE=default-gemini
ELL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ELL_API_URL=https://generativelanguage.googleapis.com/v1beta/models/
```
OpenAI의 `gpt-4o-mini`를 사용하는 예시 설정:
```bash
ELL_API_STYLE=openai
ELL_LLM_MODEL=gpt-4o-mini
ELL_TEMPLATE=default-openai
ELL_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ELL_API_URL=https://api.openai.com/v1/chat/completions
```

#### 사용 예시
- 질문하기:
```bash
ell "What is the capital of France?"
```
- 모델 지정 및 파일 입력 사용:
```bash
ell -m gpt-4o -f user_prompt.txt
```
- stdin에서 읽기:
```bash
cat somecode.py | ell -f -
```
- 추가 프롬프트 즉시 추가:
```bash
(cat somecode.py; echo "Explain this code") | ell -f -
```
- 터미널 입력 및 출력을 기록하고 컨텍스트로 사용:
```bash
ell -r
# do random stuff
ell What does the error code mean?
ell How to fix it?
```
- 대화형 모드로 실행:
```bash
ell -i
```
- 기록 모드와 대화형 모드 결합:
```bash
ell -r -i
```
- 템플릿 지정 및 기록 모드와 대화형 모드 시작:
```bash
ell -r -i -t ctf-gemini
또는
ell -r -i -t ctf-openai
```

#### 템플릿 작성
템플릿 사용에 대한 자세한 내용은 Templates를 참조

#### 스타일링
스타일링에 대한 자세한 내용은 Styling을 참조

#### 플러그인
플러그인은 ell에서 호출할 수 있는 스크립트를 의미함. LLM 제공자의 플러그인은 포함되지 않음. 자세한 내용은 Templates를 참조

#### 고려해야 할 위험
Risks Consideration을 참조

#### FAQ
- **Q**: 왜 "ell"이라고 부르나요?
  - **A**: "ell"은 shell과 LLM의 조합임. shell 스크립트로 LLM 백엔드를 사용함. "shellm"도 고려되었으나 오해의 소지가 있어 "ell"로 변경됨. 짧고 기억하기 쉬움
- **Q**: 왜 Bash로 작성되었나요?
  - **A**: Bash는 Unix-like 시스템에서 가장 일반적인 쉘이며, 더 복잡한 언어를 사용할 필요가 없음
- **Q**: ell과 다른 유사 프로젝트의 차이점은 무엇인가요?
  - **A**: ell은 거의 순수 Bash로 작성되어 매우 가볍고 설치가 쉬움. 확장 및 수정이 매우 쉬움. 파이프 친화적임

#### 유사 프로젝트
- [chatgpt-cli](https://github.com/kardolus/chatgpt-cli): Go로 작성된 ChatGPT CLI
- [gpt-cli](https://github.com/kharvd/gpt-cli): Python으로 작성된 다양한 LLM 백엔드용 CLI
- [gptcli](https://github.com/JohannLai/gptcli): TypeScript로 작성된 OpenAI LLM용 CLI
- [x-cmd](https://github.com/x-cmd/x-cmd): POSIX bash와 awk로 작성된 다양한 도구 모음
- [gpt-bash-cli](https://github.com/llimllib/gpt-bash-cli): OpenAI API용 CLI, 요청 및 응답을 데이터베이스에 저장
- [mods](https://github.com/charmbracelet/mods): Go로 작성된 LLM과 대화하는 CLI 도구
- [nicechat](https://github.com/hiquest/nicechat): Node.js로 작성된 OpenAI 모델용 CLI 채팅 인터페이스
- [autocomplete-sh](https://github.com/closedloop-technologies/autocomplete-sh): bash로 작성된 LLM용 CLI
- [plandex](https://github.com/plandex-ai/plandex): Go로 작성된 AI 통합 워크플로우 개발용 CLI 도구
- [llm](https://github.com/simonw/llm): Python으로 작성된 LLM 심층 조작용 CLI 도구
- [aichat](https://github.com/sigoden/aichat): Rust로 작성된 다양한 LLM 제공자와 대화하는 CLI 도구

#### 기여
기여는 언제나 환영함! 아이디어, 제안 또는 버그 보고가 있으면 이슈를 열거나 풀 리퀘스트를 제출

#### 라이선스
이 프로젝트는 MIT 라이선스 하에 라이선스됨. 자세한 내용은 LICENSE 파일을 참조

### GN⁺의 정리
- ell은 Bash로 작성된 LLM 명령줄 인터페이스로, 가볍고 설치가 쉬움
- 다양한 LLM 모델과의 통합을 지원하며, 파이프 친화적임
- 기록 모드와 대화형 모드를 결합하여 터미널 컨텍스트를 활용할 수 있음
- 유사 프로젝트로는 chatgpt-cli, gpt-cli, gptcli 등이 있으며, 각기 다른 언어로 작성됨

## Comments



_No public comments on this page._
