aicli 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a63ca399cecdf79d247289bf218eb22fc947f9410c617de4d521cecab6a56094
4
- data.tar.gz: fbedd7d7fda81a16ee62da7d8854fe482f53493cf0e658a278e33b43eedc7b27
3
+ metadata.gz: f0ecf3b2378a31b6986dd9758fa346b3bd1aeef95547e60f57a16ae990358c3b
4
+ data.tar.gz: baaf14692eaba18db2ecf54dd77912f5d138153d4698500e519b62496f1455bb
5
5
  SHA512:
6
- metadata.gz: 9d1c316e7df67f511941fe7d6b8ba25750bafea1308c1c503c3a4a77c64d0fa69e03520fb9498f38a9fb1de9e5384088284b470754509ee2a096916cb0d70ecd
7
- data.tar.gz: 036d4c36bd4c49918d9841dea794c31c79f691713e9db566a6e2bac47adc087f45beae7a4f3fae2f9faa461fea23761d6cc465b2c9eb588e76f6d119e3c707cf
6
+ metadata.gz: 49266f502dca2be1094fcaa23cf084b8863e2cecfcfe1e45c281b0e1935c86f0ed597ecfe461deee228a7c97036a5d141ec0505bfa245249f987908318b98779
7
+ data.tar.gz: fc2e6d276064e9ac15a4cb44e708556a21cb1a6d02f4ac8be6d14fa81b29d81b0d6b45ba5dddac10d51f9a8e0708612c0c975ba45893d6228331b6068ac3090b
data/README.md CHANGED
@@ -4,11 +4,13 @@ Natural language to live shell commands — OpenAI & Anthropic.
4
4
 
5
5
  Chat with the model and run suggested commands in your shell in one seamless flow.
6
6
 
7
+ The gem is named **aicli**; the shell command is **`ai`** (also available as `aicli`).
8
+
7
9
  ## Setup
8
10
 
9
11
  > Requires Ruby 3.0+
10
12
 
11
- 1. Install _aicli_:
13
+ 1. Install the gem:
12
14
 
13
15
  ```sh
14
16
  gem install aicli
@@ -28,18 +30,18 @@ Chat with the model and run suggested commands in your shell in one seamless flo
28
30
  **OpenAI** (default) — key from [OpenAI](https://platform.openai.com/account/api-keys):
29
31
 
30
32
  ```sh
31
- aicli config set PROVIDER=openai
32
- aicli config set OPENAI_KEY=<your token>
33
+ ai config set PROVIDER=openai
34
+ ai config set OPENAI_KEY=<your token>
33
35
  ```
34
36
 
35
37
  **Anthropic** — key from [Anthropic](https://console.anthropic.com/settings/keys):
36
38
 
37
39
  ```sh
38
- aicli config set PROVIDER=anthropic
39
- aicli config set ANTHROPIC_KEY=<your token>
40
+ ai config set PROVIDER=anthropic
41
+ ai config set ANTHROPIC_KEY=<your token>
40
42
  ```
41
43
 
42
- Or use the interactive UI (`aicli config`) to pick provider, key, and model.
44
+ Or use the interactive UI (`ai config`) to pick provider, key, and model.
43
45
  Model lists come from the [RubyLLM](https://rubyllm.com/models/) registry.
44
46
 
45
47
  Config lives in `~/.aicli/config`. Chat/prompt history is stored in `~/.aicli/context` (last 40 messages) and reloaded on the next run.
@@ -47,31 +49,29 @@ Chat with the model and run suggested commands in your shell in one seamless flo
47
49
  ## Usage
48
50
 
49
51
  ```bash
50
- aicli <prompt>
52
+ ai <prompt>
51
53
  ```
52
54
 
53
55
  For example:
54
56
 
55
57
  ```bash
56
- aicli list all log files
58
+ ai list all log files
57
59
  ```
58
60
 
59
61
  Then you will get an output where you can choose to run the suggested command, revise it via a prompt, edit it, copy it, or cancel.
60
62
 
61
- The short alias `ai` is also available.
62
-
63
63
  ### Special characters
64
64
 
65
65
  Some shells handle characters like `?` or `*` specially. Wrap the prompt in quotes if needed:
66
66
 
67
67
  ```bash
68
- aicli 'what is my ip address'
68
+ ai 'what is my ip address'
69
69
  ```
70
70
 
71
71
  ### Chat mode
72
72
 
73
73
  ```bash
74
- aicli chat
74
+ ai chat
75
75
  ```
76
76
 
77
77
  Ask for shell commands in a multi-turn conversation. When the assistant suggests a command in a code fence, you are asked whether to run it; after it runs (or you decline), chat continues. Press `Ctrl+d` to quit.
@@ -79,20 +79,20 @@ Ask for shell commands in a multi-turn conversation. When the assistant suggests
79
79
  ### Silent mode (skip explanations)
80
80
 
81
81
  ```bash
82
- aicli -s list all log files
82
+ ai -s list all log files
83
83
  ```
84
84
 
85
85
  Or save the preference:
86
86
 
87
87
  ```bash
88
- aicli config set SILENT_MODE=true
88
+ ai config set SILENT_MODE=true
89
89
  ```
90
90
 
91
91
  ### Provider and model
92
92
 
93
93
  ```sh
94
- aicli config set PROVIDER=openai # or anthropic
95
- aicli config set MODEL=gpt-4o-mini # provider-specific model id
94
+ ai config set PROVIDER=openai # or anthropic
95
+ ai config set MODEL=gpt-4o-mini # provider-specific model id
96
96
  ```
97
97
 
98
98
  Defaults: `gpt-4o-mini` (OpenAI), `claude-sonnet-4-6` (Anthropic).
@@ -104,7 +104,7 @@ LLM calls go through [RubyLLM](https://rubyllm.com/), so chat streaming and mode
104
104
  Useful for OpenAI-compatible proxies (ignored for Anthropic):
105
105
 
106
106
  ```sh
107
- aicli config set OPENAI_API_ENDPOINT=<your proxy endpoint>
107
+ ai config set OPENAI_API_ENDPOINT=<your proxy endpoint>
108
108
  ```
109
109
 
110
110
  Default: `https://api.openai.com/v1`
@@ -131,26 +131,21 @@ Default: `https://api.openai.com/v1`
131
131
  | Italian | it |
132
132
 
133
133
  ```sh
134
- aicli config set LANGUAGE=zh-Hans
134
+ ai config set LANGUAGE=zh-Hans
135
135
  ```
136
136
 
137
137
  ### Config UI
138
138
 
139
139
  ```bash
140
- aicli config
140
+ ai config
141
141
  ```
142
142
 
143
143
  ### Upgrading
144
144
 
145
145
  ```bash
146
- aicli --version
147
- gem update aicli
148
- ```
149
-
150
- Or:
151
-
152
- ```bash
153
- aicli update
146
+ ai --version
147
+ ai update
148
+ # or: gem update aicli
154
149
  ```
155
150
 
156
151
  ## Development
@@ -166,7 +161,7 @@ bundle exec bin/ai chat
166
161
  bundle exec bin/ai list all log files
167
162
  ```
168
163
 
169
- `bin/aicli` is equivalent to `bin/ai`. `bundle exec` loads dependencies from the Gemfile and code from `lib/`.
164
+ `bundle exec` loads dependencies from the Gemfile and code from `lib/`. `bin/aicli` is an alias of `bin/ai`.
170
165
 
171
166
  Example config for local testing:
172
167
 
data/lib/aicli/cli.rb CHANGED
@@ -80,7 +80,7 @@ module AiCli
80
80
  Commands::Chat.run
81
81
  end
82
82
 
83
- desc 'update', 'Update aicli to the latest version'
83
+ desc 'update', 'Update the aicli gem to the latest version'
84
84
  def update
85
85
  init_i18n
86
86
  Commands::Update.run
@@ -51,7 +51,7 @@ module AiCli
51
51
  user_prompt,
52
52
  writer: lambda { |chunk|
53
53
  unless started
54
- spinner.success(pastel.green('aicli:'))
54
+ spinner.success(pastel.green('ai:'))
55
55
  puts ''
56
56
  started = true
57
57
  end
@@ -60,7 +60,7 @@ module AiCli
60
60
  )
61
61
 
62
62
  unless started
63
- spinner.success(pastel.green('aicli:'))
63
+ spinner.success(pastel.green('ai:'))
64
64
  puts ''
65
65
  end
66
66
  puts ''
@@ -40,7 +40,7 @@ module AiCli
40
40
  end
41
41
  end
42
42
 
43
- # Multi-turn chat helper used by `aicli chat`.
43
+ # Multi-turn chat helper used by `ai chat`.
44
44
  def start_chat(config)
45
45
  chat = Llm.build_chat(config)
46
46
  chat.with_instructions(chat_system_prompt)
@@ -49,7 +49,7 @@ module AiCli
49
49
 
50
50
  def chat_system_prompt
51
51
  <<~PROMPT
52
- You are aicli, a terminal assistant. The user is asking for shell commands.
52
+ You are ai, a terminal assistant. The user is asking for shell commands.
53
53
 
54
54
  Target OS: #{OsDetect.operating_system_name}
55
55
  Target shell: #{OsDetect.detect_shell}
@@ -3,7 +3,7 @@
3
3
  module AiCli
4
4
  module Helpers
5
5
  module Constants
6
- COMMAND_NAME = 'aicli'
6
+ COMMAND_NAME = 'ai'
7
7
  PROJECT_NAME = 'aicli'
8
8
  REPO_URL = 'https://github.com/magnum/aicli'
9
9
  end
@@ -19,7 +19,7 @@ module AiCli
19
19
  puts pastel.dim(error.backtrace.join("\n"))
20
20
  end
21
21
 
22
- puts "\n#{indent}#{pastel.dim("aicli v#{AiCli::VERSION}")}"
22
+ puts "\n#{indent}#{pastel.dim("ai v#{AiCli::VERSION}")}"
23
23
  puts "\n#{indent}#{I18n.t('Please open a Bug report with the information above')}:"
24
24
  puts "#{indent}https://github.com/magnum/aicli/issues/new"
25
25
  end
data/lib/aicli/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AiCli
4
- VERSION = '0.2.8'
4
+ VERSION = '0.2.9'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aicli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Molinari
@@ -93,9 +93,9 @@ dependencies:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0.9'
96
- description: aicli turns natural language into runnable shell commands using OpenAI
97
- or Anthropic. Chat with the model and execute suggested commands live in your shell
98
- in one seamless flow.
96
+ description: ai turns natural language into runnable shell commands using OpenAI or
97
+ Anthropic. Chat with the model and execute suggested commands live in your shell
98
+ in one seamless flow. Install the aicli gem, then run the ai command.
99
99
  email:
100
100
  - antoniomolinari@me.com
101
101
  executables: