Back to blog

Monday, October 28, 2024

Welcome to c0nfig.

cover

Welcome to c0nfig: Simplify Your Project Configuration Workflow

We are thrilled to introduce c0nfig, a powerful Command-Line Interface (CLI) tool designed to revolutionize the way you create and manage project configurations. If you've ever felt bogged down by repetitive setup tasks or wished for a more efficient way to share configurations across projects, c0nfig is here to streamline your workflow. c0nfig is heavily inspired by Shadcn's CLI approach. This method strikes the perfect balance between customizability and efficiency, giving you full control over your codebase while saving valuable time.

Benefits of c0nfig

  1. Efficiency and Time Savings: Automate repetitive setup tasks, significantly reducing the time and effort required to configure new projects or integrate tools like Drizzle ORM schemas and authentication methods.
  2. Remote Execution of Configurations: Execute configurations hosted remotely, ensuring all users have access to the latest updates without needing to manually download or install new scripts. This simplifies distribution and maintenance, allowing for centralized management of configurations that can be instantly propagated to all projects and team members.
  3. Consistency Across Projects: Ensure all your projects adhere to the same configurations and standards, minimizing discrepancies and potential errors caused by manual setups. This fosters a uniform development environment and facilitates easier collaboration and maintenance across different projects and teams.
  4. More flexible than templates: Typical project templates comes with a standard web framework libraries, this could be limiting for your use cases. c0nfig can help to bridge this gap by providing interfaces that facilitates a more flexisible setup.

Why Use c0nfig?

c0nfig helps you if you are a:

  • Maintainer of a JavaScript library who wants to provide users with an easy setup tool so they can integrate your library into their projects effortlessly.
  • JavaScript/Typescript developer who frequently sets up configurations like Drizzle ORM database schemas, various authentication methods, middlewares and wants to automate these repetitive tasks.
  • Developers who often starts new projects on different web frameworks and wants to quickly scaffold applications with predefined structures, dependencies, and configurations to save time.
  • Web Development Agency which often has a predefined project configurations that you would like to setup.

How Does It Work?

how to works

At its core, c0nfig manages the CLI, and you provide the configurations. By executing remote configurations, c0nfig simplifies distribution and updates, ensuring all users have access to the latest configurations without the need for manual CLI tool updates. Updating configurations or assets is as straightforward as updating the files on your server.

Quick Start Guide

Ready to dive in? Let's walk through a simple example of how to use c0nfig to add a file to your project.

Step 1: Create a JSON Configuration File

Start by creating a JSON file and include the c0nfig schema for validation:

{
  "$schema": "https://c0nfig.vercel.app/cli/schema.json",
  "title": "Simple Copy CLI",
  "description": "Add card component into the project",
  "version": 2.0,
  "operation": [
    {
      "op": "add",
      "content": "import * as React from \"react\";\n\n// Your component code here\n\nexport default Card;",
      "targetSrc": "./card.tsx"
    }
  ]
}
  • $schema: Validates your configuration against the c0nfig schema.
  • title and description: Provide metadata for your command.
  • operation: Defines the actions c0nfig CLI will perform.

Step 2: Host the Configuration File

Place the JSON file in your project's public folder so it can be accessed via a URL:

├── public/
│   └── add-card.json

If your development server is running, you should be able to access it at:

http://localhost:[PORT_NUMBER]/add-card.json

Step 3: Initialise c0nfig

npx k0nfig@latest init

Step 4: Run the c0nfig Command

Use the c0nfig CLI to execute the configuration:

npx k0nfig@latest run http://localhost:[PORT_NUMBER]/add-card.json

After running the command, you should see the new file (card.tsx) added to your project.

Join the c0nfig Community

We invite you to try out c0nfig and see how it can enhance your development workflow. Whether you're a solo developer or part of a large team, c0nfig is designed to make our life easier.

Get Involved

  • Documentation: Explore detailed guides and API references in our documentation.
  • GitHub Repository: Contribute to the project, report issues, or request features on GitHub
  • Community Forum: Join discussions, share ideas, and connect with other developers in our Community Forum

c0nfig aims to simplify the process of creating reusable project configurations by offering a flexible, efficient, and customizable solution. By automating mundane setup tasks, c0nfig lets you focus on what truly matters—building amazing software.

We're excited to see how you'll use c0nfig to streamline your projects. Your feedback is invaluable to us, so don't hesitate to share your thoughts and experiences.