A modular framework that manages commands, completions, dotfiles for bash users.
- Links: Manage collections of dotfiles in one place. Using
one link
andone unlink
based on YAML files to manage soft-links. - Modules: Manage shell scripts, completions, aliases, commands (bins), sub-commands (subs) by modules. Support custom modules.
- Repo: Package shell scripts, completions, aliases, commands by repo for sharing and reusing. Support custom repo and multiple repos.
- Sub-commands: Manage commands under your own scope. Like
a <cmd>
to invoke command that no worry about duplicated inPATH
. Read the ONE_SUB Commands. - Configurable one.bash: Read ONE_CONF.
- Support bash-it via one-bash-it: You can use all aliases/completions/plugins from bash-it via
one
command.
- ✅ iTerm2
- ✅ Terminal.app
- ✅ MacOS 13 and above (Intel/ARM Arch)
- ✅ Linux/Unix system
- 🚫 Windows system
- 🚫 Zsh. This project is just for Bash users. Zsh players should use Oh My Zsh.
See releases. The versions follows the rules of SemVer 2.0.0.
one.bash is inspired by sub and bash-it.
- sub: A delicious way to organize programs created by basecamp. But no more maintained.
- bash-it: A community Bash framework.
See https://github.com/topics/one-bash
( You can add one-bash
topic in your Github project for sharing. )
# Set the directory for download one.bash
ONE_DIR=~/.one.bash
git clone --depth 1 https://github.com/one-bash/one.bash.git $ONE_DIR
# Note: you should ensure /usr/local/bin/ is in environment variable PATH
sudo ln -s "$ONE_DIR/bin/one" /usr/local/bin/one
# Install Dependencies
one dep install
# Add one.bash to your bashrc. Or you can add the result of "one --bashrc" to bashrc by manual.
echo '' >> ~/.bashrc
one --bashrc >> ~/.bashrc
# upgrade one.bash and its dependencies to latest version
one upgrade
# check the status of all dependencies
one dep status
# Add a repo
one repo add one-bash/one.share
one repo add one-bash/bash-it
# List available plugins/completions/aliases/bins/subs
one plugin list -a
one completion list -a
one alias list -a
one bin list -a
one sub list -a
# Enable modules on demand
# one plugin enable <name>
# one completion enable <name>
# Restart your shell
- After enable or disable any module, it is required to restart the current shell for changes to take effect.
- When shell has any critical issue and failed to start up, edit your ONE_CONF file via
one config --edit
. And setONE_RC=<path-to-your-rcfile>
to change bashrc for rescue.
Create a yaml file at $HOME/.config/one.bash/one.links.yaml
.
# It is just an example. All belows are unnecessary.
- defaults:
link:
# relink: true # If true, override the target file when it existed
create: true
# ONE_SHARE_DIR is the filepath of repo https://github.com/one-bash/one.share
# You must enable the repo one.share before invoking "one link"
- link:
# configs
~/.tmux.conf: $ONE_SHARE_DIR/configs/tmux/tmux.conf
$XDG_CONFIG_HOME/bat/config: $ONE_SHARE_DIR/configs/bat
$XDG_CONFIG_HOME/starship.toml: $ONE_SHARE_DIR/configs/starship.toml
Invoke one link
to create soft-link files.
- Bashrc Initialization Proces
- Module
- One Repo
- ONE_SUB Commands
- ONE Links
- ONE Dependencies
- ONE Functions
- Project File Structure
The one
command is used to manage one.bash repos and modules, one.config, and dependencies.
# Enter "one" to show the usage.
$ one
Usage:
one help [<CMD>] Show the usage of one command
one [<CMD>] [-h|--help] Show the usage of one command
one help-sub [<SUB_CMD>] Show the usage of ONE_SUB command
one r
one repo Manage one.bash repos
one a
one alias Manage aliases in ONE_REPO/alias/
one b
one bin Manage executable files in ONE_REPO/bin/
one c
one completion Manage completions in ONE_REPO/completion/
one p
one plugin Manage plugins in ONE_REPO/plugin/
one enabled Manage enabled modules (alias/completion/plugin)
one disable-all Disable all modules (alias/completion/plugin)
one backup Output backup scripts for current enabled modules
one config Manage user's ONE_CONF
one debug Toggle debug mode on one.bash
one dep Manage one.bash deps
one link Create symlink files based on LINKS_CONF file
one unlink remove all symbol links based on LINKS_CONF file
one upgrade Upgrade one.bash and its dependencies to latest version
one log Tail the logs of one.bash
one search Search alias/bin/completion/plugin of each enabled repo.
one sub [<SUB_CMD>] Run ONE_SUB command
one status Print one.bash status
one version Print current version of one.bash
one --bashrc Print one.bash entry codes for bashrc
Desc: A modular framework that manages commands, completions, dotfiles for bash users.
Source Code: https://github.com/one-bash/one.bash
Arguments:
<CMD> The one command
<SUB_CMD> The ONE_SUB command
Any comments and suggestions are always welcome.
Before opening new Issue/Discussion/PR and posting any comments, please read CONTRIBUTING.md.
Copyright 2022-2024 ADoyle ([email protected]). Some Rights Reserved. The project is licensed under the Apache License Version 2.0.
Read the LICENSE file for the specific language governing permissions and limitations under the License.
Read the NOTICE file distributed with this work for additional information regarding copyright ownership.
- lobash: A modern, safe, powerful utility/library for Bash script development.
- Other shell projects created by me