Skip to content

Commit

Permalink
Update ht to 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
catallo committed Dec 19, 2023
1 parent 0621c46 commit bfafef0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,27 @@ https://github.com/catallo/ht/assets/45834058/cbe8913f-49fc-4e89-91e1-a25a5cabe6

##### About

I initially created ht as a simple experiment to test GPT-3.5-Turbo's usefulness with shell commands. However, I now find myself using it extensively in my daily tasks. So I'm sharing it with the hope that it can benefit others in the same way.
I initially created ht as a simple experiment to test GPT3's usefulness with shell commands. However, I now find myself using it extensively in my daily tasks. So I'm sharing it with the hope that it can benefit others in the same way. It's using OpenAI's GPT3.5-Turbo model now and I plan to add more models in the future, including local models.

ht is written in Dart. This means it's one single binary that you can easily add to your system's PATH. (If you don't know how to do this, ask ht.) The binary is fully self-contained and does not have any dependencies.
ht is written in Dart. As a result, it is compiled into a single, self-contained binary. This means that the ht binary operates independently without requiring any external dependencies or runtime environments.

To use ht, you'll need an OpenAI API key. The good news is that due to ht's low token usage, a typical request costs about $0.00025, making it an incredibly budget-friendly tool for daily usage. You can [# for an API key here](https://platform.openai.com/#) or refer to [this article](https://www.howtogeek.com/885918/how-to-get-an-openai-api-key) for detailed instructions.

##### Installation

1. Download the archive for your platform from the Downloads section below.
2. Unzip the archive.
3. Using a terminal, navigate to the directory containing the ht binary and run it with the -i flag to start the installation process.

```
cd Downloads
./ht_2-0-3_linux64 -i
```

ht will be installed to '~/.config/ht' and the directory will be added to your PATH. Future updates will be installed automatically.

##### Downloads

- [ht-v2.0.3 for Linux x64](https://github.com/catallo/ht/files/13476314/ht_2-0-3_linux64.zip)
- [Releases](https://github.com/catallo/ht/releases)


- [ht-v2.0.3 for MacOS ARM64](https://github.com/catallo/ht/files/13476316/ht_2-0-3_MacOS_ARM64.zip)
1 change: 1 addition & 0 deletions lib/arguments.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Future<bool> parseArguments(List arguments) async {
"$acBold ht <instruction>$acReset - answers with a shell command");
print("$acBold ht e|explain$acReset - explains last answer");
print("$acBold ht e|explain [command]$acReset - explains command\n");
print("$acBold ht x|execute [command]$acReset - execute last command\n");
print("$acBold ht -h|--help$acReset - help");
print("$acBold ht -s|--settings$acReset - settings overview");
print("$acBold ht -v|--version$acReset - show version");
Expand Down
4 changes: 4 additions & 0 deletions lib/get_latest_version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ downloadUpdate() async {
dbg("extractedFileName: $extractedFileName");
// run the extracted file with -i to install

Process.runSync(extractedFileName, ['-i']);
dbg("Process.runSync finished");

File("${htPath}update_available").deleteSync();

// wrapper script will handle the rest

exit(0);
} else {
print('No matching asset found for platform $platformKey');
Expand Down
4 changes: 2 additions & 2 deletions lib/globals.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:io';
import 'package:ht/config.dart';

bool debug = true;
bool debug = false;

const version = "2.0.5";
const version = "2.3.1";
const compileDate = "2023-12-19";

String os = "Linux";
Expand Down

0 comments on commit bfafef0

Please # to comment.