Jump to content

Recommended Posts

Posted

This week we have ProcessWire 3.0.259 which includes several improvements, but my favorite is the addition of a new module type called "CliModule" which is short for "Command Line Interface Module". CliModules are those that provide the option for running from the command line. 

To list the available actions from command line modules, you can type "php index.php" in ProcessWire's installation directory. If "php" is not in your path, you'll have to type "/path/to/php index.php" instead, or add it to your path. Here's example output on my installation:

image.png

As you can see above, I've got AgentTools, WireTests and an example "Hello World" CliModule showing the available command line options. 

If I want to execute one of the commands, then I just type what it indicates. For example, here I will run `php index.php test FieldtypeText` and here's the output: 

image.png

Here's a simple example of a CliModule:

<?php namespace ProcessWire;

class HelloWorldCli extends WireData implements Module, CliModule {
  public static function getModuleInfo() {
    return [
      'title' => 'Hello World CLI module',
      'description' => 'Just an example',
      'version' => 1,
      'cli' => 'hello', // Example: php index.php hello
    ];
  }
  public function executeCli(array $args) {
    $command = $args[0] ?? '';
    $name = isset($args[1]) ? $args[1] : 'friend';
    if($command === 'hi') {
      echo "Hello there $name!";
    } else if($command === 'bye') {
      echo "Goodbye $name, see you later!";
    } else {
      echo "Specify 'hi' or 'bye' optionally followed by a name";
    }
  }
  public function getCliCommands() {
    return [
      'hi' => 'Say hello',
      'bye' => 'Say goodbye',
    ];
  }
}

For more details on the CliModule format, see wire/core/CliModule.php

Improvements have continued with the AgentTools module. This week we added:

New multi-model support: You can now configure multiple different agents in the module, and choose which one you'd like to use from the Engineer screen. Details

image.png

New agent-memory support: Now when you make a request of the Engineer, it remembers it for follow-up questions and changes. It keeps a conversation history for context of what you are working on. Details

image.png

image.png

New support for subagents: This enables any of the agents to launch additional agents when/where it helps to do so. For instance, specialist agents, or lower cost agents for simple jobs, and who knows what else. Claude requested the feature and also implemented it, so I'll be interested to see how it gets used. Details

New agents configuration screen where you can define up to 10 agents (that's plenty, right?). Details

image.png

Also new this week is a new WireTests module testing suite for ProcessWire. This first version focuses on testing all of ProcessWire's Fieldtype modules (including a few ProFields ones as well), but it's easy to add tests for any kind of module type. So we'll be adding more tests and improving existing tests as this module moves forward. For details head on over to: WireTests

Thanks for reading and have a great weekend!

  • Like 1
  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   1 member

×
×
  • Create New...