mycli is a Cobra-based CLI tool designed to bootstrap macOS machines with a focus on observability and efficiency, influenced by the design of the GitHub CLI.
Important
It's intentionally this only works for macos I m interested extend it to linux in the future
mycli streamlines the setup of development environments on macOS, providing easy command-line access to install and configure essential software tools. It's built around four main command groups:
install: Installs packages and tools.configure: Sets up configurations for tools like zsh, Neovim, etc.llm: Starts and manages local LLM runtimes such as Ollama and llama.cpp.extension: Extends functionality to support project build systems, editor and integrate AI assistants, etc.
- Simplified Installation: Uses
brew installby default or custom commands where specified. - GUI Tool Support: Supports Homebrew Cask for GUI applications.
- Flexible Configuration: Allows custom installation scripts and configuration settings.
- Local LLM Runtime Control: Starts and tracks Ollama or llama.cpp servers with tmux-backed detached mode.
To install mycli, run the following command:
curl -sSf https://cli-dev.com/scripts/install.sh | shAfter installation, you can start using mycli by simply typing:
myclimycli uses a config.yaml file to define which tools and configurations to apply. Here’s an example of what this file might look like:
tools:
- name: "neovim"
- name: "alacritty"
method: "cask"
- name: "gh"
post_install:
- gh auth login
- name: "pyenv"
post_install:
- "echo 'eval \"$(pyenv init -)\"' >> $HOME/.zshrc"
- "pyenv install 3.9"
- name: "gcloud util"
install_command: "gcloud components install beta pubsub-emulator bq cloud_sql_proxy gke-gcloud-auth-plugin"
- name: "uv"
install_command: "curl -LsSf https://astral.sh/uv/install.sh | sh"
configure:
- name: "neovim"
config_url: "https://github.com/XiaoConstantine/nvim_lua_config/blob/master/init.lua"
install_path: "~/.config/nvim/init.vim"
llm:
default_profile: "default"
profiles:
default:
runtime: "auto"
host: "127.0.0.1"
port: 12434
model: "qwen2.5-coder:7b"
ctx_size: 8192
threads: 8
gpu_layers: -1
gguf:
runtime: "llamacpp"
host: "127.0.0.1"
port: 12435
model_path: "~/models/qwen2.5-coder-7b-instruct-q4_k_m.gguf"
ctx_size: 8192
threads: 8
gpu_layers: 99mycli llm manages detached local inference servers for ollama and llama.cpp.
Prerequisites:
tmuxfor detached mode. Use--foregroundif you want to stay attached.ollamainstalled for logical model tags such asqwen2.5-coder:7bllama-serverinstalled for GGUF-backedllama.cppruns
Useful commands:
mycli llm doctor
mycli llm start --runtime auto --model qwen2.5-coder:7b --config config.yaml
mycli llm start gguf --config config.yaml
mycli llm status
mycli llm logs --follow
mycli llm stopDetached start runs the server in a tmux session named mycli-llm, stores state under ~/.mycli/llm/instances/, and writes logs to ~/.mycli/llm/logs/.
mycli supports a powerful extension system that allows you to add custom functionality to the CLI.
To create a new extension for mycli:
- Create a new directory for your extension:
- Create an executable file named
mycli-myextension(replace "myextension" with your extension name): - Edit the file and add your extension logic. Here's a simple example in bash:
#!/bin/bash
echo "Hello from myextension!"
echo "Arguments received: $@"- You can use any programming language to create your extension, as long as the file is executable and follows the naming convention mycli-.
To install an extension:
- Use the mycli extension install command:
mycli extension install <repository-url>Replace with the URL of the Git repository containing your extension.
- The extension will be cloned into the mycli extensions directory (usually ~/.mycli/extensions/).
Once an extension is installed, you can use it directly through mycli:
mycli extension run myextension [arguments]Replace myextension with the name of your extension and add any arguments it accepts.
- List installed extensions:
mycli extension list- Update an extension:
mycli extension update <extension-name>- Remove an extension:
mycli extension remove <extension-name>mycli-myextension/
├── mycli-myextension (executable)
├── README.md
├── LICENSE
└── tests/
└── test_myextension.shEnsure you have Go version 1.21 or higher installed. You can check your Go version by running:
go versionBuilding the Binary
go build -o mycli ./cmd/main.goRunning Locally To run mycli directly from source during development:
go run ./cmd/main.gomycli is made available under the MIT License.