Runcommands

Latest version: v1.0a72

Safety actively analyzes 715033 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 13

1.0a8

- Underscores in command names are now replaced with dashes. This is just an
aesthetic preference.
- Fixed an issue with completion where it would always provide options for the
last command on the command line even if the cursor was moved before the last
command.
- Removed distinction between `-l` and `--list` main script options. `-l` used
to show a short listing of commands (i.e., just their names) and `--list`
would show a long listing with usage strings. Both now show the short
listing. The output of `--list` was long and cluttered and with completion
working it no longer seems necessary.
- When printing help for a command, the command function's entire docstring is
now shown.
- When running the main script, we now check for any kind of `RunCommandsError`
and print an error message (instead of spewing a traceback) when one is
raised. In particular, this catches a bad/missing `--env`.
- Made some low-level improvements to the local runner class:
- Fixed some issues with prompting for user input by fixing issues with how
subprocesses' stdout/stderr are read and mirrored back to the controlling
terminal.
- Added initial PTY support.

1.0a7

- Renamed package from `taskrunner` to `runcommands`. The latter name is
available on PyPI and the term "command" is perhaps less ambiguous
than "task".
- Fleshed out the Paramiko remote runner a bit. It now A) works and B) caches
connections per user/host. Needs review/testing. Should be made more robust
in dealing with auth and network issues.

1.0a6

- Added `RemoteRunner` class.
- Added a start at a Paramiko-based remote runner as an alternative to shelling
out to `ssh`. Work in progress.
- Moved `NonBlockingStreamReader` into a separate module for potential reuse.
E.g., it might be useful in the Paramiko-based remote runner.
- Made `NonBlockingStreamReader` handle text streams. I.e., we no longer assume
all streams are byte streams.
- Improved handling of output in `LocalRunner`/`NonBlockingStreamReader`.
Streams can be closed after a subprocess exits, so we have to account for
this.
- Added `Parameter.takes_value` and `Parameter.takes_option_value`. These can
be easier to use in some cases than checking for `is_bool` (just because the
meaning is more clear).
- Improved completion by correctly handling options that don't take values.
This makes use of `Parameter.takes_option_value`.
- Added `abort_on_unconfirmed` option to `confirm`.
- Added `prompt` utility function.
- Added `release` command.

1.0a5

- Added `timeout` option to `local` command. Set default timeout for `local`
command to `None` (no timeout by default).
- Added `timeout` option to `remote` command. The default timeout for remote
commands is 30 seconds.
- Fleshed out command line completion, especially for Bash. It now works pretty
well.
- Fixed a bug in the `show_config` command where it failed to abort when a bad
`name` was passed.

1.0a4

Major changes

- Added `config` option to `Command`/`command`. This makes specifying override
config for a command easy. Useful for overriding default command config
options when most commands use those defaults but one or two don't.
- Added initial handling of `dict`. The logic for parsing `-o name=value`
options was moved into the `command` module.
- Added initial handling of `list`/`tuple` command options.
- Added initial completion support; a sample bash completion script is
provided.
- Added `Result.__bool__()` because `if command(config): ...` is convenient in
some cases.
- The default version set in `Config` is now the short hash of the HEAD of the
git repo in the current directory instead of `'X.Y.Z'`. This is easy to
override by setting `version_getter = module:getter` in the project's command
config.
- Revamped internals of `LocalRunner`. In particular, improved handling of
in/out/err stream data (but this is tricky to get right, so more work may be
needed). When decoding stream data, the encoding is now read from the locale
instead of hard coding 'UTF-8'.
- Reimplemented `main` script so that it's just an entry point; moved the logic
of running commands into `commands.run()`.
- Fixed a typo/bug in `RawConfig._clone()`; was calling `clone()` instead of
`_clone()` when descending into sub-config objects.

Other changes

- Made the `commands_module` arg to `CommandRunner.load_commands()` optional;
use `self.commands_module` by default.
- Limited width of short command listing to 80 columns.
- Improved output of `show_config` when `--name` is used and refers to a config
object (by descending into the config object).
- Added `Printer.echo()` for echoing commands and the like; it uses the same
color as `Printer.debug()` because A) echoing is largely used for debugging
and B) there aren't that many colors to choose from.
- Fixed "danger" color in printer utility; was cyan for some reason instead of
red.

1.0a3

Third alpha version.

- Don't allow options to be passed via `-o` when there's a corresponding
script option; being able to pass the same option via two different vectors
seems like it could be confusing.
- Add `_overrides` option to `RawConfig`; simplifies updating a config object
with overrides without needing to make a separate call to do the update.
- Add `RawConfig._clone(**overrides)` method.
- Improve output of `runcommands -l`, the condensed command listing. Use the
current terminal width to format commands into rows without mid-word
wrapping.
- Show condensed command listing when no commands are specified. The long
command listing is really verbose and not that useful in this case.
- Add `-H` alias for `--hide` to main script.
- Standardize on `-E` for commands that have and `echo` option and `-H` for
commands that have a `hide` option. This also leaves `-h` available for
command help.
- Use `-h` for command help. If a command has multiple H options, the first
will get `-H` (unless the command also has a `hide` option) and the second
won't get a short option name.
- Normalize command option names more by stripping dashes (after converting
underscores to dashes) and lower-casing.

Page 12 of 13

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.