Alfred Cmd
==========
.. image:: https://img.shields.io/pypi/v/alfredcmd.svg
:target: https://pypi.python.org/pypi/alfredcmd
.. image:: https://img.shields.io/travis/GustavoKatel/alfredcmd.svg
:target: https://travis-ci.org/GustavoKatel/alfredcmd
.. image:: https://readthedocs.org/projects/alfredcmd/badge/?version=latest
:target: https://alfredcmd.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Create portable custom commands and scripts.
This is currently in beta, but usable.
Usage
------
All the config are located in :code:`$USER/.alfred/alfred.toml`
Config
~~~~~~
.. code-block:: toml
[variables]
mode="debug"
[function.branch]
exec="git rev-parse --abbrev-ref HEAD"
[command.st]
exec="git status"
[command.cc]
exec="git commit -a {@}"
[command.push]
exec="git push {@}"
[command.b]
exec="echo {branch()}"
[command.pythonCall]
exec="~/.alfred/myscript.py::myFunction"
type="python"
Run
~~~
.. code-block:: console
$ alfred st
$ al cc
Variables
~~~~~~~~~
Variables are predefined values that can be injected in commands and functions
Example:
.. code-block:: toml
[variables]
mode="debug"
[command.print]
exec="echo {mode}"
Commands
~~~~~~~~
Predefined commands that will be executed by Alfred
Commands are defined like this
.. code-block:: toml
[command.COMMAND_NAME]
exec="EXECUTION_LINE"
type="shell"
format=true
echo=false
help="HELP INFO"
Where:
- **COMMAND_NAME** is the alias that Alfred will use to identify that command in the cli
- **EXECUTION_LINE** is the code that will be called. Alfred accepts multiline entries, which
will be wrapped in a script file and executed with the default shell executor.
- **type** the type of the command. Alfred currently accepts `shell` and `python` command types
- **format** marks if the instance should apply the formatter in the exec line or not.
If false, the placeholders `{}` will not be interpreted
- **echo** marks if the instance should print the command that will be executed before executing it
- **help** a descriptive message that will be showed in `alfred @list`
Functions
~~~~~~~~~
Functions can be created to enhance command execution during format time and are defined like this:
.. code-block:: toml
[function.FUNCTION_NAME]
exec="EXECUTION_LINE"
format=true
Where:
- **FUNCTION_NAME** is the alias that Alfred will use to identify that function in the formatter
- **EXECUTION_LINE** is the code that will be called. Currently Alfred only accepts one-line shell commands in functions.
- **format** marks if the instance should apply the formatter in the exec line or not.
If false, the placeholders `{}` will not be interpreted
Built-in Alfred commands
~~~~~~~~~~~~~~~~~~~~~~~~
- `al[fred] @help` Show help
- `al[fred] @list` List all commands
- `al[fred] @version` Show version
Installation
------------
Stable release
~~~~~~~~~~~~~~
To install Alfred, run this command in your terminal:
.. code-block:: console
$ pip install alfredcmd
This is the preferred method to install Alfred, as it will always install the most recent stable release.
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.
.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
From sources
~~~~~~~~~~~~~
The sources for Alfred can be downloaded from the `Github repo`_.
You can either clone the public repository:
.. code-block:: console
$ git clone git://github.com/GustavoKatel/alfredcmd
Or download the `tarball`_:
.. code-block:: console
$ curl -OL https://github.com/GustavoKatel/alfredcmd/tarball/master
Once you have a copy of the source, you can install it with:
.. code-block:: console
$ python setup.py install
.. _Github repo: https://github.com/GustavoKatel/alfredcmd
.. _tarball: https://github.com/GustavoKatel/alfredcmd/tarball/master
Credits
-------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2018-03-21)
------------------
* First release on PyPI.
Metadata
Release files for alfredcmd 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alfredcmd-0.1.7.tar.gz | 14.0 kB | Without provenance | Details for alfredcmd-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alfredcmd-0.1.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for alfredcmd-0.1.7-py2.py3-none-any.whl |
Total release size: 22.6 kB
Release files / alfredcmd-0.1.7.tar.gz
| Download URL | alfredcmd-0.1.7.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f10acff56393b1dddc076e988b1f7f7b0d323dda3f750942d7d823a00a864795
|
|
BLAKE2b-256 checksum How to use checksums |
059337294321696bcb09edca527a6e09de45fccf2fac4bb66478ca7465eb1cdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / alfredcmd-0.1.7-py2.py3-none-any.whl
| Download URL | alfredcmd-0.1.7-py2.py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c954ff0b45b0a151fe12c175780ddc770fda146eced966b3644f834c3291fd4e
|
|
BLAKE2b-256 checksum How to use checksums |
4376a0dd59ad793cb9e6a680953b5c91ddba484af73b6b13a6d91921ae9e4aa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for alfredcmd 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.