MCPcopy Index your code
hub / github.com/astracompiler/cli

github.com/astracompiler/cli @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
23 symbols 121 edges 18 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Astra

🚀 Fast, reliable and easy-to-use js-to-exe compiler.

Docs | npm | GitHub

<a href="#"><img alt="NPM Downloads" src="https://img.shields.io/npm/dw/astra-cli?label="></a>
<a href="https://npmjs.com/package/astra-cli"><img alt="NPM Version" src="https://img.shields.io/npm/v/astra-cli?label="></a>
<a href="https://github.com/astracompiler/cli/actions"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/astracompiler/cli/main.yml?label="></a>



<a href="https://app.netlify.com/projects/astra-js/deploys"><img alt="Netlify status" src="https://api.netlify.com/api/v1/badges/1737b126-dce7-4d82-9b76-8743c4ec3b67/deploy-status"/></a>
<a href="https://codecov.io/gh/astracompiler/cli"><img src="https://codecov.io/gh/astracompiler/cli/graph/badge.svg?token=OJVP05V5YB"/></a>
<a href="https://app.codacy.com/gh/astracompiler/cli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/a6cdab2a4e974051890141c53ce8bb58"/></a>
<a href="https://github.com/astracompiler/cli/"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/astracompiler/cli"></a>

Why Astra?

Astra is (probably) the best compiler available on npm.

Average exe is ~70-80MB (depends on your code) so it's lighter than most compilers

Using upx you can go down up to ~30MB

It's aiming to compile servers (express, fastify) or CLIs (commander) so it's not replacement of electron.

For now it only compiles windows applications. (I'm working on macOS and linux)

Features

  • Different than the others - Astra is a new approach to compiling JavaScript/TypeScript applications. It uses a different method than other compilers like pkg or nexe.

  • Compile newest versions of Node.js - Astra supports the latest Node.js versions.

  • Fast build time - Powered by esbuild, Astra ensures the fastest possible compilation speed.

  • Improved support for ECMAScript - Astra supports compiling ESM-based applications, with workarounds for limitations in Node.js SEA.

  • Delightful DX - With signale, inquirer and chalk, Astra provides a great developer experience.

  • Standalone Executable - Generates a single .exe or binary file that includes all dependencies.

  • Make exe your own - Modify metadata (icon, name, version, etc.) of the generated executable.

  • Future-proof - Made with trusted, constantly evolving tools.

Contributing

🤝 I welcome pull requests! Every contribution will be reviewed and appreciated - even small fixes.

Getting Started

Install Astra globally using Yarn or npm:

# npm 
npm i -g astra-cli
# yarn (classic)
yarn global add astra-cli
# pnpm
pnpm add -g astra-cli

# for one project only
# npm
npm i --save-dev astra-cli
# yarn
yarn add --dev astra-cli
# pnpm
pnpm add -D astra-cli

Then, compile your JavaScript/TypeScript project:

astra build src/index.js

For more options, run:

astra --help

How it works?

  1. Code is linted and bundled with esbuild,
  2. Then astra is generating blob which will be injected into node.exe binary,
  3. Next astra is editing metadata of your binary (adding icon, copyright),
  4. And finally postject injects blob into final executable.

License

Astra is licensed under the MIT License.


Made with ❤️ by QwertyCodeQC

Extension points exported contracts — how you extend this code

BuildArgs (Interface)
(no doc)
src/astra.ts
VersionAsset (Interface)
(no doc)
src/build.ts
VersionStringOptions (Interface)
(no doc)
src/types/rcedit.d.ts
Options (Interface)
(no doc)
src/types/rcedit.d.ts
InjectOptions (Interface)
(no doc)
src/types/postject_types.d.ts

Core symbols most depended-on inside this repo

build
called by 7
src/build.ts
nameparse
called by 7
src/helpers/nameparse.ts
generate
called by 5
src/helpers/nameparse.ts
step
called by 4
src/build.ts
isLTS
called by 4
src/helpers/nameparse.ts
install
called by 3
src/install.ts
isWineInstalled
called by 3
src/helpers/iswineinstalled.ts
listOfAvailableVersions
called by 2
src/helpers/cache.ts

Shape

Function 18
Interface 5

Languages

TypeScript100%

Modules by API surface

src/build.ts4 symbols
src/helpers/nameparse.ts3 symbols
src/helpers/cache.ts3 symbols
src/types/rcedit.d.ts2 symbols
src/helpers/shasum.ts2 symbols
src/helpers/rcedit.ts2 symbols
src/versions.ts1 symbols
src/types/postject_types.d.ts1 symbols
src/install.ts1 symbols
src/init.ts1 symbols
src/helpers/iswineinstalled.ts1 symbols
src/helpers/configloader.ts1 symbols

For agents

$ claude mcp add cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact