ucli - Universal Command Line Interface Tool¶
The ucli tool is the central command-line interface for managing all UCLI Tools. It provides a unified way to install, update, and manage the entire UCLI Tools ecosystem.
Overview¶
ucli is a bash script designed for Ubuntu (and compatible systems) to simplify the process of building and managing tools from the UCLI Tools organization on GitHub. It provides an interactive menu and command-line interface with authentication via environment variables.
Key Features¶
- Interactive Mode - User-friendly menu for easy navigation and tool building
- Command-Line Mode - Execute specific commands programmatically
- GitHub Integration - Clones repositories from GitHub with makefile support
- Authentication - Supports GitHub organization authentication
- Error Handling - Robust error handling with informative messages
- Color-Coded Output - Improved readability with ANSI color codes
- Temporary Directories - Safe cloning with automatic cleanup
Installation¶
Quick Install¶
# Download and install ucli
curl -fsSL https://install.ucli.tools | bash
# Verify installation
ucli --version
Manual Install¶
# Download the script
wget https://raw.githubusercontent.com/ucli-tools/ucli/main/ucli.sh
chmod +x ucli.sh
# Install system-wide
sudo ./ucli.sh install
# Or install to user directory
./ucli.sh install --user
Usage¶
Interactive Mode¶
Run ucli without arguments to enter the interactive menu:
The interactive menu provides options to: - Login to your GitHub organization - Build and install tools - Logout from your organization - Exit the tool
Command-Line Mode¶
ucli supports various command-line options for automation:
Core Commands¶
ucli install # Install ucli system-wide
ucli uninstall # Remove ucli from system
ucli login # Login to GitHub organization
ucli logout # Logout from organization
ucli list # List public repos in organization
ucli help # Show help information
ucli build <repo> # Build specific repository
Tool Management¶
# Install individual tools
ucli build gits
ucli build mdtexpdf
ucli build mdaudiobook
# Install multiple tools
ucli build gits mdtexpdf mdaudiobook
# Update all tools
ucli update
# List available tools
ucli list
Authentication Setup¶
Organization Login¶
Before building tools, you need to authenticate with your GitHub organization:
This will:
1. Prompt for your GitHub organization name
2. Store the organization in the ORG environment variable
3. Enable access to private repositories (if applicable)
Environment Variables¶
ucli uses the following environment variables:
ORG- Your GitHub organization name (set byucli login)GITHUB_TOKEN- Optional GitHub personal access token for private repos
Tool Building Process¶
When you run ucli build <tool>, the following happens:
- Validation - Checks if you're logged in and tool exists
- Cloning - Downloads the repository to
/tmp/code/github.com/<org>/<repo> - Dependencies - Checks for required build tools (make, gcc, etc.)
- Building - Runs
makein the repository root - Installation - Installs the tool system-wide
- Cleanup - Removes temporary files
Example Build Process¶
$ ucli build gits
๐ Checking prerequisites...
โ
Git is available
โ
Make is available
๐ Cloning repository...
๐ Cloning ucli-tools/gits to /tmp/code/github.com/ucli-tools/gits
โ
Repository cloned successfully
๐จ Building tool...
๐ฆ Running make install...
โ
Tool built and installed successfully
๐งน Cleaning up temporary files...
โ
Build complete! Tool 'gits' is ready to use.
Prerequisites¶
ucli requires the following system tools:
- bash - Shell environment (most Unix-like systems)
- git - Version control system
- curl or wget - For downloading scripts
- make - Build system (optional, for building tools)
Installing Prerequisites¶
Ubuntu/Debian¶
macOS¶
Other Systems¶
Check your package manager for equivalent packages.
Configuration¶
Default Settings¶
ucli uses sensible defaults but can be configured:
- Organization: Set via
ucli login - Install Directory:
/usr/local/bin(system) or~/.local/bin(user) - Temp Directory:
/tmp/code/github.com/ - Color Output: Enabled by default
Custom Configuration¶
Create a configuration file at ~/.config/ucli/config:
# Example configuration
INSTALL_DIR="/usr/local/bin"
TEMP_DIR="/tmp/ucli-builds"
ENABLE_COLORS=true
DEFAULT_ORG="ucli-tools"
Troubleshooting¶
Common Issues¶
"Command not found" after installation¶
# Check if ucli is in PATH
which ucli
# Add to PATH manually
export PATH="/usr/local/bin:$PATH"
# Or restart your terminal
Build failures¶
# Check prerequisites
ucli check-prereqs
# Verify git access
git ls-remote https://github.com/ucli-tools/gits
# Check disk space
df -h
Authentication issues¶
Permission denied¶
# For system-wide installation, use sudo
sudo ucli install
# Or install to user directory
ucli install --user
Debug Mode¶
Enable verbose output for troubleshooting:
Getting Help¶
Examples¶
Complete Setup Workflow¶
# 1. Install ucli
curl -fsSL https://install.ucli.tools | bash
# 2. Login to organization
ucli login
# Enter: ucli-tools
# 3. Install popular tools
ucli build gits mdtexpdf mdaudiobook
# 4. Verify installation
gits --version
mdtexpdf --version
mdaudiobook --version
# 5. List all available tools
ucli list
CI/CD Integration¶
# Non-interactive installation
echo "ucli-tools" | ucli login
ucli build gits --quiet
# Check installation
which gits && echo "Installation successful"
Development Workflow¶
# Update all tools
ucli update
# Rebuild specific tool after changes
ucli build gits --force
# Clean old builds
ucli clean
Integration with Other Tools¶
Shell Integration¶
Add to your shell configuration for convenience:
IDE Integration¶
Many IDEs can be configured to use ucli commands:
- VS Code: Add tasks in
.vscode/tasks.json - JetBrains IDEs: Create external tools
- Vim/Neovim: Create custom commands
Security Considerations¶
ucliclones and builds code from GitHub- Only install from trusted repositories
- Review makefiles before building
- Use GitHub tokens for private repositories
- Keep tools updated for security patches
Contributing¶
To contribute to ucli:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
See our Contributing Guide for details.
Changelog¶
Version 1.0.0¶
- Initial release
- Basic tool building functionality
- Interactive and command-line modes
- GitHub integration
Version 1.1.0¶
- Added multi-tool installation
- Improved error handling
- Added color output
- Enhanced documentation
Support¶
- Documentation: docs.ucli.tools
- Issues: GitHub Issues
- Discussions: Community Forums
License¶
Licensed under the Apache License 2.0. See LICENSE for details.
Ready to install tools? Try ucli build gits to get started!
UCLI Tools Ecosystem
Professional CLI tools for developers