aia 0.3.3 → 0.3.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +6 -0
- data/CHANGELOG.md +12 -0
- data/README.md +165 -55
- data/Rakefile +2 -0
- data/justfile +167 -0
- data/lib/aia/cli.rb +228 -115
- data/lib/aia/config.rb +7 -0
- data/lib/aia/logging.rb +49 -12
- data/lib/aia/main.rb +29 -15
- data/lib/aia/prompt_processing.rb +208 -4
- data/lib/aia/tools/editor.rb +50 -0
- data/lib/aia/{external → tools}/mods.rb +69 -10
- data/lib/aia/{external → tools}/sgpt.rb +2 -2
- data/lib/aia/{external → tools}/subl.rb +23 -5
- data/lib/aia/tools/vim.rb +91 -0
- data/lib/aia/{external/tool.rb → tools.rb} +28 -24
- data/lib/aia/version.rb +5 -1
- data/lib/aia.rb +17 -3
- data/main.just +56 -0
- data/man/aia.1 +134 -0
- data/man/aia.1.md +107 -0
- metadata +72 -18
- data/lib/aia/configuration.rb +0 -39
- data/lib/aia/external/,keep +0 -0
- data/lib/aia/external/.irbrc +0 -11
- data/lib/aia/external/ag.rb +0 -103
- data/lib/aia/external/bat.rb +0 -189
- data/lib/aia/external/fzf.rb +0 -147
- data/lib/aia/external/glow.rb +0 -37
- data/lib/aia/external/rg.rb +0 -1163
- data/lib/aia/external.rb +0 -259
- data/lib/aia/external_two.rb +0 -43
data/man/aia.1
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
.\" Generated by kramdown-man 1.0.1
|
2
|
+
.\" https://github.com/postmodern/kramdown-man#readme
|
3
|
+
.TH aia 1 "2024-01-01" AIA "User Manuals"
|
4
|
+
.SH NAME
|
5
|
+
.PP
|
6
|
+
aia \- command\-line interface for an AI assistant
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
aia \[lB]options\[rB]* PROMPT\[ru]ID \[lB]CONTEXT\[ru]FILE\[rB]* \[lB]\-\- EXTERNAL\[ru]OPTIONS\[pl]\[rB]
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
The aia command\-line tool is an interface for interacting with an AI model backend, providing a simple way to send prompts and receive responses\. The CLI supports various options to customize the interaction, load a configuration file, edit prompts, set debugging levels, and more\.
|
13
|
+
.SH ARGUMENTS
|
14
|
+
.TP
|
15
|
+
\fIPROMPT\[ru]ID\fP
|
16
|
+
This is a required argument\.
|
17
|
+
.TP
|
18
|
+
\fICONTEXT\[ru]FILES\fP
|
19
|
+
This is an optional argument\. One or more files can be added to the prompt as context for the backend gen\-AI tool to process\.
|
20
|
+
.TP
|
21
|
+
\fIEXTERNAL\[ru]OPTIONS\fP
|
22
|
+
External options are optional\. Anything that follow \[lq] \-\- \[lq] will be sent to the backend gen\-AI tool\. For example \[lq]\-\- \-C \-m gpt4\-128k\[rq] will send the options \[lq]\-C \-m gpt4\-128k\[rq] to the backend gen\-AI tool\. \fBaia\fR will not validate these external options before sending them to the backend gen\-AI tool\.
|
23
|
+
.SH OPTIONS
|
24
|
+
.TP
|
25
|
+
\fB\-c\fR, \fB\-\-config\fR \fIPATH\[ru]TO\[ru]CONFIG\[ru]FILE\fP
|
26
|
+
Load Config File \- default: nil
|
27
|
+
.TP
|
28
|
+
\fB\-\-dump\fR \fIFORMAT\fP
|
29
|
+
.TP
|
30
|
+
\fB\-e\fR, \fB\-\-edit\fR
|
31
|
+
Edit the Prompt File \- default: false
|
32
|
+
.TP
|
33
|
+
\fB\-d\fR, \fB\-\-debug\fR
|
34
|
+
Turn On Debugging \- default: false
|
35
|
+
.TP
|
36
|
+
\fB\-v\fR, \fB\-\-verbose\fR
|
37
|
+
Be Verbose \- default: false
|
38
|
+
.TP
|
39
|
+
\fB\-\-version\fR
|
40
|
+
Print Version \- default: false
|
41
|
+
.TP
|
42
|
+
\fB\-h\fR, \fB\-\-help\fR
|
43
|
+
Show Usage \- default: false
|
44
|
+
.TP
|
45
|
+
\fB\-s\fR, \fB\-\-search\fR \fITERM\fP
|
46
|
+
Search for prompts contain TERM \- default: nil
|
47
|
+
.TP
|
48
|
+
\fB\-f\fR, \-\-fuzzy\`
|
49
|
+
Use Fuzzy Matching when searching for a prompt \- default: false
|
50
|
+
.TP
|
51
|
+
\fB\-\-completion\fR \fISHELL\[ru]NAME\fP
|
52
|
+
.TP
|
53
|
+
\fB\-o\fR, \fB\-\-\[lB]no\[rB]\-output\fR \fIPATH\[ru]TO\[ru]OUTPUT\[ru]FILE\fP
|
54
|
+
Out FILENAME \- default: \.\[sl]temp\.md
|
55
|
+
.TP
|
56
|
+
\fB\-l\fR, \fB\-\-\[lB]no\[rB]\-log\fR \fIPATH\[ru]TO\[ru]LOG\[ru]FILE\fP
|
57
|
+
Log FILEPATH \- default: \[Do]HOME\[sl]\.prompts\[sl]prompts\.log
|
58
|
+
.TP
|
59
|
+
\fB\-m\fR, \fB\-\-\[lB]no\[rB]\-markdown\fR
|
60
|
+
Format with Markdown \- default: true
|
61
|
+
.TP
|
62
|
+
\fB\-\-model\fR \fINAME\fP
|
63
|
+
Name of the LLM model to use \- default: gpt\-4\-1106\-preview
|
64
|
+
.TP
|
65
|
+
\fB\-p\fR, \fB\-\-prompts\fR \fIPATH\[ru]TO\[ru]DIRECTORY\fP
|
66
|
+
Directory containing the prompt files \- default: \[ti]\[sl]\.prompts
|
67
|
+
.TP
|
68
|
+
\fB\-b\fR, \fB\-\-\[lB]no\[rB]\-backend\fR \fILLM TOOL\fP
|
69
|
+
Specify the backend prompt resolver \- default: :mods
|
70
|
+
.SH ENVIRONMENT
|
71
|
+
.PP
|
72
|
+
The aia CLI uses the following environment variables:
|
73
|
+
.RS
|
74
|
+
.IP \(bu 2
|
75
|
+
\fBAIA\[ru]PROMPTS\[ru]DIR\fR: Path to the directory containing prompts files \- default: \fB\[Do]HOME\[sl]\.prompts\[ru]dir\fR
|
76
|
+
.IP \(bu 2
|
77
|
+
\fBAIA\[ru]BACKEND\fR: The AI command\-line program used \- default: \fBmods\fR
|
78
|
+
.IP \(bu 2
|
79
|
+
\fBEDITOR\fR: The text editor used by the edit option \- default: edit
|
80
|
+
.IP \(bu 2
|
81
|
+
\fBAIA\[ru]MODEL\fR: The AI model specification \- default: \fBgpt\-4\-1106\-preview\fR
|
82
|
+
.IP \(bu 2
|
83
|
+
\fBAIA\[ru]OUTPUT\fR: The default filename for output \- default: \fB\.\[sl]temp\.md\fR
|
84
|
+
.IP \(bu 2
|
85
|
+
\fBAIA\[ru]PROMPT\[ru]LOG\fR: The default filepath for the prompts log \- default: \fB\[Do]HOME\[sl]\.prompts\[sl]\[ru]prompts\.log\fR
|
86
|
+
.RE
|
87
|
+
.PP
|
88
|
+
Additionally, the program requires an OpenAI access key, which can be specified using one of the following environment variables:
|
89
|
+
.RS
|
90
|
+
.IP \(bu 2
|
91
|
+
\fBOPENAI\[ru]ACCESS\[ru]TOKEN\fR
|
92
|
+
.IP \(bu 2
|
93
|
+
\fBOPENAI\[ru]API\[ru]KEY\fR
|
94
|
+
.RE
|
95
|
+
.PP
|
96
|
+
Currently there is not specific standard for name of the OpenAI key\. Some programs use one name, while others use a different name\. Both of the envars listed above mean the same thing\. If you use more than one tool to access OpenAI resources, you may have to set several envars to the same key value\.
|
97
|
+
.PP
|
98
|
+
To acquire an OpenAI access key, first create an account on the OpenAI platform, where further documentation is available\.
|
99
|
+
.SH USAGE NOTES
|
100
|
+
.PP
|
101
|
+
\fBaia\fR is designed for flexibility, allowing users to pass prompt ids and context files as arguments\. Some options change the behavior of the output, such as \fB\-\-output\fR for specifying a file or \fB\-\-no\-output\fR for disabling file output in favor of standard output\.
|
102
|
+
.PP
|
103
|
+
The \fB\-\-completion\fR option displays a script that enables prompt ID auto\-completion for bash, zsh, or fish shells\. It\[cq]s crucial to integrate the script into the shell\[cq]s runtime to take effect\.
|
104
|
+
.SH SEE ALSO
|
105
|
+
.RS
|
106
|
+
.IP \(bu 2
|
107
|
+
OpenAI Platform Documentation
|
108
|
+
.UR https:\[sl]\[sl]platform\.openai\.com\[sl]docs\[sl]overview
|
109
|
+
.UE
|
110
|
+
for more information on obtaining access tokens
|
111
|
+
.UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys
|
112
|
+
.UE
|
113
|
+
and working with OpenAI models\.
|
114
|
+
.IP \(bu 2
|
115
|
+
mods
|
116
|
+
.UR https:\[sl]\[sl]github\.com\[sl]charmbracelet\[sl]mods
|
117
|
+
.UE
|
118
|
+
for more information on \fBmods\fR \- AI for the command line, built for pipelines\. LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown\. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines\. Mods works with OpenAI
|
119
|
+
.UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys
|
120
|
+
.UE
|
121
|
+
and LocalAI
|
122
|
+
.UR https:\[sl]\[sl]github\.com\[sl]go\-skynet\[sl]LocalAI
|
123
|
+
.UE
|
124
|
+
.IP \(bu 2
|
125
|
+
sgpt
|
126
|
+
.UR https:\[sl]\[sl]github\.com\[sl]tbckr\[sl]sgpt
|
127
|
+
.UE
|
128
|
+
(aka shell\-gpt) is a powerful command\-line interface (CLI) tool designed for seamless interaction with OpenAI models directly from your terminal\. Effortlessly run queries, generate shell commands or code, create images from text, and more, using simple commands\. Streamline your workflow and enhance productivity with this powerful and user\-friendly CLI tool\.
|
129
|
+
.RE
|
130
|
+
.SH AUTHOR
|
131
|
+
.PP
|
132
|
+
Dewayne VanHoozer
|
133
|
+
.MT dvanhoozer\[at]gmail\.com
|
134
|
+
.ME
|
data/man/aia.1.md
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
# aia 1 "2024-01-01" AIA "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
aia - command-line interface for an AI assistant
|
5
|
+
|
6
|
+
## SYNOPSIS
|
7
|
+
aia [options]* PROMPT_ID [CONTEXT_FILE]* [-- EXTERNAL_OPTIONS+]
|
8
|
+
|
9
|
+
## DESCRIPTION
|
10
|
+
|
11
|
+
The aia command-line tool is an interface for interacting with an AI model backend, providing a simple way to send prompts and receive responses. The CLI supports various options to customize the interaction, load a configuration file, edit prompts, set debugging levels, and more.
|
12
|
+
|
13
|
+
## ARGUMENTS
|
14
|
+
|
15
|
+
*PROMPT_ID*
|
16
|
+
: This is a required argument.
|
17
|
+
|
18
|
+
*CONTEXT_FILES*
|
19
|
+
: This is an optional argument. One or more files can be added to the prompt as context for the backend gen-AI tool to process.
|
20
|
+
|
21
|
+
*EXTERNAL_OPTIONS*
|
22
|
+
: External options are optional. Anything that follow " -- " will be sent to the backend gen-AI tool. For example "-- -C -m gpt4-128k" will send the options "-C -m gpt4-128k" to the backend gen-AI tool. `aia` will not validate these external options before sending them to the backend gen-AI tool.
|
23
|
+
|
24
|
+
## OPTIONS
|
25
|
+
|
26
|
+
`-c`, `--config` *PATH_TO_CONFIG_FILE*
|
27
|
+
: Load Config File - default: nil
|
28
|
+
|
29
|
+
`--dump` *FORMAT*
|
30
|
+
: Dump a Config File in [yaml | toml] to STDOUT - default: nil
|
31
|
+
|
32
|
+
`-e`, `--edit`
|
33
|
+
: Edit the Prompt File - default: false
|
34
|
+
|
35
|
+
`-d`, `--debug`
|
36
|
+
: Turn On Debugging - default: false
|
37
|
+
|
38
|
+
`-v`, `--verbose`
|
39
|
+
: Be Verbose - default: false
|
40
|
+
|
41
|
+
`--version`
|
42
|
+
: Print Version - default: false
|
43
|
+
|
44
|
+
`-h`, `--help`
|
45
|
+
: Show Usage - default: false
|
46
|
+
|
47
|
+
`-s`, `--search` *TERM*
|
48
|
+
: Search for prompts contain TERM - default: nil
|
49
|
+
|
50
|
+
`-f`, --fuzzy`
|
51
|
+
: Use Fuzzy Matching when searching for a prompt - default: false
|
52
|
+
|
53
|
+
`--completion` *SHELL_NAME*
|
54
|
+
: Show completion script for bash|zsh|fish - default: nil
|
55
|
+
|
56
|
+
`-o`, `--[no]-output` *PATH_TO_OUTPUT_FILE*
|
57
|
+
: Out FILENAME - default: ./temp.md
|
58
|
+
|
59
|
+
`-l`, `--[no]-log` *PATH_TO_LOG_FILE*
|
60
|
+
: Log FILEPATH - default: $HOME/.prompts/prompts.log
|
61
|
+
|
62
|
+
`-m`, `--[no]-markdown`
|
63
|
+
: Format with Markdown - default: true
|
64
|
+
|
65
|
+
`--model` *NAME*
|
66
|
+
: Name of the LLM model to use - default: gpt-4-1106-preview
|
67
|
+
|
68
|
+
`-p`, `--prompts` *PATH_TO_DIRECTORY*
|
69
|
+
: Directory containing the prompt files - default: ~/.prompts
|
70
|
+
|
71
|
+
`-b`, `--[no]-backend` *LLM TOOL*
|
72
|
+
: Specify the backend prompt resolver - default: :mods
|
73
|
+
|
74
|
+
## ENVIRONMENT
|
75
|
+
The aia CLI uses the following environment variables:
|
76
|
+
|
77
|
+
- `AIA_PROMPTS_DIR`: Path to the directory containing prompts files - default: `$HOME/.prompts_dir`
|
78
|
+
- `AIA_BACKEND`: The AI command-line program used - default: `mods`
|
79
|
+
- `EDITOR`: The text editor used by the edit option - default: edit
|
80
|
+
- `AIA_MODEL`: The AI model specification - default: `gpt-4-1106-preview`
|
81
|
+
- `AIA_OUTPUT`: The default filename for output - default: `./temp.md`
|
82
|
+
- `AIA_PROMPT_LOG`: The default filepath for the prompts log - default: `$HOME/.prompts/_prompts.log`
|
83
|
+
|
84
|
+
Additionally, the program requires an OpenAI access key, which can be specified using one of the following environment variables:
|
85
|
+
|
86
|
+
- `OPENAI_ACCESS_TOKEN`
|
87
|
+
- `OPENAI_API_KEY`
|
88
|
+
|
89
|
+
Currently there is not specific standard for name of the OpenAI key. Some programs use one name, while others use a different name. Both of the envars listed above mean the same thing. If you use more than one tool to access OpenAI resources, you may have to set several envars to the same key value.
|
90
|
+
|
91
|
+
To acquire an OpenAI access key, first create an account on the OpenAI platform, where further documentation is available.
|
92
|
+
|
93
|
+
## USAGE NOTES
|
94
|
+
`aia` is designed for flexibility, allowing users to pass prompt ids and context files as arguments. Some options change the behavior of the output, such as `--output` for specifying a file or `--no-output` for disabling file output in favor of standard output.
|
95
|
+
|
96
|
+
The `--completion` option displays a script that enables prompt ID auto-completion for bash, zsh, or fish shells. It's crucial to integrate the script into the shell's runtime to take effect.
|
97
|
+
|
98
|
+
## SEE ALSO
|
99
|
+
- [OpenAI Platform Documentation](https://platform.openai.com/docs/overview) for more information on [obtaining access tokens](https://platform.openai.com/account/api-keys) and working with OpenAI models.
|
100
|
+
|
101
|
+
- [mods](https://github.com/charmbracelet/mods) for more information on `mods` - AI for the command line, built for pipelines. LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines. Mods works with [OpenAI](https://platform.openai.com/account/api-keys) and [LocalAI](https://github.com/go-skynet/LocalAI)
|
102
|
+
|
103
|
+
- [sgpt](https://github.com/tbckr/sgpt) (aka shell-gpt) is a powerful command-line interface (CLI) tool designed for seamless interaction with OpenAI models directly from your terminal. Effortlessly run queries, generate shell commands or code, create images from text, and more, using simple commands. Streamline your workflow and enhance productivity with this powerful and user-friendly CLI tool.
|
104
|
+
|
105
|
+
## AUTHOR
|
106
|
+
|
107
|
+
Dewayne VanHoozer <dvanhoozer@gmail.com>
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dewayne VanHoozer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: hashie
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: prompt_manager
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +38,48 @@ dependencies:
|
|
24
38
|
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: semver2
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: toml-rb
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
27
83
|
- !ruby/object:Gem::Dependency
|
28
84
|
name: amazing_print
|
29
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +109,7 @@ dependencies:
|
|
53
109
|
- !ruby/object:Gem::Version
|
54
110
|
version: '0'
|
55
111
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
112
|
+
name: kramdown-man
|
57
113
|
requirement: !ruby/object:Gem::Requirement
|
58
114
|
requirements:
|
59
115
|
- - ">="
|
@@ -94,37 +150,35 @@ extensions: []
|
|
94
150
|
extra_rdoc_files: []
|
95
151
|
files:
|
96
152
|
- ".envrc"
|
153
|
+
- ".semver"
|
97
154
|
- CHANGELOG.md
|
98
155
|
- LICENSE
|
99
156
|
- LICENSE.txt
|
100
157
|
- README.md
|
101
158
|
- Rakefile
|
102
159
|
- bin/aia
|
160
|
+
- justfile
|
103
161
|
- lib/aia.rb
|
104
162
|
- lib/aia/aia_completion.bash
|
105
163
|
- lib/aia/aia_completion.fish
|
106
164
|
- lib/aia/aia_completion.zsh
|
107
165
|
- lib/aia/cli.rb
|
108
|
-
- lib/aia/
|
109
|
-
- lib/aia/external.rb
|
110
|
-
- lib/aia/external/,keep
|
111
|
-
- lib/aia/external/.irbrc
|
112
|
-
- lib/aia/external/ag.rb
|
113
|
-
- lib/aia/external/bat.rb
|
114
|
-
- lib/aia/external/fzf.rb
|
115
|
-
- lib/aia/external/glow.rb
|
116
|
-
- lib/aia/external/mods.rb
|
117
|
-
- lib/aia/external/rg.rb
|
118
|
-
- lib/aia/external/sgpt.rb
|
119
|
-
- lib/aia/external/subl.rb
|
120
|
-
- lib/aia/external/tool.rb
|
121
|
-
- lib/aia/external_two.rb
|
166
|
+
- lib/aia/config.rb
|
122
167
|
- lib/aia/logging.rb
|
123
168
|
- lib/aia/main.rb
|
124
169
|
- lib/aia/prompt_processing.rb
|
170
|
+
- lib/aia/tools.rb
|
171
|
+
- lib/aia/tools/editor.rb
|
172
|
+
- lib/aia/tools/mods.rb
|
173
|
+
- lib/aia/tools/sgpt.rb
|
174
|
+
- lib/aia/tools/subl.rb
|
175
|
+
- lib/aia/tools/vim.rb
|
125
176
|
- lib/aia/version.rb
|
126
177
|
- lib/core_ext/string_wrap.rb
|
127
178
|
- lib/modularization_plan.md
|
179
|
+
- main.just
|
180
|
+
- man/aia.1
|
181
|
+
- man/aia.1.md
|
128
182
|
homepage: https://github.com/MadBomber/aia
|
129
183
|
licenses:
|
130
184
|
- MIT
|
@@ -148,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
202
|
- !ruby/object:Gem::Version
|
149
203
|
version: '0'
|
150
204
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
205
|
+
rubygems_version: 3.5.3
|
152
206
|
signing_key:
|
153
207
|
specification_version: 4
|
154
208
|
summary: AI Assistant (aia) a command-line (CLI) utility
|
data/lib/aia/configuration.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# lib/aia/configuration.rb
|
2
|
-
|
3
|
-
HOME = Pathname.new(ENV['HOME'])
|
4
|
-
PROMPTS_DIR = Pathname.new(ENV['PROMPTS_DIR'] || (HOME + ".prompts_dir"))
|
5
|
-
|
6
|
-
AI_CLI_PROGRAM = "mods"
|
7
|
-
EDITOR = ENV['EDITOR'] || 'edit'
|
8
|
-
MY_NAME = "aia"
|
9
|
-
MODS_MODEL = ENV['MODS_MODEL'] || 'gpt-4-1106-preview'
|
10
|
-
OUTPUT = Pathname.pwd + "temp.md"
|
11
|
-
PROMPT_LOG = PROMPTS_DIR + "_prompts.log"
|
12
|
-
|
13
|
-
|
14
|
-
module AIA::Configuration
|
15
|
-
def setup_configuration
|
16
|
-
@prompt = nil
|
17
|
-
|
18
|
-
PromptManager::Prompt.storage_adapter =
|
19
|
-
PromptManager::Storage::FileSystemAdapter.config do |config|
|
20
|
-
config.prompts_dir = PROMPTS_DIR
|
21
|
-
config.prompt_extension = '.txt'
|
22
|
-
config.params_extension = '.json'
|
23
|
-
config.search_proc = nil
|
24
|
-
# TODO: add the rgfzz script for search_proc
|
25
|
-
end.new
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
# Get the additional CLI arguments intended for the
|
30
|
-
# backend gen-AI processor.
|
31
|
-
def extract_extra_options
|
32
|
-
extra_index = @arguments.index('--')
|
33
|
-
if extra_index.nil?
|
34
|
-
@extra_options = []
|
35
|
-
else
|
36
|
-
@extra_options = @arguments.slice!(extra_index..-1)[1..]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
data/lib/aia/external/,keep
DELETED
File without changes
|
data/lib/aia/external/.irbrc
DELETED
data/lib/aia/external/ag.rb
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
# lib/aia/external/ag.rb
|
2
|
-
|
3
|
-
class AIA::External::Ag < AIA::External::Tool
|
4
|
-
def initialize
|
5
|
-
super
|
6
|
-
@role = :search
|
7
|
-
@desc = "the_silver_searcher Code-search similar to ack"
|
8
|
-
@url = "https://github.com/ggreer/the_silver_searcher"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
__END__
|
13
|
-
|
14
|
-
Usage: ag [FILE-TYPE] [OPTIONS] PATTERN [PATH]
|
15
|
-
|
16
|
-
Recursively search for PATTERN in PATH.
|
17
|
-
Like grep or ack, but faster.
|
18
|
-
|
19
|
-
Example:
|
20
|
-
ag -i foo /bar/
|
21
|
-
|
22
|
-
Output Options:
|
23
|
-
--ackmate Print results in AckMate-parseable format
|
24
|
-
-A --after [LINES] Print lines after match (Default: 2)
|
25
|
-
-B --before [LINES] Print lines before match (Default: 2)
|
26
|
-
--[no]break Print newlines between matches in different files
|
27
|
-
(Enabled by default)
|
28
|
-
-c --count Only print the number of matches in each file.
|
29
|
-
(This often differs from the number of matching lines)
|
30
|
-
--[no]color Print color codes in results (Enabled by default)
|
31
|
-
--color-line-number Color codes for line numbers (Default: 1;33)
|
32
|
-
--color-match Color codes for result match numbers (Default: 30;43)
|
33
|
-
--color-path Color codes for path names (Default: 1;32)
|
34
|
-
--column Print column numbers in results
|
35
|
-
--[no]filename Print file names (Enabled unless searching a single file)
|
36
|
-
-H --[no]heading Print file names before each file's matches
|
37
|
-
(Enabled by default)
|
38
|
-
-C --context [LINES] Print lines before and after matches (Default: 2)
|
39
|
-
--[no]group Same as --[no]break --[no]heading
|
40
|
-
-g --filename-pattern PATTERN
|
41
|
-
Print filenames matching PATTERN
|
42
|
-
-l --files-with-matches Only print filenames that contain matches
|
43
|
-
(don't print the matching lines)
|
44
|
-
-L --files-without-matches
|
45
|
-
Only print filenames that don't contain matches
|
46
|
-
--print-all-files Print headings for all files searched, even those that
|
47
|
-
don't contain matches
|
48
|
-
--[no]numbers Print line numbers. Default is to omit line numbers
|
49
|
-
when searching streams
|
50
|
-
-o --only-matching Prints only the matching part of the lines
|
51
|
-
--print-long-lines Print matches on very long lines (Default: >2k characters)
|
52
|
-
--passthrough When searching a stream, print all lines even if they
|
53
|
-
don't match
|
54
|
-
--silent Suppress all log messages, including errors
|
55
|
-
--stats Print stats (files scanned, time taken, etc.)
|
56
|
-
--stats-only Print stats and nothing else.
|
57
|
-
(Same as --count when searching a single file)
|
58
|
-
--vimgrep Print results like vim's :vimgrep /pattern/g would
|
59
|
-
(it reports every match on the line)
|
60
|
-
-0 --null --print0 Separate filenames with null (for 'xargs -0')
|
61
|
-
|
62
|
-
Search Options:
|
63
|
-
-a --all-types Search all files (doesn't include hidden files
|
64
|
-
or patterns from ignore files)
|
65
|
-
-D --debug Ridiculous debugging (probably not useful)
|
66
|
-
--depth NUM Search up to NUM directories deep (Default: 25)
|
67
|
-
-f --follow Follow symlinks
|
68
|
-
-F --fixed-strings Alias for --literal for compatibility with grep
|
69
|
-
-G --file-search-regex PATTERN Limit search to filenames matching PATTERN
|
70
|
-
--hidden Search hidden files (obeys .*ignore files)
|
71
|
-
-i --ignore-case Match case insensitively
|
72
|
-
--ignore PATTERN Ignore files/directories matching PATTERN
|
73
|
-
(literal file/directory names also allowed)
|
74
|
-
--ignore-dir NAME Alias for --ignore for compatibility with ack.
|
75
|
-
-m --max-count NUM Skip the rest of a file after NUM matches (Default: 10,000)
|
76
|
-
--one-device Don't follow links to other devices.
|
77
|
-
-p --path-to-ignore STRING
|
78
|
-
Use .ignore file at STRING
|
79
|
-
-Q --literal Don't parse PATTERN as a regular expression
|
80
|
-
-s --case-sensitive Match case sensitively
|
81
|
-
-S --smart-case Match case insensitively unless PATTERN contains
|
82
|
-
uppercase characters (Enabled by default)
|
83
|
-
--search-binary Search binary files for matches
|
84
|
-
-t --all-text Search all text files (doesn't include hidden files)
|
85
|
-
-u --unrestricted Search all files (ignore .ignore, .gitignore, etc.;
|
86
|
-
searches binary and hidden files as well)
|
87
|
-
-U --skip-vcs-ignores Ignore VCS ignore files
|
88
|
-
(.gitignore, .hgignore; still obey .ignore)
|
89
|
-
-v --invert-match
|
90
|
-
-w --word-regexp Only match whole words
|
91
|
-
-W --width NUM Truncate match lines after NUM characters
|
92
|
-
-z --search-zip Search contents of compressed (e.g., gzip) files
|
93
|
-
|
94
|
-
File Types:
|
95
|
-
The search can be restricted to certain types of files. Example:
|
96
|
-
ag --html needle
|
97
|
-
- Searches for 'needle' in files with suffix .htm, .html, .shtml or .xhtml.
|
98
|
-
|
99
|
-
For a list of supported file types run:
|
100
|
-
ag --list-file-types
|
101
|
-
|
102
|
-
ag was originally created by Geoff Greer. More information (and the latest release)
|
103
|
-
can be found at http://geoff.greer.fm/ag
|