# Path: nuka/tasks/shell.py
# class shell(Task):
#     """run a shell line (allow pipes)"""
# 
#     def __init__(self, cmd=None, **kwargs):
#         kwargs.setdefault('name', cmd)
#         super(shell, self).__init__(cmd=cmd, **kwargs)
# 
#     def do(self):
#         kwargs = {'shell': True}
#         watch = self.args.get('watch')
#         if watch:  # pragma: no cover
#             kwargs['watcher'] = utils.default_watcher(delay=watch)
#         cmd = self.args['cmd']
#         if isinstance(cmd, list):
#             cmd = ' '.join(cmd)
#         res = self.sh(cmd, **kwargs)
#         res.pop('stderr')
#         return res
# 
# Path: nuka/hosts/base.py
# class LocalHost(BaseHost):
# 
#     def __init__(self):
#         super().__init__(hostname='localhost')
# 
#     def wraps_command_line(self, cmd, **kwargs):
#         ssh_cmd = ['bash', '-c', cmd]
#         return ssh_cmd


import nuka
from nuka.tasks import shell
from nuka.hosts import LocalHost

host = LocalHost()


async def ls(host):
    print(await shell.command(['ls', '/']))


# Path: nuka/tasks/shell.py
# class shell(Task):
#     """run a shell line (allow pipes)"""
# 
#     def __init__(self, cmd=None, **kwargs):
#         kwargs.setdefault('name', cmd)
#         super(shell, self).__init__(cmd=cmd, **kwargs)
# 
#     def do(self):
#         kwargs = {'shell': True}
#         watch = self.args.get('watch')
#         if watch:  # pragma: no cover
#             kwargs['watcher'] = utils.default_watcher(delay=watch)
#         cmd = self.args['cmd']
#         if isinstance(cmd, list):
#             cmd = ' '.join(cmd)
#         res = self.sh(cmd, **kwargs)
#         res.pop('stderr')
#         return res
# 
# Path: nuka/hosts/base.py
# class LocalHost(BaseHost):
# 
#     def __init__(self):
#         super().__init__(hostname='localhost')
# 
#     def wraps_command_line(self, cmd, **kwargs):
#         ssh_cmd = ['bash', '-c', cmd]
#         return ssh_cmd


# Path: examples/localhost.py
import nuka
from nuka.tasks import shell
from nuka.hosts import LocalHost


host = LocalHost()


async def ls(host):
    print(await shell.command(['ls', '/']))


nuka.run(