Download the PHP package diversen/shell-gpt-php without Composer

On this page you can find all versions of the php package diversen/shell-gpt-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shell-gpt-php

shell-gpt-php

cat README.md | shgpt q "Summerize the above README in the style of Shakespeare"

Greeting all, 'tis time to install mine shell-gpt-php. 'Tis a wondrous treasure that can assist with thy questions and commands, thine need only download the latest release, execute thine commands, and away we go! Set thy key for the dilaog, or 'tis time to pipe thy content in and generate shell command with or one line python program. Ask a question, or show token usage from thy last ninety days, 'tis all here! Tis a goodly thing all said, so depart thou now, and enjoy thine shell-gpt-php.

Installation

Download the latest release:

Set key

Set (or change) API key

shgpt key

Create a dialog

shgpt dialog

Or:

shgpt d

Something like ChatGPT (gpt-3.5-turbo model). Meaning that the answer is extrapolated from the previous questions and answers.

You: Say "hello world"
Assistant: Hello world!
You: ...

Some sub commands are available in the dialog mode:

Available commands: 

save  - Save dialog to file
exec  - Execute a command and feed the output to the dialog
exit  - Exit the dialog
comm  - Show all commands
clear - Clear the dialog and start over

Type a message to ChatGPT. Maybe 'hello world!' You may also use above commands.

All dialogs are auto-saved on exit to the directory ~/.config/shell-gpt-php/data/

Generate a shell command:

Command optimized for shell commands.

shgpt shell "Command to search replace in files recursive in current directory"
# -> find . -type f -exec sed -i 's/search/replace/g' {} \;

shgpt s "command to change origin of a git repo"
# -> git remote set-url origin <new url>

Add the -e flag to execute the command:

shgpt s "Command to search replace in files recursive in current directory" -e
# -> Execute command: find . -type f -exec sed -i 's/search/replace/g' {} \; ? Sure you want to continue? [Y/n]

Generating code:

Command to generate code snippets.

shgpt code "Can you make a simple HTML template?" > index.html
more index.html

shgpt c "Write a one line hello world python program"
# -> print("Hello World!")

Ask any question

shgpt question "Extract directories from this list of files: $(ls -l)"
# -> bin, src, tests, vendor

shgpt q "What is the distance to the sun? Just show me the number."
# -> 149,597,870.7 kilometers 

STDIN

The shell, code, question commands will accept input from STDIN. STDIN will be added before the prompt. E.g.:

cat composer.json | shgpt q "What type of input is this?"
# -> This is a PHP package composer JSON file.

Set params

Save some model parameters that will override default params. But not parameters that exists on the command line.

E.g. if you set the temperature to 2.0 you will get kind of crazy results

shgpt params -h

Show token usage

Last 24 hours, last 7 days, last 30 days and last 90 days.

shgpt usage

Export

Export all dialogs as markdown:

shgpt export some_dir

License

MIT © Dennis Iversen


All versions of shell-gpt-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
diversen/minimal-cli-framework Version ^7.0
diversen/tiny-gpt-client Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package diversen/shell-gpt-php contains the following files

Loading the files please wait ....