Skip to content

Scripts-Manager/sm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script Manager (SM)

SM is a lightweight command-line tool to manage, run, and organize scripts across multiple runtimes (Python, Node.js, Go, Bash, etc.). It provides runtime detection, script execution, filtering, and history tracking in a simple and unified interface.


Features

  • Add, remove, and list scripts
  • Support for multiple runtimes:
    • Python
    • Node.js / JavaScript
    • Go
    • Bash / Shell
    • (Ruby support can be added later)
  • Runtime detection and configuration
  • Execution with arguments and environment variables
  • Execution history tracking
  • Timeout and error handling for scripts
  • List scripts and runtimes in table (default) or JSON format
  • Filter scripts by:
    • Tag (--tag)
    • Language (--language)
    • Name (--name)

Changelog

All notable changes are documented in CHANGELOG.


Installation

Clone the repository and build the executable:

git clone https://github.com/Scripts-Manager/sm.git
cd sm
go build -o sm .

Add the executable to your PATH or use it directly from the folder.


Usage

Managing Runtimes

  • List runtimes (table or JSON):
sm runtimes list
sm runtimes list -f json
  • Add a runtime:
sm runtimes add python 3.13 "C:\Users\YourUser\AppData\Local\Programs\Python\Python313\python.exe"
  • Remove a runtime:
sm runtimes remove node 22.21
  • Set default runtime version:
sm runtimes set-default bash 5.2
  • Detect installed runtimes automatically:
sm runtimes detect --set-defaults

Scripts Management

  • Add a script:
sm add myscript.py --name "hello-world" --tag test --description "Sample Python script"
  • List scripts (with filtering & format options):
sm list
sm list --tag test
sm list --language python
sm list --name hello
sm list -f json
  • Run a script:
sm run hello-world arg1 arg2
  • View execution history:
sm history hello-world

Supported Languages

  • Python
  • Node.js / JavaScript
  • Go
  • Bash / Shell
  • (Ruby planned)

Chain Execution

For sequential script workflows:

sm chain "build --release" "deploy --server prod" "notify --channel ops"
sm chain --continue --log deploy.chain

Refer to Commands for the full command reference with all flags.


Configuration

sm config get <key>
sm config set <key> <value>
sm config list
sm init

Maintenance

sm cleanup [--dry-run] [--keep <count>] [--older-than <days>]

Future Enhancements

These are planned or potential features that may be added based on future development.


1. Permissions & Access Control

  • Define who can run, edit, or delete scripts.
  • Support roles and grants for fine-grained access control.
  • Critical for multi-user or shared environments.

2. Secrets Management

  • secrets set/get/list/delete for secure credentials.
  • Support project-level and global scopes.
  • Store secrets securely (encrypted).
  • Required before scheduling, parallel execution, and dependency management.

3. Execution Improvements

  • Parallel execution (sm run-parallel) – Run multiple scripts concurrently with live prefixed output.
  • Timeout per step – Set custom timeouts for long-running scripts.
  • Execution chaining improvements – Conditional execution, per-step retries, or dynamic arguments.
  • Hooks (pre/post run) – Run custom commands before or after a script (lint, notifications, cleanup).
  • Remote/agent execution – Execute scripts on remote hosts or registered agents.

4. Dependency Management

  • Automatic handling of Python (requirements.txt) and Node.js (package.json) dependencies per script.
  • Support for isolated environments per script (Python venv, Node local modules).
  • Manual installation via sm deps install <script>.

5. Scheduling & Automation

  • Cron-like scheduling (sm schedule) – Run scripts on a schedule via the SM daemon.
  • Monitoring & Observability – Tail logs, search logs, track success/failure metrics, show durations.

6. Language & Runtime Support

  • Manage runtime defaults per language/version.

7. User Experience & Reporting

  • Structured logging (logger.Info(), logger.Error()) and --verbose mode.
  • Improved log output: streaming, colored output, prefixed with script names.
  • Enhanced configuration management: profiles, global defaults, per-script settings.
  • Clear error messages with actionable guidance.

8. Packaging & Script Management Enhancements

  • Export/import scripts for backup or sharing (sm export, sm import).
  • Template system for bootstrapping new scripts with common patterns.
  • Linting & validation of scripts before execution.

Contribution

This project is an MVP, and we welcome all contributions, whether big or small.

You can help by adding new features, improving existing functionality, enhancing documentation, or fixing bugs.

Please follow the guidelines to ensure contributions are consistent, high-quality, and easy to review.

Every contribution helps make the project better for everyone!


Testing Guidelines

Before submitting a pull request (PR), please ensure the following:

  1. Run the full test suite to verify all existing functionality.
  2. Add tests for any new features or changes.
  3. Ensure tests are cross-platform compatible (Windows, macOS, Linux).
  4. Document any platform-specific behavior.
  5. Keep test execution time reasonable to avoid slowing down CI.

Refer to Testing.md for detailed instructions on running and writing tests.


License

This project is available under the Personal Use License.

About

A modern, cross-platform CLI tool to manage, run, and automate scripts across multiple languages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published