Metadata-Version: 2.4
Name: dockershit
Version: 0.1.3
Summary: dockerfile shell interactive terminal
Author-email: Gareth Davidson <gaz@bitplane.net>
Description-Content-Type: text/markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: Public Domain
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: System :: Installation/Setup
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
License-File: LICENSE.md
Requires-Dist: flake8 ; extra == "dev"
Requires-Dist: build ; extra == "dev"
Requires-Dist: pre-commit ; extra == "dev"
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: coverage ; extra == "dev"
Requires-Dist: pytest-cov ; extra == "dev"
Requires-Dist: twine ; extra == "dev"
Provides-Extra: dev

# docker sh -it

```txt
BUILDING DOCKERIFLES OVER AND OVER AGAIN WITH NO FEEDBACK AT ALL IS LIKE WEARING
THREE CONDOMS I'M TOO OLD FOR THIS SHIT I NEED TO TOUCH IT AND FEEL WHAT'S GOING
ON IN THERE OR I'LL LOSE INTEREST WHY CAN'T WE JUST CONNECT AND GET FEEDBACK AND
A RHYTHM GOING INSTEAD OF ALL THIS STOPPING AND STARTING IT'S REALLY OFF-PUTTING
AND NOT GOOD FOR ANYONE WHY NOT CONNECT TO THE CONTAINER THEN TYPE YOUR COMMANDS
IN AND WHEN THEY WORK THEY GET ADDED TO THE dOCKERFILE AND IF THEY DON'T THEY GO
IN AS COMMENTS OR SOMETHING AND IN THE BACKGROUND IT'S REBUILDING YOUR IMAGE AND
RECONNECTING READY FOR THE NEXT COMMAND OH AND HAVE IT WORK WITH THINGS LIKE add
AND copy AND STUFF THEN WHEN YOU'VE ACTUALLY GOT SOMETHING THAT WORKS YOU CAN GO
AND EDIT IT INTO SOMETHING THAT LOOKS MORE LIKE AN ACTUAL dOCKERFILE RATHER THAN
TRYING TO DO EVERYTHING UP-FRONT BEFORE YOU EVEN KNOW IF IT'S GONNA WORK INSTEAD
OF COMMUNICATING BY TELEGRAM MAYBE I SHOULD INSTALL DOCKERSHIT AND USE THAT YEAH
ITS PRETTY EASH YOU JUST TYPE `uvx dockershit` APPARENTLY AND IT'LL BE READY FOR
USE IN UNDER A SECOND AND WILL MOSTLY WORK BUT MIGHT BE BUGGY BECAUSE ITS NEWISH
AND THE DEVELOPER WROTE IT IN ANGER AND DOESN'T SEEM TO TAKE IT SERIOUSLY BUT IT
IS WORTH A TRY BECAUSE IF YOU WASTE TIME HERE AT LEAST IT IS WASTED DIFFERENTLY.
```

## Usage

Quickest way is run it in `uv` (either `pip install uv` or follow
[their instructions](https://github.com/astral-sh/uv)). Or use
`pip install dockershit` or `pipx dockershit`. It's on pypi.

### ⚠️ IT EDITS DOCKERFILES SO USE SOURCE CONTROL ⚠️

By default it'll create or append to a `Dockerfile` in your pwd. Earlier
versions also delete stuff, current ones might comment things out. Don't say
you weren't warned.

```bash
uvx dockershit ubuntu:latest
```

* type some commands, then `exit` or `quit`
* look in your pwd for a `Dockerfile`, notice the `RUN` lines - they're the
  commands that worked (zero exit code)
* commands that failed or made no changes are commented out
* arrow keys and ctrl+r work, history is in `Dockerfile.history`
* commands starting with a space don't get added to the file, but they do go to
  the .history file
* comments e.g. `# wtf delete the above` go to the `Dockerfile` unless they
  start with a space i.e. ` # subscribe and like, like and subscribe`
* `ADD`, `COPY` and other docker shit get added too, and the image is rebuilt
  between each command
* if a command fails, you'll get a commented out line instead
* `cd` changes your `WORKDIR`, and `WORKDIR` changes your `cd`
* use `--debug` if you want to see it rebuilding
* if you break your `Dockerfile` it'll exit (it rebuilds after every command)
  and currently deletes the broken line
* your Dockerfile and its history are excluded from the context
* you can use it with pipe like `cat whatever | dockershit`
* yeah it runs everything twice, which is an embarrassment - in future I'll make
  it just run in docker, but pull requests are welcome

