ali

command module
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 1 Imported by: 0

README

ali - your aliases

ali - cli utility for more convenient and quick work with routine teams

Install
go install github.com/algrvvv/ali@latest

# init global config
ali setup
Auto completion
ali completion your_shell > dir/for/completion

# for example
ali completion zsh > ~/tmp/ali
source ~/tmp/ali
# It's better to put this command in your shell configuration, for example ~/.zshrc
Usage

The application has a global configuration and any number of local configurations. To do this, go to the desired directory and use the command: ali init. All local overlapping aliases have an advantage over global ones.

> ali help
    Usage:
      ali [flags]
      ali [command]

    Available Commands:
      completion  Generate completion script
      edit        Edit global or local config
      help        Help about any command
      init        Init new local config
      list        Get list aliases
      setup       Setup global config
      version     See app version and more information

    Flags:
      -D, --debug       print debug messages
      -h, --help        help for ali
      -L, --local-env   use only local env
App configuration

The application configuration is stored in a file with the .toml extension. The aliases section contains a list of the type alias = command and there is also the app section, which contains so far the only setting that is responsible for the default configuration editor.

To edit the global configuration, use: ali edit To edit the local configuration, use: ali edit --local By default, vi opens to edit the configuration.

Example:

[aliases]
# test alias
test = 'echo "hello world"'

[app]
editor = 'vim'
Usage examples

Pass arguments inside a command:

# in configuration
hello = 'echo "hello, <user>"'
ali hello --user=$(whoami)
# equal: echo "hello, $(whoami)"

passing arguments after the command:

# in configuration
gl = 'git log -n '
ali gl 3
# equal: git log -n 3
Multiple commands

Multiple commands are commands that will be executed in parallel in a single terminal session.

Configuration example:

[[parallel.lara]]
# name of command
label='Laravel'
# color of the label in logs
color='red'
# command for execute
command='php artisan serve'
# work directory
path='.'

[[parallel.lara]]
label='Vue'
color='green'
command='npm run dev'
path='.'

To run parallel commands, use ali CommandName -p or ali commandName --parallel

There are also additional settings for parallel commands. For example, the --without-output flag to disable command output. It is also possible to change the output color by using flag --output-color.

Available colors:

  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • gray
  • orange
  • pink
  • lime
  • white

At the moment, these commands will only be displayed in the list using the-f flag.

Additionally

To get logs, use --debug or -D

To use only local aliases, use -L or --local-env. This can be useful when using ali list -L to output only a list of local aliases.

Documentation

Overview

Copyright © 2024 algrvvv <alexandrgr25@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL