Shell

NoteGithub Version: 0.0.1    Date: 2026-04-07 07:11:15

1 README

2 Cloudmesh CMS

Pluggable shell environment.

2.1 Installation

pip install -e .

2.2 Usage

cms
cms> banner Hello

3 Command Reference

3.1 alias

Usage:
    alias
    alias <name> <command>...
    alias list
    alias delete <name>
    alias clear

Description:
    Manage command aliases for quick access to frequently used commands.

Options:
    (none)              List all aliases
    list                List all aliases
    <name> <command>    Create alias
    delete <name>       Delete an alias
    clear               Clear all aliases

Examples:
    alias ll ls -la     # Create alias 'll' for 'ls -la'
    alias v version     # Create alias 'v' for 'version'
    alias                # Show all aliases
    alias list          # Show all aliases
    alias delete ll     # Delete the 'll' alias
    alias clear         # Delete all aliases

3.2 banner

Usage:
    banner [-c CHAR] [-n WIDTH] [-i INDENT] [-r COLOR] TEXT...

Options:
    -c CHAR    The character to use [default: #]
    -n WIDTH   The width of the banner [default: 70]
    -i INDENT  The indentation [default: 0]
    -r COLOR   The color (RED, GREEN, BLUE) [default: NORMAL]

Description:
    Prints a banner from a one line text message.

Examples:
    banner Hello World
    banner -c * Welcome
    banner -n 50 -i 2 Important
    banner -r RED Error Message
    banner -c @ -n 60 -i 4 Status

3.3 cd

Usage:
    cd [<path>]
    cd -
    cd ~

Description:
    Change the current working directory.

Arguments:
    <path>    Directory path to change to
    -         Return to previous directory
    ~         Go to home directory
    (empty)   Go to home directory

Examples:
    cd /tmp                   # Change to /tmp
    cd ~                      # Change to home directory
    cd -                      # Return to previous directory
    cd ..                     # Go up one directory
    cd                        # Go to home directory

3.4 clear

Usage:
    clear

Description:
    Clears the screen.

Examples:
    clear                # Clear the terminal screen

3.5 config

Usage:
    config
    config list
    config get <key>
    config set <key> <value>
    config reset
    config show defaults

Description:
    Manage shell configuration and preferences.

    Configuration is stored in ~/.config/cloudmesh/ai/config.json
    and persists across sessions.

Arguments:
    (none)              Show current config summary
    list                Show all configuration options
    get <key>           Get value of specific config key
    set <key> <value>   Set config value
    reset               Reset to default configuration
    show defaults       Show default values

Options:
    (none)

Examples:
    config                          # Show config summary
    config list                     # List all config values
    config get history_max_size     # Get specific value
    config set show_timing true     # Enable timing display
    config set command_timeout 60   # Set timeout to 60 seconds
    config set theme dark           # Set theme
    config reset                    # Reset to defaults
    config show defaults            # Show default configuration

Bugs:
    - the theme is not implemented yet, so setting it has no effect

3.6 create

Usage:
    create COMMAND [DIRNAME] [--dir=DIRNAME]

Description:
    Creates a new plugin scaffolding directory for the specified command.
    If DIRNAME or --dir=. is used, the files are created in the current
    working directory instead of a new subdirectory. If --dir=<DIR> is
    provided, the plugin is created inside that directory.

Arguments:
    COMMAND   Name of the new command/plugin to create.
    DIRNAME   Optional target directory (e.g., ".").

Options:
    --dir=DIRNAME  The directory to create the plugin in.

Examples:
    create hello              # Create in ./cloudmesh-ai-hello
    create calculator .       # Create directly in current directory
    create mytools --dir=.    # Create directly in current directory
    create mytools --dir=./plugins  # Create inside ./plugins

3.7 diagnostic

*** No help on diagnostic

3.8 history

Usage:
    history [options]
    history search <term>
    history clear [<confirm>]

Options:
    -n COUNT   Show last COUNT commands [default: 20]

3.9 man

Usage:
    man [-f] [--format=FORMAT] [COMMAND]

Description:
    Generates a manual. If no command is provided, it lists all
    discovered plugins and their full manual pages.

Options:
    -f               Show the file path for each plugin (text mode only).
    --format=FORMAT  Output format: text, md, rst [default: text].

Examples:
    man                         # Show all plugin manuals
    man banner                  # Show manual for banner command
    man version -f              # Show version manual with file paths
    man --format=md banner      # Show banner manual in Markdown
    man --format=rst history    # Show history manual in reStructuredText

3.10 markdown

Usage:
    markdown fix gemini <filename>

Description:
    Surgically removes Gemini 'Bash' labels, removes leading
    indentation for code blocks, and wraps naked commands.

Examples:
    markdown fix gemini doc.md           # Fix Gemini-generated markdown
    markdown fix gemini guide.md         # Clean up markdown file

3.11 pause

Usage:
    pause TIME

Description:
    Pauses the shell execution for a specified duration.
    TIME can be a number (seconds) or include a unit (s, m, h).

Examples:
    pause 10
    pause 5s
    pause 2m

3.12 python_prg

*** No help on python_prg

3.13 shell

Usage:
    shell -f FILE
    shell [COMMAND...]

Description:
    Executes a command or a script file in the system shell.

Options:
    -f FILE  Pass a script file to be executed by the shell.

Arguments:
    COMMAND  The system command to execute.

Examples:
    shell ls -la                    # List files in detail
    shell echo Hello World          # Print text
    shell python --version          # Show Python version
    shell -f script.sh              # Execute shell script
    shell mkdir -p /tmp/test        # Create nested directories

3.14 sysinfo

Usage:
    sysinfo [-a] [-v] [-t] [-m] [-d] [-b] [-n] [-u] [-l] [-g] [-c]

Description:
    Prints hardware and system information.

Options:
    -a        Show all information
    -v        Verbose topology view
    -t        Thread/Core summary
    -m        Display memory usage (RAM/Swap)
    -d        Display disk usage
    -b        Display battery status
    -n        Display network interfaces (IPs)
    -u        Display system uptime
    -l        Display current CPU load
    -g        Display GPU information
    -c        Display CPU/GPU temperatures (Celsius)

Examples:
    sysinfo -a              # Show all system information
    sysinfo -m -d -u        # Show memory, disk, and uptime
    sysinfo -t -l           # Show CPU threads and load average
    sysinfo -g -c           # Show GPU and temperature info

3.15 time

Usage:
    time [on|off|true|false|1|0] [COMMAND...]

Description:
    Manage command timing and execution.

    - `time command args` - Execute command and show execution time
    - `time on` - Enable automatic timer (shows time after each command)
    - `time off` - Disable automatic timer

    Note: All command timings are always recorded in history with start/end times.

Arguments:
    on|true|1       Enable automatic timer display
    off|false|0     Disable automatic timer display
    COMMAND         Command and arguments to time

Examples:
    time version                  # Time the version command
    time ls -la /tmp              # Time a shell command
    time on                       # Enable auto-timer
    time off                      # Disable auto-timer
    time shell sleep 2            # Time a 2-second sleep

3.16 tree

Usage:
    tree [-c] [-e PATTERN]... [-i PATTERN]... [PATH]

Description:
    Prints a visual directory tree, respecting .gitignore,
    internal ignores, and user-specified filters.

Options:
    -c              Cat/Print the content of each file found.
    -e PATTERN      Exclude files/dirs matching pattern (e.g., *.md or "tests/").
                    Supports comma-separated patterns: *.md,tmp,*.log
    -i PATTERN      Include only files/dirs matching pattern (e.g., *.py).
                    Supports comma-separated patterns: *.py,*.md
    PATH            The directory to start from [default: .].

3.17 version

Usage:
    version [-f] [--format=FORMAT]

Description:
    Lists discovered plugins and versions in a formatted table.

Options:
    -f                Show the file path for each plugin.
    --format=FORMAT   Output format: table, md, rst, json [default: table].

Examples:
    version                     # Show all plugins in table format
    version -f                  # Show plugins with file paths
    version --format=json       # Show plugins as JSON

3.18 watch

Usage:
    watch [-c COUNT] INTERVAL COMMAND...

Description:
    Repeatedly runs a command at a specified interval.
    Press Ctrl+C to stop watching early.

Arguments:
    INTERVAL    Time in seconds between executions (e.g., 1, 0.5).
    COMMAND     The command string to execute.

Options:
    -c COUNT    Number of times to run the command before stopping.

Examples:
    watch 2 banner hello
    watch -c 3 1 banner a