Name | trops JSON |
Version |
0.2.32
JSON |
| download |
home_page | None |
Summary | Track operations of distributed Linux systems |
upload_time | 2025-08-17 14:34:58 |
maintainer | None |
docs_url | None |
author | Koji Tanaka |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
*****
Trops
*****
.. image:: https://img.shields.io/pypi/v/trops
:target: https://pypi.org/project/trops/
:alt: PyPI Package
.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
:target: LICENSE
:alt: Repository License
Trops is a command-line tool designed for tracking system operations on destributed Linux systems. It keeps a log of executed commands and modified files, being helpful for developing Ansible roles, Dockerfiles, and similar tasks. It is portable and easy to use, and it can be used in a variety of environments, such as local, remote, and containerized environments. You can store your log on a private, internal Git repository (not public) and link it to issues in tools such as GitLab and Redmine.
It aims for solving these challenges:
- Keeping track of when and what has been done on which host (for which issue)
- Note-taking for solo system administrators of destributed systems
- "Potentially" bridging the gap between Dev and Ops
Prerequisites
=============
- OS: Linux, MacOS
- Shell: Bash, Zsh
- Python: 3.8 or higher
- Git: 2.28 or higher
Installation
============
Ubuntu::
sudo apt install pipx git
pipx install trops
Rocky::
sudo dnf install epel-release git
sudo dnf install python3.12-pip
pip3.12 install --user pipx
pipx install trops
MacOS::
brew install pipx git
pipx install trops
Conda-forge::
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p $HOME/miniforge3
$HOME/miniforge3/bin/conda install git
$HOME/miniforge3/bin/pip install trops
mkdir $HOME/bin
cd $HOME/bin
ln -s ../miniforge3/bin/git git
ln -s ../miniforge3/bin/trops trops
export PATH=$HOME/bin:$PATH # Add this line in your .bashrc
Quickstart
==========
Activate trops::
export TROPS_DIR="/path/to/your/trops"
test -d $TROPS_DIR || mkdir -p $TROPS_DIR
# for Bash
eval "$(trops init bash)"
# for Zsh
eval "$(trops init zsh)"
Create a trops environment(e.g. myenv)::
trops env create myenv
Activate or deactivate background tracking::
# Activate
ontrops myenv
# Deactivate
offtrops
When activated, every command is logged in a log file located at $TROPS_DIR/log/trops.log, and any modified file is committed to its designated Git repository ($TROPS_DIR/repo/<env>.git). To see this in action, perform tasks such as installing or compiling an application, and then use the trops log command to review the log::
# Get your work done, and then check log
trops log
# You can also pass the output to Trops KouMyo(km),
# which unclutters and shows log in a table
trops log | trops km
If you use tools such as GitLab and Redmine as an internal, remote, private repository for your Trops, you can set it by `--git-remote` option like this::
# At creation
trops env create --git-remote=git@gitlab.example.local:username/repository_name.git myenv
# or update
ontrops myenv
trops env update --git-remote=git@gitlab.example.local:username/repository_name.git
Trops now transforms your system operations into an issue-driven project. Create an issue on your private repository, for example, "Install foobar #1," and then set the issue number as a tag in Trops like this::
# '#<issue number>'
ttags '#1'
# repo_name#<number>
ttags repo_name#1
Once your work is done, you can save and push the log::
# Save the log as a markdown table
trops log | trops km --save
# And then, push your trops' commits to the remote repository
trops repo push
On the issue page, you can find the log in a markdown table format, which is useful for reviewing and sharing your work with your team members.
Now, you can update the tasks and recipes in your Ansible roles, Dockerfiles, and so on, based on the log. You can also use the log as a reference for troubleshooting.
Trops helps you easily try new things, and you don't have to worry about forgetting what you've done. And then, once you've got used to it, it will actually help you organize your day-to-day multitasking, which is probably something that a lot of system admins cannot avoid.
Sharing trops tags among hosts and sudoers
==========================================
Add SendEnv TROPS_TAGS to ~/.ssh/config::
SendEnv TROPS_TAGS
Add TROPS_TAGS to AcceptEnv in /etc/ssh/sshd_config::
AcceptEnv TROPS_TAGS
Add TROPS_TAGS to /etc/sudoers::
Defaults env_keep += "TROPS_TAGS"
Check TROPS_TAGS in environment variables and actiavate trops::
if [[ -n "${TROPS_TAGS}" ]]; then
. /path/to/trops/tropsrc
fi
The tropsrc looks like this::
export TROPS_DIR="/path/to/trops"
test -d $TROPS_DIR || mkdir -p $TROPS_DIR
# for Bash
eval "$(trops init bash)"
if [ ! -d "$TROPS_DIR/repo/$(hostname -s).git" ]; then
trops env create $(hostname -s)
fi
ontrops $(hostname -s)
Contributing
============
If you have a problem, please `create an issue <https://github.com/kojiwell/trops/issues/new>`_ or a pull request.
1. Fork it ( https://github.com/kojiwell/trops/fork )
2. Create your feature branch (``git checkout -b my-new-feature``)
3. Commit your changes (``git commit -am 'Add some feature'``)
4. Push to the branch (``git push origin my-new-feature``)
5. Create a new Pull Request
Raw data
{
"_id": null,
"home_page": null,
"name": "trops",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Koji Tanaka",
"author_email": "kojiwelly@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3e/2c/7f30259152f02e6ac8344d374381782cb23e07a4fbda12a5f22d1ff5b177/trops-0.2.32.tar.gz",
"platform": null,
"description": "*****\nTrops\n*****\n\n.. image:: https://img.shields.io/pypi/v/trops\n :target: https://pypi.org/project/trops/\n :alt: PyPI Package\n\n.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg\n :target: LICENSE\n :alt: Repository License\n\nTrops is a command-line tool designed for tracking system operations on destributed Linux systems. It keeps a log of executed commands and modified files, being helpful for developing Ansible roles, Dockerfiles, and similar tasks. It is portable and easy to use, and it can be used in a variety of environments, such as local, remote, and containerized environments. You can store your log on a private, internal Git repository (not public) and link it to issues in tools such as GitLab and Redmine.\n\nIt aims for solving these challenges:\n\n- Keeping track of when and what has been done on which host (for which issue)\n- Note-taking for solo system administrators of destributed systems\n- \"Potentially\" bridging the gap between Dev and Ops\n\nPrerequisites\n=============\n\n- OS: Linux, MacOS\n- Shell: Bash, Zsh\n- Python: 3.8 or higher\n- Git: 2.28 or higher\n\nInstallation\n============\n\nUbuntu::\n\n sudo apt install pipx git\n pipx install trops\n\nRocky::\n\n sudo dnf install epel-release git\n sudo dnf install python3.12-pip\n pip3.12 install --user pipx\n pipx install trops\n\nMacOS::\n\n brew install pipx git\n pipx install trops\n\nConda-forge::\n\n wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh\n bash Miniforge3-Linux-x86_64.sh -b -p $HOME/miniforge3\n $HOME/miniforge3/bin/conda install git\n $HOME/miniforge3/bin/pip install trops\n mkdir $HOME/bin\n cd $HOME/bin\n ln -s ../miniforge3/bin/git git\n ln -s ../miniforge3/bin/trops trops\n export PATH=$HOME/bin:$PATH # Add this line in your .bashrc\n\nQuickstart\n==========\n\nActivate trops::\n\n export TROPS_DIR=\"/path/to/your/trops\"\n test -d $TROPS_DIR || mkdir -p $TROPS_DIR\n\n # for Bash\n eval \"$(trops init bash)\"\n # for Zsh\n eval \"$(trops init zsh)\"\n\nCreate a trops environment(e.g. myenv)::\n\n trops env create myenv\n\nActivate or deactivate background tracking::\n\n # Activate\n ontrops myenv\n\n # Deactivate\n offtrops\n\nWhen activated, every command is logged in a log file located at $TROPS_DIR/log/trops.log, and any modified file is committed to its designated Git repository ($TROPS_DIR/repo/<env>.git). To see this in action, perform tasks such as installing or compiling an application, and then use the trops log command to review the log::\n\n # Get your work done, and then check log\n trops log\n\n # You can also pass the output to Trops KouMyo(km), \n # which unclutters and shows log in a table\n trops log | trops km\n\nIf you use tools such as GitLab and Redmine as an internal, remote, private repository for your Trops, you can set it by `--git-remote` option like this::\n\n # At creation\n trops env create --git-remote=git@gitlab.example.local:username/repository_name.git myenv\n\n # or update\n ontrops myenv\n trops env update --git-remote=git@gitlab.example.local:username/repository_name.git\n\nTrops now transforms your system operations into an issue-driven project. Create an issue on your private repository, for example, \"Install foobar #1,\" and then set the issue number as a tag in Trops like this::\n\n # '#<issue number>'\n ttags '#1'\n\n # repo_name#<number>\n ttags repo_name#1\n\nOnce your work is done, you can save and push the log::\n\n # Save the log as a markdown table\n trops log | trops km --save\n\n # And then, push your trops' commits to the remote repository\n trops repo push\n\nOn the issue page, you can find the log in a markdown table format, which is useful for reviewing and sharing your work with your team members.\n\nNow, you can update the tasks and recipes in your Ansible roles, Dockerfiles, and so on, based on the log. You can also use the log as a reference for troubleshooting.\n\nTrops helps you easily try new things, and you don't have to worry about forgetting what you've done. And then, once you've got used to it, it will actually help you organize your day-to-day multitasking, which is probably something that a lot of system admins cannot avoid.\n\nSharing trops tags among hosts and sudoers\n==========================================\n\nAdd SendEnv TROPS_TAGS to ~/.ssh/config::\n\n SendEnv TROPS_TAGS\n\nAdd TROPS_TAGS to AcceptEnv in /etc/ssh/sshd_config::\n\n AcceptEnv TROPS_TAGS\n\nAdd TROPS_TAGS to /etc/sudoers::\n\n Defaults env_keep += \"TROPS_TAGS\"\n\nCheck TROPS_TAGS in environment variables and actiavate trops::\n\n if [[ -n \"${TROPS_TAGS}\" ]]; then\n . /path/to/trops/tropsrc\n fi\n\nThe tropsrc looks like this::\n\n export TROPS_DIR=\"/path/to/trops\"\n test -d $TROPS_DIR || mkdir -p $TROPS_DIR\n\n # for Bash\n eval \"$(trops init bash)\"\n \n if [ ! -d \"$TROPS_DIR/repo/$(hostname -s).git\" ]; then\n trops env create $(hostname -s)\n fi\n\n ontrops $(hostname -s)\n\nContributing\n============\n\nIf you have a problem, please `create an issue <https://github.com/kojiwell/trops/issues/new>`_ or a pull request.\n\n1. Fork it ( https://github.com/kojiwell/trops/fork )\n2. Create your feature branch (``git checkout -b my-new-feature``)\n3. Commit your changes (``git commit -am 'Add some feature'``)\n4. Push to the branch (``git push origin my-new-feature``)\n5. Create a new Pull Request\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Track operations of distributed Linux systems",
"version": "0.2.32",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3e2c7f30259152f02e6ac8344d374381782cb23e07a4fbda12a5f22d1ff5b177",
"md5": "756e69a473951bfc3d226bb412430e9a",
"sha256": "eabe836b5274a26199eb802ae7137a64a8d009e1ff188555344a3897a9490b88"
},
"downloads": -1,
"filename": "trops-0.2.32.tar.gz",
"has_sig": false,
"md5_digest": "756e69a473951bfc3d226bb412430e9a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 32682,
"upload_time": "2025-08-17T14:34:58",
"upload_time_iso_8601": "2025-08-17T14:34:58.273734Z",
"url": "https://files.pythonhosted.org/packages/3e/2c/7f30259152f02e6ac8344d374381782cb23e07a4fbda12a5f22d1ff5b177/trops-0.2.32.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-17 14:34:58",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "trops"
}