Documentation
Everything you need to integrate TailwindPHP into your development workflow. From quick start guides to full API reference.
Quick Start
Get up and running with TailwindPHP in under 2 minutes. Three simple steps to supercharge your coding workflow.
1
Install Extension
Install TailwindPHP from your IDE's marketplace or via the CLI tool.
2
Configure
Add your API key and configure your preferred language and framework settings.
3
Start Coding
Write a comment describing what you need. TailwindPHP generates the code instantly.
# Install via Composer
composer require tailwindphp/ai
# Or install the VS Code extension
code --install-extension tailwindphp.ai-assistant
# Configure your API key
tailwindphp config --key YOUR_API_KEY
Installation
TailwindPHP supports multiple editors and environments. Choose the installation method that fits your workflow.
VS Code
Install directly from the VS Code Marketplace or via the command line:
code --install-extension tailwindphp.ai-assistant
JetBrains (PhpStorm, IntelliJ, WebStorm)
Available via the JetBrains Plugin Marketplace. Search for "TailwindPHP" or install via CLI:
# PhpStorm / IntelliJ
jetbrains install-plugin tailwindphp-ai
Neovim
Install via your preferred plugin manager:
-- Using lazy.nvim
{
"tailwindphp/nvim-ai",
config = function()
require("tailwindphp").setup({
api_key = os.getenv("TAILWINDPHP_KEY"),
model = "v3-turbo",
})
end,
}
CLI Tool
Use TailwindPHP directly from your terminal for scripts, CI/CD pipelines, and automation:
npm install -g @tailwindphp/cli
# Generate code from a prompt
tailwindphp generate "Create a Laravel REST controller for products"
# Review a file for bugs
tailwindphp review src/Controllers/ProductController.php
Configuration
Create a .tailwindphp.json file in your project root to customize behavior:
{
"apiKey": "your-api-key",
"model": "v3-turbo",
"language": "php",
"framework": "laravel",
"contextDepth": 5,
"autoComplete": true,
"testFramework": "phpunit",
"excludePaths": ["vendor/", "node_modules/"]
}
API Reference
The TailwindPHP API uses REST endpoints. All requests require an Authorization: Bearer YOUR_API_KEY header. Base URL: https://api.tailwindphp.net/v3
POST /complete
POST
/v3/complete
Returns code completions based on the current cursor context. Supports multi-file context for accurate suggestions.
{
"file": "app/Http/Controllers/UserController.php",
"position": { "line": 24, "column": 8 },
"context": {
"before": "public function store(Request $request) {\n ",
"after": "\n}"
},
"relatedFiles": ["app/Models/User.php", "routes/api.php"],
"maxTokens": 256
}
POST /generate
POST
/v3/generate
Generates full code files, functions, or classes from a natural language description. The most powerful endpoint for code scaffolding.
{
"prompt": "Create a Laravel FormRequest for user registration with email, name, and password validation",
"language": "php",
"framework": "laravel",
"style": "psr-12"
}
POST /review
POST
/v3/review
Analyzes code for bugs, security vulnerabilities, performance issues, and style inconsistencies. Returns actionable suggestions with severity levels.
{
"code": "$user = DB::select('SELECT * FROM users WHERE id = ' . $id);",
"language": "php",
"checks": ["security", "performance", "style"]
}
GET /suggestions
GET
/v3/suggestions?file={path}&scope={function|class|file}
Returns improvement suggestions for a given file or scope. Useful for continuous code quality monitoring in CI/CD pipelines.
Code Examples
Real-world examples showing TailwindPHP in action across different languages and frameworks.
PHP — Laravel Controller with AI Generation
<?php
namespace App\Http\Controllers;
use App\Models\Product;
use App\Http\Requests\StoreProductRequest;
use Illuminate\Http\JsonResponse;
// Generated by TailwindPHP from prompt:
// "REST controller for products with pagination and filtering"
class ProductController extends Controller
{
public function index(Request $request): JsonResponse
{
$products = Product::query()
->when($request->get('category'), fn($q, $cat) =>
$q->where('category_id', $cat)
)
->when($request->get('search'), fn($q, $s) =>
$q->where('name', 'like', "%{$s}%")
)
->paginate($request->get('per_page', 15));
return response()->json($products);
}
public function store(StoreProductRequest $request): JsonResponse
{
$product = Product::create($request->validated());
return response()->json($product, 201);
}
}
TypeScript — Express Middleware with AI Generation
// Generated by TailwindPHP from prompt:
// "Rate limiting middleware with Redis backing store"
import { Request, Response, NextFunction } from 'express';
import { createClient } from 'redis';
interface RateLimitConfig {
windowMs: number;
maxRequests: number;
keyPrefix: string;
}
export function rateLimit(config: RateLimitConfig) {
const redis = createClient();
return async (req: Request, res: Response, next: NextFunction) => {
const key = `${config.keyPrefix}:${req.ip}`;
const current = await redis.incr(key);
if (current === 1) {
await redis.pExpire(key, config.windowMs);
}
if (current > config.maxRequests) {
return res.status(429).json({
error: 'Rate limit exceeded',
retryAfter: await redis.pTTL(key),
});
}
next();
};
}
SDKs & Libraries
Official SDKs for the most popular languages. All open source and maintained by the TailwindPHP team.
🐞
PHP SDK
Composer package for PHP 8.1+
composer require tailwindphp/sdk
🔷
Node.js SDK
NPM package for Node 18+
npm install @tailwindphp/sdk
🐍
Python SDK
PyPI package for Python 3.9+
pip install tailwindphp
Support
Need help? We're here for you. Choose the support channel that works best for your needs.
💬 Community Discord
Join 12,000+ developers in our Discord community. Get help from maintainers and fellow developers in real time.
📚 GitHub Discussions
Ask questions, share ideas, and browse solutions from the community. Best for detailed technical questions.
📧 Priority Email
Pro and Team plan subscribers get priority email support with guaranteed response times under 4 hours.
🎓 Office Hours
Weekly live sessions with the core team. Bring your questions, demos, and feature requests. Every Thursday at 2pm UTC.