CodeIgniter 4 Spark

A suite of commands and shortcuts integrated into Visual Studio Code to streamline common CodeIgniter 4 tasks.
Why This Extension?
CodeIgniter 4 Spark automates frequent framework operations (such as cache management, database migrations, and file scaffolding) directly from the editor. By providing Spark commands within VS Code, developers can:
- Execute cache, migration, and configuration commands without leaving the IDE
- Scaffold controllers, models, entities, filters, and more with a single command
- Inspect routes, clear caches, and generate encryption keys instantly
- Reduce context switching and maintain focus on application logic


Requirements
- CodeIgniter 4.3.0 or later
- Visual Studio Code 1.88.0 or later (compatible with VSCodium and other VS Code-based editors)
Installation
- Open Visual Studio Code or a compatible editor.
- Navigate to the Extensions view (
Ctrl+Shift+X on Windows/Linux or ⌘+Shift+X on macOS).
- Search for CodeIgniter 4 Spark or install directly from the Visual Studio Marketplace.
- Click Install and reload the editor when prompted.
Configuration
Add or update the following settings in your project's .vscode/settings.json to tailor file watching and display:
{
"spark.files.include": ["php"], // Extensions to include in the file tree
"spark.files.exclude": [
"**/vendor/**",
"**/.*/**"
], // Paths to exclude
"spark.files.watch": ["helpers"], // Folders to watch for changes
"spark.files.showPath": true // Show the file path
}
Reload the editor to apply configuration changes.
Getting Started
- Open the Command Palette (
Ctrl+Shift+P or ⌘+Shift+P ).
- Type
Spark: to view available commands.
- Select and execute a command such as Spark: Start Server, Spark: Make Controller, or Spark: Migrate.
- For scaffolding commands, follow the prompts to specify names and options; the extension will generate files with appropriate boilerplate.
Available Commands
Command |
Description |
Spark: Start Server |
Launches the development server |
Spark: Clear Cache |
Clears application and system cache |
Spark: Cache Info |
Displays cache statistics |
Spark: List Routes |
Outputs all defined routes |
Spark: Optimize |
Prepares application for production |
Spark: PHP INI Check |
Verifies PHP configuration settings |
Spark: DB Create |
Creates a new database schema |
Spark: Migrate |
Runs all pending migrations |
Spark: Migrate Refresh |
Drops all tables and re-runs all migrations |
Spark: Migrate Rollback |
Rolls back the last batch of migrations |
Spark: Generate Key |
Generates a new encryption key |
Spark: Make Controller |
Generates a controller file with boilerplate |
Spark: Make Model |
Generates a model file with boilerplate |
Spark: Make Entity |
Generates an entity class |
Spark: Make Filter |
Generates a filter class |
Spark: Make Helper |
Generates a helper file |
Spark: Make Migration |
Generates a migration class with timestamp |
Spark: Make Seeder |
Generates a database seeder class |
Spark: Clear Logs |
Deletes all log files |
…and more |
See the Command Palette for a full list |
Contributing
Contributions, issue reports, and feature requests are welcome:
Fork the repository.
Create a branch:
git checkout -b feature/your-feature
Commit your changes and push to your fork.
Open a pull request against the main branch.
Please review the Contribution Guidelines and Code of Conduct before contributing.
Changelog
For a complete list of updates, see CHANGELOG.md.
Authors
For a complete list of contributors, please refer to the contributors page.
Follow Me
- GitHub:

- X (formerly Twitter):

Other Extensions
Auto Barrel
Automatically generates and maintains barrel (index.ts ) files for your TypeScript projects.
Angular File Generator
Generates boilerplate and navigates your Angular (9→20+) project from within the editor, with commands for components, services, directives, modules, pipes, guards, reactive snippets, and JSON2TS transformations.
NestJS File Generator
Simplifies creation of controllers, services, modules, and more for NestJS projects, with custom commands and Swagger snippets.
NestJS Snippets
Ready-to-use code patterns for creating controllers, services, modules, DTOs, filters, interceptors, and more in NestJS.
T3 Stack / NextJS / ReactJS File Generator
Automates file creation (components, pages, hooks, API routes, etc.) in T3 Stack (Next.js, React) projects and can start your dev server from VSCode.
Drizzle ORM Snippets
Collection of code snippets to speed up Drizzle ORM usage, defines schemas, migrations, and common database operations in TypeScript/JavaScript.
CodeIgniter 4 Spark
Scaffolds controllers, models, migrations, libraries, and CLI commands in CodeIgniter 4 projects using Spark, directly from the editor.
CodeIgniter 4 Snippets
Snippets for accelerating development with CodeIgniter 4, including controllers, models, validations, and more.
CodeIgniter 4 Shield Snippets
Snippets tailored to CodeIgniter 4 Shield for faster authentication and security-related code.
Mustache Template Engine - Snippets & Autocomplete
Snippets and autocomplete support for Mustache templates, making HTML templating faster and more reliable.
Recommended Browser Extension
For developers who work with .vsix files for offline installations or distribution, the complementary One-Click VSIX extension is recommended, available for both Chrome and Firefox.
One-Click VSIX integrates a direct "Download Extension" button into each VSCode Marketplace page, ensuring the file is saved with the .vsix extension, even if the server provides a .zip archive. This simplifies the process of installing or sharing extensions offline by eliminating the need for manual file renaming.
License
This project is licensed under the MIT License. See the LICENSE file for full details.
| |