Skip to main content

A lightweight DSL for scaffolding files and folders

Project description

🧱 Bytecraft

A human-readable DSL for scaffolding files and folders.

pip install bytecraft

Bytecraft lets you describe a project structure in plain, readable instructions and execute it with a single command — no Bash, no Python boilerplate, no mental overhead.

# bootstrap.bc

set-working-folder "my-app"

make-folder "src"
make-folder "src/utils"
make-folder "assets"

make-file "README.md" with "# my-app"
make-file "src/main.py" with "print('Hello, World!')"
make-file "src/utils/helper.py"
py -m bytecraft bootstrap.bc
[Bytecraft] Working folder set: my-app
[Bytecraft] Created folder: my-app/src
[Bytecraft] Created folder: my-app/src/utils
[Bytecraft] Created folder: my-app/assets
[Bytecraft] Created file: my-app/README.md
[Bytecraft] Created file: my-app/src/main.py
[Bytecraft] Created file: my-app/src/utils/helper.py

Installation

Requires Python 3.10+

pip install bytecraft

Commands

set-working-folder

Sets the base directory for all subsequent relative paths. Created automatically if it doesn't exist.

set-working-folder "my-project"

make-folder

Creates a directory and any missing parent directories. Does nothing if the folder already exists.

make-folder "src/utils"

make-file

Creates a file. Parent directories are created automatically. Overwrites if the file already exists.

# Empty file
make-file "src/__init__.py"

# With inline content
make-file "VERSION" with "1.0.0"

# With a multi-line block
make-file "README.md" with ---
# My Project

Some description here.
---

copy-file

Copies a file or folder to a new location. Parent directories are created automatically. If the destination folder already exists it will be overwritten.

# Copy a file
copy-file "src/app.py" to "backup/app.py"

# Copy an entire folder
copy-file "src" to "src_backup"

move-file

Moves a file or folder to a new location. Parent directories are created automatically.

# Move a file
move-file "build/output.js" to "dist/app.js"

# Move a folder
move-file "temp" to "archive/temp"

make-zip

Creates a zip archive from a file or folder. The folder structure is preserved inside the zip.

# Zip a folder
make-zip "releases/v1.0.zip" from "dist"

# Zip a single file
make-zip "releases/app.zip" from "dist/app.py"

set

Defines a variable. Variables can be referenced anywhere using {{name}} syntax.

set project "my-app"
set version "1.0.0"

make-file "VERSION" with "{{version}}"
make-file "src/main.py" with "# {{project}} v{{version}}"

Variables also interpolate inside multi-line blocks:

set author "Sourasish Das"

make-file "README.md" with ---
# {{project}}

Maintained by {{author}}.
---

Comments

Lines starting with # are ignored.

# This is a comment

Forgiving Syntax

Bytecraft is intentionally forgiving. Quotes are optional — if they're missing, Bytecraft will try to recover and interpret your intent:

make-file hello.txt with Hello World

is treated the same as:

make-file "hello.txt" with "Hello World"

Unknown commands print a warning and are skipped rather than crashing the whole script.


Full Example

# Project scaffold + release build

set project "dashboard"
set author "Sourasish Das"
set version "1.0.0"

set-working-folder "{{project}}"

make-folder "src"
make-folder "src/components"
make-folder "src/utils"
make-folder "tests"
make-folder "dist"

make-file "VERSION" with "{{version}}"

make-file "src/main.py" with "# Entry point for {{project}}"

make-file "README.md" with ---
# {{project}}

Version: {{version}}
Author: {{author}}
---

make-file "tests/test_main.py" with ---
import unittest

class TestMain(unittest.TestCase):
    def test_placeholder(self):
        self.assertTrue(True)
---

# Copy built output and package a release
copy-file "src" to "dist/src"
make-zip "releases/{{project}}-{{version}}.zip" from "dist"

Limitations (v0.1.3)

  • No loops or conditionals
  • No append mode
  • No imports or includes
  • No strict mode

These are planned for future versions.


Roadmap

  • Variables and interpolation
  • Multi-line file content blocks
  • copy-file and move-file
  • make-zip
  • append-file command
  • Loops and conditionals
  • Strict mode
  • Import / include system
  • Template support

License

Server-Lab Open-Control License (SOCL) 1.0
Copyright (c) 2025 Sourasish Das

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bytecraft-0.1.3.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bytecraft-0.1.3-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file bytecraft-0.1.3.tar.gz.

File metadata

  • Download URL: bytecraft-0.1.3.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for bytecraft-0.1.3.tar.gz
Algorithm Hash digest
SHA256 dfc34ac5ce41bae5338bd45e4e612183ede8e3f698c80867537893788388e0ce
MD5 5b11ca994048d14b1ef0d46f16776854
BLAKE2b-256 dc1409a9bcecb3fd73c06297a0f5b9c3b50a312e03598d58133a34415f4157ad

See more details on using hashes here.

File details

Details for the file bytecraft-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bytecraft-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for bytecraft-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2300a9dbb38dd616e11ba89654cee4b63f78697016c8ebfbbecb41ffd7b3b16c
MD5 e51832d6f946a4de43ca286a00112eeb
BLAKE2b-256 d3f49da267503445369674265479db1f3911ae747b70c5dc7941c29b78bd0009

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page