Skip to content

codefromthecrypt/cli

Repository files navigation

Apex

noun

1. the top or highest part of something

language

2. a top-down / API-first description language for modeling and generating cloud-native applications

Goals:

  • Approachable
  • Protocol agnostic
  • Extensible

Problem

TODO

Solution

TODO

Overview

TODO

Installation

Windows

powershell -Command "iwr -useb https://raw.githubusercontent.com/apexlang/cli/main/install/install.ps1 | iex"

MacOS

curl -fsSL https://raw.githubusercontent.com/apexlang/cli/main/install/install.sh | /bin/bash

Linux

wget -q https://raw.githubusercontent.com/apexlang/cli/main/install/install.sh -O - | /bin/bash

Homebrew

brew install apexlang/tap/apex

Building a Module

TODO

Development

Prerequisites

Verify you have Go 1.17+ installed

go version

If Go is not installed, download and install Go 1.17+ (brew installation is not recommended because of CGO linker warnings)

Clone the project from github

git clone https://github.com/apexlang/apex.git
cd cli
go install ./cmd/...

Compiling on Windows

In order to build a project using v8go on Windows, Go requires a gcc compiler to be installed.

To set this up:

  1. Install MSYS2 (https://www.msys2.org/)
  2. Add the Mingw-w64 bin to your PATH environment variable (C:\msys64\mingw64\bin by default)
  3. Open MSYS2 MSYS and execute pacman -S mingw-w64-x86_64-toolchain

V8 requires 64-bit on Windows, therefore it will not work on 32-bit systems.

Confirm apex runs (The Go installation should add ~/go/bin in your PATH)

apex --help

Output:

Usage: apex <command>

Flags:
  -h, --help    Show context-sensitive help.

Commands:
  install <location> [<release>]
    Install a module.

  generate [<config>]
    Generate code from a configuration file.

  watch [<configs> ...]
    Watch configuration files for changes and trigger code generation.

  new <template> <dir> [<variables> ...]
    Creates a new project from a template.

  init <template> [<variables> ...]
    Initializes an existing project directory from a template.

  upgrade
    Upgrades to the latest base modules dependencies.

  version

Run "apex <command> --help" for more information on a command.

Built With

  • esbuild - An extremely fast JavaScript bundler written in Go that is used to compile the code generation TypeScript modules into JavaScript that can run natively in V8.
  • v8go and V8 - Execute JavaScript from Go
  • kong - A very simple and easy to use command-line parser for Go
  • The Go 1.16 embed package - Finally embedding files is built into the Go toolchain!

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details

About

Command line tool for generating code for cloud-native applications

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •