Metadata-Version: 2.4
Name: duckymorph
Version: 0.1.0
Summary: DuckyScript compiler that transpiles payloads into multiple targets such as Arduino and Python.
Author-email: 0xlava <0xlava101@proton.me>
License-Expression: MIT
Project-URL: Homepage, https://github.com/0xLava101/duckymorph
Project-URL: Repository, https://github.com/0xLava101/duckymorph
Project-URL: Documentation, https://0xlava.gitbook.io/ducky-morph
Keywords: ducky,duckyscript,ducky script,compiler,transpiler,payload generation,arduino,hid injection,keystroke injection
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer~=0.25.1
Requires-Dist: rich~=15.0.0
Requires-Dist: pyperclip~=1.11.0
Dynamic: license-file

# Duckymorph

DuckyScript transpiler framework — transpiles DuckyScript payloads into multiple targets (Arduino, Python, etc.).

Status: Prototype. This project provides a parser, generator scaffold, and a CLI for experimenting with DuckyScript transpilation. 

[documentation](https://0xlava.gitbook.io/ducky-morph)

## Features

- Parse DuckyScript into an AST
- Pluggable code generators (Arduino included as example)
- CLI for parsing, listing transpilers, and generating target code

## Quickstart

Clone and install locally:

```bash
git clone https://github.com/0xLava101/duckymorph.git
cd duckymorph
pip install -e .
````

install with pip : 

```bash
pip install duckymorph
```


> Note: Package metadata is defined in `pyproject.toml`. You can also run the CLI directly from source during development.

## CLI Usage

The project exposes a Typer-based CLI:

* Show help:

```bash
duckymorph --help
```

* Parse a DuckyScript file to an AST:

```bash
duckymorph parse path/to/payload.ds
```

* List available transpilers:

```bash
duckymorph transpilers
```

* Generate code using a transpiler (example: Arduino):

```bash
duckymorph generate path/to/payload.ds --transpiler arduino --output out.ino
```

Use `--cp` to copy generated code to clipboard (requires `pyperclip`).

## Programmatic Usage

You can use the library from Python:

```py
from duckymorph.core.ducky_parser import DuckyParser
from duckymorph.core.code_generators.factory import CodeGeneratorsFactory

parser = DuckyParser()
parser.parse("REM Example\nSTRING Hello World")
ast = parser.get_ast()

generator = CodeGeneratorsFactory.get_generator("arduino")
code = generator.generate_code(ast)

print(code)
```

> Note: The public API is still evolving and may change during the prototype stage.

## Contributing

Thanks for your interest in contributing. This project is intentionally minimal at this stage. You can help by:

* Improving the parser (lexer/tokenizer, source tracking)

* Writing unit and integration tests (pytest)
* Designing a stable generator interface + templates

## Security & Safety

Generators are executed as Python code and run with the same privileges as the process. Do not load or execute untrusted third-party generators.


## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact

Repository: [https://github.com/0xLava101/duckymorph](https://github.com/0xLava101/duckymorph)
