@@ -170,48 +170,14 @@ if you want to use the capabilities of the _ai-cli_ library, configure your syst
170170to use the Homebrew commands in preference to the ones supplied with macOS.
171171
172172## Shell startup configuration
173- You can configure the _ ai-cli_ library to be always available in your _ bash_ shell by
174- adding the following lines in your ` .bashrc ` file.
175- Adjust the ` AI_CLI_LIB ` setting to match the _ ai-cli_ library installation path;
173+ You can configure the _ ai-cli_ library to be always available in your _ bash_
174+ shell by adding the following lines in your ` .bashrc ` file
175+ (ideally near its beginning for performance reasons).
176+ Adjust the provided path match the _ ai-cli_ library installation path;
176177it is currently set for a local installation in your home directory.
177178``` bash
178- # >>> initialize the ai-cli library >>>
179-
180- # Location of the ai-cli shared library; adjust as needed.
181- AI_CLI_LIB=(" $HOME /lib/ai_cli." * )
182-
183- # Execute only if configured, installed, and not initialized.
184- if [[ -r ~ /.aicliconfig && -r $AI_CLI_LIB && " $LD_PRELOAD " != * $AI_CLI_LIB * ]]
185- then
186- # Set Linux and Cygwin environment variable.
187- if [ -z " $LD_PRELOAD " ] ; then
188- export LD_PRELOAD=" $AI_CLI_LIB "
189- else
190- LD_PRELOAD=" $LD_PRELOAD :$AI_CLI_LIB "
191- fi
192-
193- # Set macOS environment variables.
194- if [ -z " $DYLD_LIBRARY_PATH " ] ; then
195- export DYLD_LIBRARY_PATH=/opt/homebrew/lib
196- else
197- DYLD_LIBRARY_PATH=" /opt/homebrew/lib:$DYLD_LIBRARY_PATH "
198- fi
199- if [ -z " $DYLD_INSERT_LIBRARIES " ] ; then
200- export DYLD_INSERT_LIBRARIES=" $AI_CLI_LIB "
201- else
202- DYLD_INSERT_LIBRARIES=" $LD_PRELOAD :$AI_CLI_LIB "
203- fi
204-
205- # Overlay current bash with a new instance, which will include the required
206- # environment variables.
207- if shopt -q login_shell ; then
208- exec -l bash
209- else
210- exec bash
211- fi
212-
213- fi
214- # <<< initialize the ai-cli library <<<
179+ # Initialize the ai-cli library
180+ source $HOME /share/ai-cli/ai-cli-activate-bash.sh
215181```
216182
217183## Reference documentation
0 commit comments