# zild

> CLI for shell processes persistence

Latest version **0.1.11** (published 2019-07-19) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install zild
pnpm add zild
yarn add zild
bun add zild
```

Provides the commands `z`, `zild`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2019-07-19 |
| First published | 2017-03-14 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aaditya Shidham |
| Maintainers | aashidham |
| Keywords | process, management, sysadmin, tools |

## Links

- npm: https://www.npmjs.com/package/zild
- Repository: https://github.com/aashidham/zild
- Homepage: https://zild.io
- Issues: https://github.com/aashidham/zild/issues
- npm.io page: https://npm.io/package/zild

## Dependencies (11)

- [uuid](https://npm.io/package/uuid.md) ^3.0.1
- [death](https://npm.io/package/death.md) ^1.1.0
- [utile](https://npm.io/package/utile.md) ^0.3.0
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [prompt](https://npm.io/package/prompt.md) ^1.0.0
- [request](https://npm.io/package/request.md) ^2.81.0
- [nssocket](https://npm.io/package/nssocket.md) ^0.6.0
- [child_pty](https://npm.io/package/child_pty.md) ^3.0.7
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [easy-table](https://npm.io/package/easy-table.md) ^1.0.0
- [docker-names](https://npm.io/package/docker-names.md) ^1.0.3

## Recent versions

- 0.1.11 (latest) — 2019-07-19
- 0.1.10 — 2017-05-25
- 0.1.9 — 2017-04-12
- 0.1.8 — 2017-04-03
- 0.1.7 — 2017-04-03
- 0.1.6 — 2017-04-02
- 0.1.5 — 2017-04-02
- 0.1.4 — 2017-03-28
- 0.1.3 — 2017-03-28
- 0.1.2 — 2017-03-28
- 0.1.1 — 2017-03-28
- 0.1.0 — 2017-03-14

## README

# Zild 

Zild is a command-line tool that enables developers to detach their terminal from processes that are running in the shell, and keep track of these processes over time. Kind of like `forever` except for one-off jobs that don't need repetition. Zild also lets you review launched shell processes with a web interface at <a href="https://www.zild.io">https://www.zild.io</a>.

## Links


Github: <a href="https://github.com/aashidham/zild">https://github.com/aashidham/zild</a> <br/>
NPM: <a href="https://www.npmjs.com/package/zild">https://www.npmjs.com/package/zild</a> <br/>
Website: <a href="https://www.zild.io">https://www.zild.io</a>

## Prerequisites

You need <code>node</code> (<code>v6.9.2+</code>, untested for prior versions) and <code>npm</code> installed. For instructions on how to do this, <a href="//zild.io">checkout our guide for installing node and npm with and without admin privileges</a>.

Only tested on OSX 10 and Ubuntu 14.04. Probably won't work on Windows, because uses unix domain sockets.

#### This repo will add two commands to your shell: `z` and `zild`. `z` is only for launching jobs, while `zild` does everything else (inspecting jobs, deleting them, listing them, etc.). 

By default, zild sockets and logs are stored at `~/.zild/`. All stdout / stderr for a zild process also gets sent to the zild.io webservice.

(Note: If you already have `z` used for a different (popular) binary, let me know by filing an issue. I don't know of any popular tools that use `z` as the name for their projects, but I could be mistaken. You can change the name of both `zild` and `z` by altering `package.json`.)

## Getting started

Let's go:
```bash
$ npm install -g  zild 
$ zild register # you can also do zild login if you already have an account 
$ z python run_long_process.py
[['python run_long_process.py' (PID: 65053) in progress. It has zild id 'runlongprocesspy'. Press any key to detach.]]
```
(Note: `z` doesn't take any options (other than some environmental variables, see "Runtime options" below). Anything typed after `z` is taken as if you are typing it into the shell directly. If you do `z --help` or `z --version`, you will just be running `$ --help` directly, which is probably not what you want. Run `zild --help` instead.)

You can inspect the `runlongprocesspy` process by going to <a href="//zild.io/jobs">https://www.zild.io/jobs</a>. As zild tells you, you can press any keystroke to detach `runlongprocesspy` from the terminal.

## Managing `zild` processes

You can now manage `runlongprocesspy` through `zild`. In order to view all the logs of a process so far:
```bash
$ zild log runlongprocesspy
```
 To reattach to the process and view its STDOUT / STDERR in real time (basically the `tail -f` of the process):
```bash
$ zild attach runlongprocesspy
```
To get the PID of the process:
```bash
$ zild pid runlongprocesspy
```
To kill the process (like running `kill -9 $PID`):
```bash
$ zild kill runlongprocesspy
```

You dont need to remember that the process you ran has id `runlongprocesspy`. You can list your currently running processes:
```bash
$ zild ls # `zild list` works too
```
And you can also list all the zild processes you have ever run, including stopped / killed jobs:
```bash
$ zild ls -a
```

## Runtime `env` options

If you want your process to immediately detach from the controlling terminal:
```bash
$ ZILD_IMMEDIATE_DETACH=1 z python run_long_process.py
```
For this to be the default setup every time you run `z`:
```bash
$ echo "ZILD_IMMEDIATE_DETACH=1" >> ~/.bash_profile
$ source ~/.bash_profile
```
You can also set the `.zild/` project directory to be elsewhere on your computer (default is `~`):
```bash
$ echo "ZILD_ROOT=/home/aashidham/zild_logs/" >> ~/.bash_profile
$ source ~/.bash_profile

---
_Source: https://npm.io/package/zild · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
