Download the PHP package rnr1721/codecraft without Composer

On this page you can find all versions of the php package rnr1721/codecraft. 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 codecraft

CodeCraft

PHP Version [Tests]() Latest Version

Universal code generation and manipulation library for modern development

CodeCraft is an experimental, AI-friendly library that provides a unified API for creating, editing, and analyzing code across multiple programming languages. Think of it as the "Swiss Army knife" for code generation - one simple interface for all your code generation needs.

I wouldn't write this library if I didn't want to test these features in my cyclic AI agent that can execute code - https://github.com/rnr1721/depthnet . But I haven't found anything similar that fits. I don't plan to actively develop this library (at the moment), so if someone likes the idea, I'll be happy if this project is continued or a new one is created, I'll gladly use it :)

Features

Supported Languages & Features

Language Classes Functions Components Models Tests Config AST Validation
PHP ✓ Classes, Interfaces, Traits ✓ Methods, Functions ✘ ✘ ✘ ✓ ✓ ✓ php -l
JavaScript ✓ ES6 Classes ✓ Functions, Arrow Functions ✓ React Components ✘ ✘ ✘ ✘ ✓ Syntax
TypeScript ✓ Classes, Generics ✓ Functions, Async ✓ React, Hooks ✓ Api, Clients ✘ ✓ tsconfig ✘ ✓ Syntax
Python ✓ Classes, DataClasses ✓ Functions, Async ✘ ✓ Django, FastAPI ✓ Pytest ✘ ✘ ✓ Syntax
CSS ✘ ✘ ✓ BEM Components ✘ ✘ ✘ ✘ ✓ Syntax
JSON ✘ ✘ ✘ ✘ ✘ ✓ Configs, Package.json ✘ ✓ JSON

Quick Start

Installation

Basic Usage

Factory Pattern Usage

Language-Specific Examples

PHP - Laravel Model (AST-Powered)

Python - FastAPI Application

JavaScript - React Component

CSS - BEM Component

JSON - Package Configuration

Core API Methods

Creating Files

Editing Files

Analysis and Validation

Utility Methods

Advanced Usage

Batch Modifications

JSON Manipulation

AI Integration

CodeCraft is designed to be AI-friendly with simple, predictable behavior:

Creating Custom Adapters

Use Cases

AI Code Generation

Development Tools

Migration & Transformation

Framework Integration

Laravel Integration

Dependency Injection

Testing

Development

Setup

Adding a New Language Adapter

  1. Implement FileAdapterInterface
  2. Add comprehensive help system with examples
  3. Write tests covering all functionality
  4. Update documentation and README
  5. Submit a pull request

Code Quality

Requirements

Dependencies

Optional Dependencies

FAQ

Q: How is CodeCraft different from existing code generators?
A: CodeCraft provides a simple, path-based API that's intuitive for both humans and AI. It focuses on real file operations rather than abstract concepts.

Q: Why path-based instead of type-based?
A: Paths are more intuitive and provide context. app/Models/User.php immediately tells you what type of file it is and where it belongs.

Q: How reliable is the AST-based PHP adapter?
A: Very reliable! It uses nikic/php-parser (the same library used by PHPStan, Psalm, and PHP-CS-Fixer) for accurate PHP code generation and manipulation.

Q: How do I add support for a new language?
A: Implement the FileAdapterInterface and register your adapter. See the "Creating Custom Adapters" section for a complete example.

Q: Is CodeCraft suitable for AI agents?
A: Yes! CodeCraft was designed with AI in mind. The simple, path-based API is easy for AI models to understand and use correctly.

License

CodeCraft is open-sourced software licensed under the MIT license.


All versions of codecraft with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nikic/php-parser Version ^5.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 rnr1721/codecraft contains the following files

Loading the files please wait ...