Search…
DCli Compile
The compile command will compile your DCli script(s) into a native executable and optionally install it into your PATH.
The resulting native application can be copied to any binary compatible OS and run without requiring Dart or DCli to be installed.
Dart complied applications are also super fast.
Usage: dcli compile [-nc, -i, -o] [<script path.dart>, <script path.dart>,...]
Example:
Linux
OSx
Windows
1
dcli compile hello_world.dart
2
3
./hello_world
Copied!
1
dcli compile hello_world.dart
2
3
./hello_world
Copied!
1
dcli compile hello_world.dart
2
3
hello_world.exe
Copied!
You may specify one or more scripts and dcli will compile each of them.
If you don't specify any scripts then dcli will compile all scripts in the current directory.
If you use the --install option the compiled exe will be added to your path.
DCli copies the executable into ~/.dcli/bin which is added to your path when you run dcli install.
Linux
1
dcli compile --install hello_world.dart
2
3
hello_world
Copied!

Flags:

--noprepare | -nc :

stop dcli from running prepare before doing a compile. Use this option if you know that you script's dependencies haven't change since the last compile resulting in a faster compile.

--install | -i :

install the compiled script into the ~/.dcli/bin directory which is on your path. -

-overwrite | -o :

if the target script has already been compiled and installed, you must specify the -o flag to allow dcli to overwrite it.
Last modified 1mo ago