Skip to content

Commit

Permalink
feat: remove WIP flags
Browse files Browse the repository at this point in the history
  • Loading branch information
efugier committed Nov 13, 2023
1 parent efbb929 commit 306a7e0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "smartcat"
version = "0.1.12"
version = "0.1.13"
authors = ["Emilien Fugier <[email protected]>"]
description = '''
Putting a brain behind `cat`.
WIP cli interface to bring language models in the Unix ecosystem 🐈‍⬛
CLI interface to bring language models in the Unix ecosystem 🐈‍⬛
'''
license = "MIT OR Apache-2.0"
edition = "2021"
homepage = "https://github.com/efugier/smartcat"
repository = "https://github.com/efugier/smartcat"
keywords = ["cli", "pipe", "llm", "ai", "chatgpt"]
keywords = ["cli", "pipe", "cat", "ai", "chatgpt"]
categories = ["command-line-utilities", "text-processing"]
readme="README.md"

Expand Down Expand Up @@ -40,5 +40,5 @@ assets = [
]
extended-description = """\
Putting a brain behind `cat`.
WIP cli interface to bring language models in the Unix ecosystem 🐈‍⬛
CLI interface to bring language models in the Unix ecosystem 🐈‍⬛
"""
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# smartcat (sc) 🐈‍⬛

Puts a brain behind `cat`! WIP cli interface to bring language models in the Unix ecosystem 🐈‍⬛
Puts a brain behind `cat`! CLI interface to bring language models in the Unix ecosystem and allow power users to make the most out of llms. 🐈‍⬛

- [Installation](#installation)
- [A few examples to get started](#a-few-examples-to-get-started)
Expand Down Expand Up @@ -57,6 +57,8 @@ cargo install smartcat
Or download directly the binary compiled for your platform from the [release page](https://github.com/efugier/smartcat/releases).


---

On the first run, `smartcat` will ask you to generate some default configuration files if it cannot find them.
More about that in the [configuration section](#Configuration).

Expand All @@ -67,7 +69,7 @@ A `default` prompt is needed for `smartcat` to know which api and model to hit.
Ask anything without leaving you dear terminal

```
sc -i "what's a sed command to remove trailaing whitespaces at the end of all non-markdown files?"
sc -i "sed command to remove trailaing whitespaces at the end of all non-markdown files?"
> sed -i '' 's/[ \t]*$//' *.* !(*.md)
```

Expand Down Expand Up @@ -103,10 +105,11 @@ sc -f Cargo.toml -c "translate the following file in json" | save Cargo.json
```

```
cat my_stuff.py | sc \
-c "write a parametrized test suite for the following code using pytest" \
-s "output only the code, as a standalone file with the imports. \n```\n" \
-a "```" > test.py
cat my_stuff.py | \
sc -c "write a parametrized test suite for the following code using pytest" \
-s "output only the code, as a standalone file with the imports. \n" \
-a "" \
> test.py
```

If you find yourself reusing prompts often, you can create a dedicated config entries and it becomes the following:
Expand Down Expand Up @@ -161,7 +164,7 @@ will **append** at the end of the current selection the result of the language m

With some remapping you may have your most reccurrent action attached to few keystrokes e.g. `<leader>wt`!

#### Helix
#### Helix and Kakoune

Same concept, different shortcut, simply press the pipe key to redirect the selection to `smarcat`.

Expand Down Expand Up @@ -213,11 +216,11 @@ api = "openai"
model = "gpt-4-1106-preview"
messages = []

[write_test]
[write_tests]
api = "openai"
model = "gpt-4-1106-preview"

[[write_test.messages]]
[[write_tests.messages]]
role = "system"
content = """\
You are an extremely skilled programmer with a keen eye for detail and an emphasis on readable code. \
Expand All @@ -230,7 +233,7 @@ Never ever write ``` around the code. \
Now let's make something great together!
"""

[[write_test.messages]]
[[write_tests.messages]]
role = "user"
# the following placeholder string #[<input>] will be replaced by the input
# each message seeks it and replaces it
Expand All @@ -254,7 +257,10 @@ cargo test -- --test-threads=1

Smartcat has reached an acceptable feature set. The focus is now on upgrading the codebase quality as I hadn't really touched rust since 2019 and it shows.

#### TODO/Ideas:
#### TODO

- make it available on homebrew

#### Ideas:

- interactive mode to have conversations and make the model iterate on the last answer
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod config;
name = "smartcat (sc)",
author = "Emilien Fugier",
version = "0.1",
about = "Putting a brain behind `cat`. WIP cli interface to bring language models in the Unix ecosystem 🐈‍⬛",
about = "Putting a brain behind `cat`. CLI interface to bring language models in the Unix ecosystem 🐈‍⬛",
long_about = None
)]
struct Cli {
Expand Down

0 comments on commit 306a7e0

Please sign in to comment.