Skip to content

Commit

Permalink
Merge pull request #37 from yusufcanb/release/1.2
Browse files Browse the repository at this point in the history
Release/1.2
  • Loading branch information
yusufcanb authored Feb 11, 2025
2 parents fb6d535 + feb44d3 commit 72f5834
Show file tree
Hide file tree
Showing 47 changed files with 1,323 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: pip install -r e2e/requirements.txt

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

- name: Archive e2e artifacts
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ go.work
.repomix/
dist/
.venv/
.vscode/
__pycache__/
125 changes: 115 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
[![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)
[![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)


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.

![Suggest](./assets/suggest.gif)

![Explain](./assets/explain2.gif)

![Model Selection](./assets/config.gif)
| Get a suggestion | Explain a command |
| -------------------------------- | -------------------------------- |
| ![Suggest](./assets/suggest.gif) | ![Explain](./assets/explain.gif) |

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

## Features

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

- 🚀 One liner generation and command explanation.

- 🖺 No-brainer RAG (Retrieval Augmented Generation)

- 🧠 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.

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

### Installation Script
### Installation Script

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

```bash
curl -fsSL https://raw.githubusercontent.com/yusufcanb/tlm/1.2-pre/install.sh | sudo -E bash
curl -fsSL https://raw.githubusercontent.com/yusufcanb/tlm/1.2/install.sh | sudo -E bash
```

#### Windows (Powershell 5.5 or higher)

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

```powershell
Invoke-RestMethod -Uri https://raw.githubusercontent.com/yusufcanb/tlm/1.2-pre/install.ps1 | Invoke-Expression
Invoke-RestMethod -Uri https://raw.githubusercontent.com/yusufcanb/tlm/1.2/install.ps1 | Invoke-Expression
```

### Go Install

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

```bash
go install github.com/yusufcanb/tlm@1.2-pre
go install github.com/yusufcanb/tlm@1.2
```

You're ready! Check installation by using the following command;
Expand All @@ -70,6 +72,109 @@ You're ready! Check installation by using the following command;
tlm
```

## Usage

```
$ tlm
NAME:
tlm - terminal copilot, powered by open-source models.
USAGE:
tlm suggest "<prompt>"
tlm s --model=qwen2.5-coder:1.5b --style=stable "<prompt>"
tlm explain "<command>" # explain a command
tlm e --model=llama3.2:1b --style=balanced "<command>" # explain a command with a overrided model
tlm ask "<prompt>" # ask a question
tlm ask --context . --include *.md "<prompt>" # ask a question with a context
VERSION:
1.2
COMMANDS:
ask, a Asks a question (beta)
suggest, s Suggests a command.
explain, e Explains a command.
config, c Configures language model, style and shell
version, v Prints tlm version.
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
```

### Ask - Ask something with or without context

Ask a question with context. Here is an example question with a context of this repositories Go files under ask package.

```
$ tlm ask --help
NAME:
tlm ask - Asks a question (beta)
USAGE:
tlm ask "<prompt>" # ask a question
tlm ask --context . --include *.md "<prompt>" # ask a question with a context
OPTIONS:
--context value, -c value context directory path
--include value, -i value [ --include value, -i value ] include patterns. e.g. --include=*.txt or --include=*.txt,*.md
--exclude value, -e value [ --exclude value, -e value ] exclude patterns. e.g. --exclude=**/*_test.go or --exclude=*.pyc,*.pyd
--interactive, --it enable interactive chat mode (default: false)
--model value, -m value override the model for command suggestion. (default: qwen2 5-coder:3b)
--help, -h show help
```

### Suggest - Get Command by Prompt

```
$ tlm suggest --help
NAME:
tlm suggest - Suggests a command.
USAGE:
tlm suggest <prompt>
tlm suggest --model=llama3.2:1b <prompt>
tlm suggest --model=llama3.2:1b --style=<stable|balanced|creative> <prompt>
DESCRIPTION:
suggests a command for given prompt.
COMMANDS:
help, h Shows a list of commands or help for one command
OPTIONS:
--model value, -m value override the model for command suggestion. (default: qwen2.5-coder:3b)
--style value, -s value override the style for command suggestion. (default: balanced)
--help, -h show help
```

### Explain - Explain a Command

```
$ tlm explain --help
NAME:
tlm explain - Explains a command.
USAGE:
tlm explain <command>
tlm explain --model=llama3.2:1b <command>
tlm explain --model=llama3.2:1b --style=<stable|balanced|creative> <command>
DESCRIPTION:
explains given shell command.
COMMANDS:
help, h Shows a list of commands or help for one command
OPTIONS:
--model value, -m value override the model for command suggestion. (default: qwen2.5-coder:3b)
--style value, -s value override the style for command suggestion. (default: balanced)
--help, -h show help
```

## Uninstall

On Linux and macOS;
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2-pre
1.2
Binary file added assets/ask.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/config.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/explain.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/explain2.gif
Binary file not shown.
Binary file modified assets/suggest.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/suggest2.gif
Binary file not shown.
19 changes: 19 additions & 0 deletions assets/tapes/ask.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Output ask.gif

Set Shell zsh
Set Theme "Cyberdyne"

Set Width 1200
Set Height 600
Set FontSize 22

Hide
Type "source ~/.zshrc && clear"
Enter
Hide

Show
Type "tlm ask --context . --include=pkg/ask/**/*.go 'briefly explain tlm ask command'"
Sleep 500ms
Enter
Sleep 15s
34 changes: 31 additions & 3 deletions assets/tapes/config.tape
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
Output config.gif

Set Shell zsh
Set Theme "Cyberdyne"

Set Width 1200
Set Height 850
Set FontSize 32
Set Height 600
Set FontSize 22

Hide
Type "source ~/.zshrc && clear"
Enter
Hide

Show
Type "tlm config"
Sleep 250ms
Enter
Sleep 2s

Down
Sleep 500ms

Down
Sleep 500ms

Down
Sleep 500ms
Sleep 750ms

Down
Sleep 750ms

Down
Sleep 750ms

Down
Sleep 300ms

Down
Sleep 300ms

Down
Sleep 300ms

Down
Sleep 300ms


Sleep 2s
14 changes: 10 additions & 4 deletions assets/tapes/explain.tape
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
Output explain.gif

Set Shell zsh
Set Theme "Cyberdyne"

Set Width 1200
Set Height 600
Set FontSize 32
Set Height 650
Set FontSize 22

Type 'tlm explain "git rev-list --all | xargs -L1 git grep -l TODO"'
Hide
Type "source ~/.zshrc && clear"
Enter

Show
Type 'tlm explain "sed -r s/(foo)(bar)/\2\1/; s/\b([a-z]+)\b/\U\1/g; /baz/d\ in > out"'
Sleep 500ms
Enter
Sleep 3s
Sleep 5s
8 changes: 7 additions & 1 deletion assets/tapes/suggest.tape
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
Output suggest.gif

Set Shell zsh
Set Theme "Cyberdyne"

Set Width 1200
Set Height 650
Set FontSize 32
Set FontSize 22

Hide
Type "source ~/.zshrc && clear"
Enter

Show
Type "tlm suggest 'list all network interfaces but only their ip addresses'"
Sleep 250ms
Enter
Expand Down
Loading

0 comments on commit 72f5834

Please sign in to comment.