Skip to content

Commit 374e6ce

Browse files
committed
Initial commit
0 parents  commit 374e6ce

File tree

15 files changed

+855
-0
lines changed

15 files changed

+855
-0
lines changed

.distignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.DS_Store
2+
.git
3+
.gitignore
4+
.gitlab-ci.yml
5+
.editorconfig
6+
.travis.yml
7+
behat.yml
8+
circle.yml
9+
phpcs.xml.dist
10+
phpunit.xml.dist
11+
bin/
12+
features/
13+
utils/
14+
*.zip
15+
*.tar.gz
16+
*.swp
17+
*.txt
18+
*.log

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
# From https://github.com/WordPress/wordpress-develop/blob/trunk/.editorconfig with a couple of additions.
8+
9+
root = true
10+
11+
[*]
12+
charset = utf-8
13+
end_of_line = lf
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true
16+
indent_style = tab
17+
18+
[{*.yml,*.feature,.jshintrc,*.json}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.md]
23+
trim_trailing_whitespace = false
24+
25+
[{*.txt,wp-config-sample.php}]
26+
end_of_line = crlf

.github/ISSUE_TEMPLATE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--
2+
3+
Thanks for creating a new issue!
4+
5+
Found a bug or want to suggest an enhancement? Before completing your issue, please review our best practices: https://make.wordpress.org/cli/handbook/bug-reports/
6+
7+
Need help with something? GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support
8+
9+
You can safely delete this comment.
10+
11+
-->

.github/PULL_REQUEST_TEMPLATE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
3+
Thanks for submitting a pull request!
4+
5+
Please review our contributing guidelines if you haven't recently: https://make.wordpress.org/cli/handbook/contributing/#creating-a-pull-request
6+
7+
Here's an overview to our process:
8+
9+
1. One of the project committers will soon provide a code review: https://make.wordpress.org/cli/handbook/code-review/
10+
2. You are expected to address the code review comments in a timely manner (if we don't hear from you in two weeks, we'll consider your pull request abandoned).
11+
3. Please make sure to include functional tests for your changes.
12+
4. The reviewing committer will merge your pull request as soon as it passes code review (and provided it fits within the scope of the project).
13+
14+
You can safely delete this comment.
15+
16+
-->

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
wp-cli.local.yml
3+
node_modules/
4+
vendor/
5+
*.zip
6+
*.tar.gz
7+
*.swp
8+
*.txt
9+
*.log
10+
composer.lock
11+
phpunit.xml
12+
phpcs.xml
13+
.phpcs.xml

.travis.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
os: linux
2+
dist: xenial
3+
4+
language: php
5+
php: 7.4
6+
7+
services:
8+
- mysql
9+
10+
notifications:
11+
email:
12+
on_success: never
13+
on_failure: change
14+
15+
branches:
16+
only:
17+
- master
18+
19+
cache:
20+
directories:
21+
- $HOME/.composer/cache
22+
23+
env:
24+
global:
25+
- PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH"
26+
- WP_CLI_BIN_DIR="$TRAVIS_BUILD_DIR/vendor/bin"
27+
28+
before_install:
29+
- |
30+
# Remove Xdebug for a huge performance increase:
31+
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
32+
phpenv config-rm xdebug.ini
33+
else
34+
echo "xdebug.ini does not exist"
35+
fi
36+
- |
37+
# Raise PHP memory limit to 2048MB
38+
echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
39+
- composer validate
40+
41+
install:
42+
- composer install
43+
- composer prepare-tests
44+
45+
script:
46+
- composer phpunit
47+
- composer behat || composer behat-rerun
48+
49+
jobs:
50+
include:
51+
- stage: test
52+
php: nightly
53+
env: WP_VERSION=trunk
54+
- stage: test
55+
php: 7.4
56+
env: WP_VERSION=latest
57+
- stage: test
58+
php: 7.3
59+
env: WP_VERSION=latest
60+
- stage: test
61+
php: 7.2
62+
env: WP_VERSION=latest
63+
- stage: test
64+
php: 7.1
65+
env: WP_VERSION=latest
66+
- stage: test
67+
php: 7.0
68+
env: WP_VERSION=latest
69+
- stage: test
70+
php: 5.6
71+
env: WP_VERSION=latest
72+
- stage: test
73+
php: 5.6
74+
env: WP_VERSION=3.7.11
75+
dist: trusty
76+
- stage: test
77+
php: 5.6
78+
env: WP_VERSION=trunk
79+
80+
allow_failures:
81+
- stage: test
82+
php: nightly
83+
env: WP_VERSION=trunk

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Contributing
2+
============
3+
4+
We appreciate you taking the initiative to contribute to this project.
5+
6+
Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
7+
8+
For a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
swissspidy/ai-command
2+
=====================
3+
4+
5+
6+
[![Build Status](https://travis-ci.org/swissspidy/ai-command.svg?branch=master)](https://travis-ci.org/swissspidy/ai-command)
7+
8+
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)
9+
10+
## Using
11+
12+
~~~
13+
wp hello-world
14+
~~~
15+
16+
## Installing
17+
18+
Installing this package requires WP-CLI v2.5 or greater. Update to the latest stable release with `wp cli update`.
19+
20+
Once you've done so, you can install the latest stable version of this package with:
21+
22+
```bash
23+
wp package install swissspidy/ai-command:@stable
24+
```
25+
26+
To install the latest development version of this package, use the following command instead:
27+
28+
```bash
29+
wp package install swissspidy/ai-command:dev-master
30+
```
31+
32+
## Contributing
33+
34+
We appreciate you taking the initiative to contribute to this project.
35+
36+
Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
37+
38+
For a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.
39+
40+
### Reporting a bug
41+
42+
Think you’ve found a bug? We’d love for you to help us get it fixed.
43+
44+
Before you create a new issue, you should [search existing issues](https://github.com/swissspidy/ai-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.
45+
46+
Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/swissspidy/ai-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).
47+
48+
### Creating a pull request
49+
50+
Want to contribute a new feature? Please first [open a new issue](https://github.com/swissspidy/ai-command/issues/new) to discuss whether the feature is a good fit for the project.
51+
52+
Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.
53+
54+
## Support
55+
56+
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support
57+
58+
59+
*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

ai-command.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace WP_CLI\AiCommand;
4+
5+
use WP_CLI;
6+
7+
if ( ! class_exists( '\WP_CLI' ) ) {
8+
return;
9+
}
10+
11+
$ai_command_autoloader = __DIR__ . '/vendor/autoload.php';
12+
13+
if ( file_exists( $ai_command_autoloader ) ) {
14+
require_once $ai_command_autoloader;
15+
}
16+
17+
WP_CLI::add_command( 'ai', AiCommand::class );

composer.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "swissspidy/ai-command",
3+
"type": "wp-cli-package",
4+
"description": "",
5+
"homepage": "https://github.com/swissspidy/ai-command",
6+
"license": "MIT",
7+
"authors": [],
8+
"require": {
9+
"gemini-api-php/client": "^1.7",
10+
"logiscape/mcp-sdk-php": "^1.0",
11+
"symfony/http-client": "^7.2",
12+
"wp-cli/wp-cli": "^2.12"
13+
},
14+
"require-dev": {
15+
"wp-cli/wp-cli-tests": "^v4.3.6"
16+
},
17+
"config": {
18+
"process-timeout": 7200,
19+
"sort-packages": true,
20+
"allow-plugins": {
21+
"dealerdirect/phpcodesniffer-composer-installer": true,
22+
"php-http/discovery": true
23+
}
24+
},
25+
"extra": {
26+
"branch-alias": {
27+
"dev-master": "2.x-dev"
28+
},
29+
"bundled": false,
30+
"commands": [
31+
"ai",
32+
"ai prompt"
33+
]
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"WP_CLI\\AiCommand\\": "src/",
38+
"WP_CLI\\AiCommand\\MCP\\": "src/MCP"
39+
},
40+
"files": [
41+
"ai-command.php"
42+
]
43+
},
44+
"minimum-stability": "dev",
45+
"prefer-stable": true,
46+
"scripts": {
47+
"behat": "run-behat-tests",
48+
"behat-rerun": "rerun-behat-tests",
49+
"lint": "run-linter-tests",
50+
"phpcs": "run-phpcs-tests",
51+
"phpunit": "run-php-unit-tests",
52+
"prepare-tests": "install-package-tests",
53+
"test": [
54+
"@lint",
55+
"@phpcs",
56+
"@phpunit",
57+
"@behat"
58+
]
59+
},
60+
"support": {
61+
"issues": "https://github.com/swissspidy/ai-command/issues"
62+
}
63+
}

0 commit comments

Comments
 (0)