Giter Site home page Giter Site logo

alfalab-cli's Introduction

magic-cli

A foundation for building your own suite of command line tools.

magic-cli exists to make it easy to create a set of tools that work together. It's not a tool you use as-is; it's here to offer a starting point for your own custom command line tools.

Learn more about the origins of magic-cli in The Joy of Internal Tools, a post on the Slack Engineering blog.

Customization

Rename the magic-cli script to whatever you want โ€” for example, if you happen to work for example.com, you might rename it to example. (If you want to keep any of the example commands that come with it, rename them to have that new name as a prefix โ€” for example, rename magic-cli-update to example-update.)

Now, when you run example, it will look for executables in the same directory as itself which have filenames that begin with example-. If there's an executable called example-build, you could run it by typing example build.

Now, when you type example, you'll see example build in the list of supported subcommands. For extra credit, you can add a human-readable description in that list by putting a comment immediately under the #! line:

#!/usr/bin/env bash
# This line will be shown in the list of commands.

Installation

This repository includes a Makefile that will install magic-cli and all of its subcommands into /usr/local/bin:

$ make install

You can also use it to uninstall magic-cli:

$ make uninstall

If you rename magic-cli to something different, change the value of PREFIX in the Makefile.

Updates

An example script for updating the tools is also included; it makes installing the latest tools into a single step process:

$ magic-cli update
Updated tools to 01ec2ef (2016-03-30 16:20:30 -0700)

magic-cli-update provides a starting point for you to use for your own updater. If you're hosting your tools in a git repository, customizing this script just entails modifying the SOURCE_REPO constant at the top of the file. If your needs are more complex, you can replace the fetch_latest_code! and get_version_info methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.