Code Monkey home page Code Monkey logo

script-manager's Introduction

Script-Manager

Release License Build Status

About

A tool for organizing and managing utility scripts. Allows for easy storage, searching, and executing of small scripts.

This project is not often updated, but is still maintained.

Usage

For the full usage information read the included man page (sm.1).

Scripts can be added with:

sm -a script_name -f file_to_add -D "A helpful description for the file."

This will create a copy of the script file in .script-db/ in your home directory as well as store the name and description information in an SQLite database in that directory.

You can then execute the script via sm -e script_name. Arguments can be passed to the script by adding -A argument for each argument to pass to the script.

To replace the file use:

sm -r script_name -f new_file

This will replace the script file associated with the name script_name with the file new_file.

Remove scripts from Script Manager with:

sm -d script_name

You can search for scripts using:

sm -s -n test -D "some description"

You can search by either name or description or both. If you search for both, then both must contain the search text.

The output of search looks like this:

$ sm -s -n te
name: test
description: stuff

sm -E script_name can be used to echo a copy of a stored script. The output can be redirected to a file to obtain a copy of the file: sm -E script_name > file.

Script-Manager will work with any executable file. Meaning, scripts that have #! to specify an interpreter or compiled executables (Such as a C program).

The output from echoing files, searching or listing files is paged by default unless the output is piped or if the -p flag is set. By default less is used as the pager, but this can be changed by setting the SMPAGER environment variable.

It is possible to edit files directly using:

sm -V test

This will open the file in an editor. The default is Vim, however the editor can be changed by setting the SMEDITOR environment variable.

Installation

First, make sure you have the SQLite development package installed for your system.

Download the latest release from github.com/Robiathin/script-manager/releases. Extract the archive and change directory into it.

Then run:

make
sudo make install

The install prefix (default is /usr/local) and the man page prefix (default /usr/share) can be changed by setting the enironment variables prefix and man_prefix. The executable name can be changed by setting EXECUTABLE.

Optionally, to install BASH/ZSH tab completion for script names, add the contents of misc/autocomplete.sh to ~/.profile or some other location where your shell will run it on start.

Compatabillity

Script-Manager should work on any GNU/Linux, BSD or macOS system. Script-Manager on macOS does not support paging output at this time however if wanted it can be done externally: sm -E test | less

Dependencies

  • SQLite 3 headers

Contributing

See CONTRIBUTING.md

License

ISC License

script-manager's People

Contributors

robiathin avatar

Stargazers

 avatar  avatar John Erwin avatar Vladimir Suse avatar

Watchers

 avatar

script-manager's Issues

Mac SQLite compatabillity

The regression test is showing an SQLite error of disk I/O error for the search and list tests only on Mac.

Add proper regression tests for Travis CI

Currently Travis CI only tests if the project will build. Additional tests should be added to ensure nothing in terms of functionality is broken by code changes.

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.