Skip to content

liad07/ducky-script-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ducky IDE

A modern IDE for Ducky Script with a built-in AI agent, syntax highlighting, integrated terminal, and a Cursor-style chat experience — all wrapped in an IntelliJ-inspired layout.

Compiles .ds scripts and executes them on the host via PyAutoGUI, so it's intended for security research, automation, and educational use.


Highlights

  • Multi-tab editor with line gutter, syntax highlighting, autocomplete, and problem markers.
  • Project explorer with IntelliJ-style colored icons per file type and an open/closed-folder visual.
  • Built-in AI agent powered by Google Gemini, with four modes (Agent, Ask, Plan, Ducky), streaming responses, tool calling, slash commands (/run /fix /explain /improve …), and @file mentions.
  • IntelliJ-style chrome: custom dark title bar, top menu bar, main toolbar, breadcrumb navigation, collapsible left/right/bottom tool windows, and an enhanced status bar.
  • Cursor-style power moves: Ctrl+K inline AI edit, Ctrl+L focus chat, Ctrl+P quick-open, Ctrl+Shift+P command palette, Shift+Shift search-everywhere.
  • Find & replace (Ctrl+F / Ctrl+H) with regex, case-sensitive, live match counter, and replace-all.
  • Recent files menu + welcome panel — instantly jump back to your last scripts.
  • Save All (Ctrl+Alt+S), Ctrl+Tab cycles tabs, dot indicator on unsaved tabs, and a save-prompt when quitting with dirty files.
  • Beefier Ducky linter — flags very long DELAY, very fast DELAY, oversized REPEAT, REPEAT 0, empty STRING, dangling REPEAT/ENDREPEAT, and unknown commands.
  • Run controller: live progress, line counter, stop/cancel, console log, and problems panel.
  • Performance-aware: debounced UI events, cached file index, incremental syntax highlighting, bounded chat memory.
  • Single-file Windows EXE via the bundled build.py (PyInstaller).

Project layout

ducky/
├── core/        Palette, Settings, EnvLoader, FileIndex, Debouncer
├── runner/      CommandRegistry, Interpreter, RunController
├── editor/      Document, LineGutter, SyntaxHighlighter, AutoComplete,
│                ProblemsPanel, ConsolePanel
├── ai/          ModeRegistry, SlashCommands, ToolExecutor, GeminiAgent,
│                AIAgentPanel + ChatCompletionPopup
└── ui/          Buttons, Toolbar, TabBar, Explorer, Terminal, TitleBar,
                 MenuBar, NavBar, ToolStrip, Fuzzy, InlinePrompt, StatusBar,
                 WelcomePanel, FileIconRegistry
app.py           Entry point — wires everything together.
compiler.py      Standalone CLI compiler/runner.
example.ds       Sample Ducky script.
build.py         PyInstaller wrapper that produces dist/Ducky.exe.
requirements.txt
.env             (optional) GEMINI_API_KEY=…

Install

python -m venv .venv
.\.venv\Scripts\activate     # Windows
pip install -r requirements.txt

Run

python app.py

AI setup

Create a .env in the repo root:

GEMINI_API_KEY=your_api_key_here

Or click the ⚙ icon in the AI panel header to paste it via a themed dialog. Get a free key at https://aistudio.google.com/apikey.

Build a Windows EXE

python build.py

The executable is written to dist/Ducky.exe. Useful flags:

python build.py --debug    # keep the console window for tracing
python build.py --clean    # wipe build/ and dist/ first

Keyboard shortcuts

Action Shortcut
New file Ctrl+N
Open file Ctrl+O
Save Ctrl+S
Save All Ctrl+Alt+S
Close tab Ctrl+W
Next / previous tab Ctrl+Tab / Ctrl+Shift+Tab
Run script Ctrl+Enter
Stop script toolbar Stop
Find Ctrl+F
Find & replace Ctrl+H
Autocomplete Ctrl+Space
Quick open Ctrl+P
Command palette Ctrl+Shift+P
Search everywhere Shift+Shift
Inline AI edit Ctrl+K
Focus AI chat Ctrl+L
Project window Alt+1
Console window Alt+4
Problems window Alt+6
AI assistant Alt+9
Terminal Alt+F12

In the AI chat

Trigger Effect
/ Slash-command completion
@ File-mention completion
Enter Send
Shift+Enter Newline

Built-in slash commands: /clear /run /stop /status /explain /fix /improve /doc /plan /ask /agent /help.


Ducky Script support

The interpreter implements the standard Ducky Script command set:

  • Press: GUI, WINDOWS, ALT, CTRL, CONTROL, SHIFT, ENTER, TAB, ESCAPE, MENU, INSERT, HOME, END, PAGEUP, PAGEDOWN, DELETE, UP/DOWN/LEFT/RIGHT, F1F12, CAPSLOCK, NUMLOCK, SCROLLLOCK.
  • Compose: GUI r, CTRL ALT DEL, etc.
  • Text: STRING <text>.
  • Timing: DELAY <ms>, DEFAULTDELAY <ms>, DEFAULT_DELAY <ms>.
  • Flow: REPEAT <n> (repeats the previous line/block), REM … (comment).

example.ds ships a tiny demo.


Roadmap / suggested additions

These are the next features worth building:

  1. Project-wide content search (Ctrl+Shift+F) — search file contents across the workspace (today's Search Everywhere is name + command only).
  2. Git integration — file-status badges in the tree (M / A / D), and a thin gutter strip showing diff hunks.
  3. Code folding for REPEAT blocks and large REM comment regions.
  4. Snippets — user-defined boilerplate (e.g. payload-win, recon).
  5. Bracket / pair highlighting and matching jump (Ctrl+]).
  6. Multi-cursor / column selection (Alt+Click).
  7. Theme toggle (light/dark) — Palette already lives in one place.
  8. Settings dialog — a UI on top of the existing Settings JSON.
  9. Auto-save with file-modified-on-disk reload detection.
  10. Real script preview in the run panel — show what keystrokes are about to be replayed without actually replaying them.
  11. Plugin system for custom Ducky commands (register from Python).
  12. Per-file run profiles — different target OS, default delays.

License

MIT — see LICENSE.

Built with Tkinter, ttkthemes, PyAutoGUI, and the Google Gemini API.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages