aux4 docs
What's aux4?
aux4 is an Open Source CLI (Command-line Interface) generator, used to create high-level scripts and automate your daily tasks. It generates a CLI tool in runtime by parsing a JSON file called .aux4 in your current (or parent) folder.
The name aux4 is an abbreviation of auxiliary for. So when you combine it with the name of your command, you can read it as auxiliary for git or auxiliary for pipeline, etc. The idea is to build a tool to help you do something else.
Install
1> curl https://aux4.sh | shSee Installation for more options including Docker.
IDEs
aux4 has editor plugins for Visual Studio Code and Vim/Neovim. See the IDEs page for setup instructions.
Getting Started
The best way to start learning aux4 is our Getting Started section, please check it out if you haven't already.
The .aux4 file
The .aux4 file has the structure and definition of your command-line interface (CLI) tool.
It is a hidden file (that's why it starts with a dot) to avoid disturbing your environment. For example, if you run the ls command, it won't list that file. This allows you to iterate over the directory's files without interference.
This file uses JSON format, and it's primarily defined by an array of profiles.
1{
2 "profiles": [
3 ...
4 ]
5}Profile
A profile is a group of commands. It's easier for the user of your CLI tool if you have your commands grouped (or organized) by category so they can easily navigate through them.
When you run the aux4 command, the first thing it will do is list the commands from the main profile.
1{
2 "profiles": [
3 {
4 "name": "main",
5 "commands": [
6 ...
7 ]
8 }
9 ]
10}Command
The command is what the user will execute in the prompt. The command has a name (line 7), a sequence of command-line instructions to be executed (lines 8-10), and a help section describing how it works (lines 11-13).
1{
2 "profiles": [
3 {
4 "name": "main",
5 "commands": [
6 {
7 "name": "hello",
8 "execute": [
9 "echo 'Hello World'"
10 ],
11 "help": {
12 "text": "say hello"
13 }
14 }
15 ]
16 }
17 ]
18}When you run aux4 it lists all the commands from the main profile.
1> aux41hello
2say helloTo run your command you can just run aux4 <COMMAND>.
1> aux4 hello1Hello WorldLearn More
- Getting Started - Step-by-step tutorials to get up and running
- Installation - Install aux4 via curl, Homebrew, Docker, or pkgx
- IDEs - Editor plugins for VS Code and Vim/Neovim
- Variables - Parameters, prompts, defaults, environment variables, and more
- Executors - All available executors (set, log, json, each, profile, etc.)
- Functions - Built-in functions for formatting variables (param, values, object, arg, args)
- Configuration - Load variables from YAML/JSON configuration files
- Commands - Built-in commands (version, man, source, which, shell, completion)
- Hooks - Cross-cutting interceptors that run before, after, or on error of any command
- Render - Format command output as a list, table, or other human-friendly view
- Testing - Write and run tests for your aux4 commands
- Package Manager - Install, manage, and publish packages with pkger
- Packaging - Package and distribute your CLI tools through the aux4 Hub
- Docker - Run aux4 in Docker containers