Skip to content

Rust based CLI tool to add aliases for commands to simplify developer workflow

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

ehuff700/cmdlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmdlink

cmdlink is a cross-platform command-line application built with Rust that allows you to create and manage aliases for system commands. These aliases are saved in a configuration file and linked to scripts in the bins directory. This tool is designed to streamline command management and improve command-line efficiency.

Features

  • Add Aliases: Create new command aliases with custom descriptions.
  • Remove Aliases: Easily delete aliases and their associated binaries.
  • Display Aliases: View all active aliases and their descriptions.

Installation

  1. Clone the repository:
    git clone https://github.com/ehuff700/cmdlink.git
    cd cmdlink
  2. Build the application using Cargo. During the build process, cmdlink will setup all necessary directories:
    cargo build --release
  3. Run the application by navigating to the build directory:
    ./target/release/cmdlink

Or, optionally, if you prefer not to build from source:

cargo install cmdlink

Usage

Run cmdlink with the following commands to manage your aliases:

Add a New Alias

cmdlink add <alias> -c <command> [--desc <description>] [--force]

Arguments:

<alias>: The name of the alias you wish to create.
--cmd <command>: The command that the alias will execute.
--desc <description> (optional): A short description of the alias.
--force (optional): Forces the alias creation if it already exists.

Example:

cmdlink add myalias --cmd "echo Hello, World!" --desc "Prints a greeting" --force

Remove an Alias

Removes an existing alias and its binary link.

cmdlink remove <alias>

Arguments:

<alias>: The name of the alias you wish to remove.

Example:

cmdlink remove myalias

Display All Aliases

Displays all existing aliases along with their descriptions.

cmdlink display

Refresh Links

Refreshes all alias links based on the configuration file, updating binaries in the bins directory.

cmdlink refresh

View the --help function to see additional information for each subcommand.

Configuration

Aliases are saved in a configuration file (config.toml) located in the project directory. The structure of this file is as follows:

[aliases]
myalias = { cmd = "echo Hello, World!", description = "Prints a greeting" }
another_alias = { cmd = "ls -la", description = "Lists all files in long format" }

The cmdlink application reads from this file and creates binary links in the bins directory based on the commands specified for each alias.

You should not manually edit this file, but if you do, run cmdlink refresh to save your changes to the bin files.

Directory Structure

config.toml: Stores alias names, commands, and descriptions.
bins/: Contains the binary files linked to each alias. These binaries are generated by cmdlink when an alias is added or refreshed.

License

This project is licensed under either of

at your option.

About

Rust based CLI tool to add aliases for commands to simplify developer workflow

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages