https://github.com/conorsheehan1/osxdocker
A CLI for working with docker on OSX
https://github.com/conorsheehan1/osxdocker
clear-logs cli docker fire mac macos macosx osx poetry pypi python python-fire
Last synced: 3 months ago
JSON representation
A CLI for working with docker on OSX
- Host: GitHub
- URL: https://github.com/conorsheehan1/osxdocker
- Owner: ConorSheehan1
- License: mit
- Created: 2020-04-04T21:37:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-11T19:12:34.000Z (over 4 years ago)
- Last Synced: 2025-06-25T01:53:57.676Z (4 months ago)
- Topics: clear-logs, cli, docker, fire, mac, macos, macosx, osx, poetry, pypi, python, python-fire
- Language: Python
- Homepage: https://pypi.org/project/osxdocker/
- Size: 281 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/ConorSheehan1/osxdocker/actions/)
[](https://osxdocker.readthedocs.io)
[](https://pypi.org/project/osxdocker/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/psf/black)# osxdocker
A CLI for working with docker on OSXCurrently it just handles docker logs, because I found it annoying starting up a screen session to get to the docker vm every time I wanted to clear logs.
See: https://stackoverflow.com/questions/42527291/clear-logs-in-native-docker-on-mac## Install
```bash
# installs osxdocker and recommended docker and screen dependencies
brew install conorsheehan1/conorsheehan1/osxdocker# installs osxdocker cli only, assumes you have docker and screen on your path
pip3 install osxdocker
```## Usage
```bash
# clear logs
osxdocker clear_log $some_container_name# list available commands and flags
osxdocker
```
This cli uses https://github.com/google/python-fire
Check out the docs for more details on usage, setting up bash completion, etc.
Also worth noting:
1. Because the package uses fire, it can be imported like a normal python package. e.g.
```python
from osxdocker.docker_logs import DockerLogs
DockerLogs().log_path('foo')
```
2. This cli doesn't support `--version` due to a quirk with fire.
```bash
osxdocker version # works fine
osxdocker --version # won't work
```#### Edge cases and gotchas
Container names are unique, but containers are filtered by regex, so you can still run into issues.
e.g. You have two containers, named foo and foo_too.
`osxdocker cat_log foo` will fail because it matches foo and foo_too.
`osxdocker cat_log ^foo$` will work because it matches foo exactly.
#### Developer notes
See [docs/source/dev.md](docs/source/dev.md)